This question about Configuration: Asked

Problem with AllowLoginName in configure

I set it on once and since then I've been having trouble with the user permissions, I think it is because now the users aren't recognized by the system.

I've seen in the "Access denied" message and it shows the username without any capital letters, does anyone know if this is the problem (or it's something else) and how to fix it?

Thanks in advance

-- DaniGil - 30 Jul 2015

What mapper are you using? Default is TopicUserMapping. It uses a line in the WikiUsers topic to map from WikiName to LoginName. When you registered the user, that's when the mapping was created. So if you registered, and then later changed the setting, you have broken the mapping.

If this is the case, please try registering a new user complete with a login name. and see if that user works. If that's true, you can carefully edit the WikiUsers topic to fix up the login name mapping. The format is quite particular.

-- GeorgeClark - 30 Jul 2015

I'm using the mapper set by default. I created a new user to test that and it doesn't work either, unless I change all the users to lowercase instead of using their WikiNames, which, as I won't be the admin once the wiki starts working, could be pretty messy.

Please let me know if you think of a solution. If you can't, I can instead write a small guide of how to write the users in the WikiGroups topic. It's not a life-or-death issue, but would be nice to know how to solve it.

-- DaniGil - 31 Jul 2015

I'm confused as to what's happening. I installed a test copy of Foswiki, and configured it as follows:

$Foswiki::cfg{LoginManager} = 'Foswiki::LoginManager::TemplateLogin';
$Foswiki::cfg{Register}{AllowLoginName} = 1;

I registered a couple of users, giving them various login names:

   * FredFling - fredfling - 31 Jul 2015
   * JoeUser - JoeUser - 31 Jul 2015
   * LarryLower - larry - 31 Jul 2015

And my .htpasswd contains:

Finally I set access controls, both using traditional bullet type sets, and the editor's permissions form, on a couple of topics: (Output from grep ALLOWTOPIC data/Sandbox)

OnlyJoe.txt:%META:PREFERENCE{name="ALLOWTOPICVIEW" title="ALLOWTOPICVIEW" type="Set" value="JoeUser"}%
OnlyLarry.txt:   * Set ALLOWTOPICVIEW = LarryLower

And everything is working fine.
  • Login has to be done with the "login name", so login as "larry" for ex, not LarryLower
  • JoeUser can still login ... that account was from before I made the change
  • The OnlyJoe topic can only be viewed by JoeUser, and the message is correct
  • The OnlyLarry topic can only be viewed by LarryLower

Access controls remain set by WikiName, login name works for authentication. So everything works fine. Later I also enabled the expert setting: $Foswiki::cfg{TemplateLogin}{AllowLoginUsingEmailAddress} = 1; and that works as well.

Could you review what you've been doing and report if anything is different?

-- Main.GeorgeClark - 31 Jul 2015 - 13:37

The problem is that I've set AllowLoginName to 0 again, because I want them to use their wikiname, but when any of the users (both previous to the change and the posterior ones) log in, they don't have their permissions correctly set.

So it seems that the problem doesn't get fixed by just disabling it and I don't know how to proceed.

I still have looked into some users previously created and the file doesn't seem wrong at this line
%META:PREFERENCE{name="ALLOWTOPICVIEW" title="ALLOWTOPICVIEW" type="Set" value="PepeGotera"}%

-- DaniGil - 04 Aug 2015

You really should not change settings like this on the fly. Altering it after users have registered requires manual updates. What do you mean by "They don't have their permissions correctly set?"

-- GeorgeClark - 05 Aug 2015

Because the permissions only work when I change their name to only lowercase, i.e.:
- WikiName: PepeGotera
- Name used in WikiGroups: pepegotera

For now it's the only way I've found so the user acquires the permissions from the group I put it in.

-- DaniGil - 06 Aug 2015

QuestionForm edit

Subject Configuration
Version Foswiki 2.0.0
Status Asked
Related Topics
Topic revision: r9 - 09 Sep 2015, MichaelDaum - This page was cached on 17 Feb 2019 - 22:43.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy