Item1712: Warning in TopicUserMapping when Registration is disabled

pencil
Priority: Low
Current State: Closed
Released In: 1.0.6
Target Release: patch
Applies To: Engine
Component: TopicUserMappingContrib
Branches:
Reported By: CharlesAdicke
Waiting For:
Last Change By: KennethLavrsen
In my site I want to prevent automatic new user registration. So I set in LocalSite.cfg $Foswiki::cfg{Register}{EnableNewUserRegistration} = 0;

and (just to be sure) set the .htpasswd file to Readonly.

In this setup I get for each access the warning message in the warnXXX.txt logfile:
| 2009-06-11T12:23:01Z warning | TopicUserMapping has TURNED OFF EnableNewUserRegistration, because the password file is read only. |

In my opinion this message should not be issued, because I already unset the EnableNewUserRegistration by myself.

Suggested fix:
diff -u /var/lib/foswiki/lib/Foswiki/Users/TopicUserMapping.pm-orginal /var/lib/foswiki/lib/Foswiki/Users/TopicUserMapping.pm
--- /var/lib/foswiki/lib/Foswiki/Users/TopicUserMapping.pm-orginal   2009-04-25 20:25:18.000000000 +0200
+++ /var/lib/foswiki/lib/Foswiki/Users/TopicUserMapping.pm   2009-06-11 14:32:48.000000000 +0200
@@ -86,7 +86,8 @@
 #'none' is a special case, as it means we're not actually using the password manager for
 # registration.
     if ( $this->{passwords}->readOnly()
-        && ( $Foswiki::cfg{PasswordManager} ne 'none' ) )
+        && ( $Foswiki::cfg{PasswordManager} ne 'none' ) 
+        && ( $Foswiki::cfg{Register}{EnableNewUserRegistration} != 0 ) )
     {
         $session->logger->log('warning',
 'TopicUserMapping has TURNED OFF EnableNewUserRegistration, because the password file is read only.'

-- CharlesAdicke

Good little fix

Implemented with small modification

-- KennethLavrsen - 11 Jun 2009

ItemTemplate edit

Summary Warning in TopicUserMapping when Registration is disabled
ReportedBy CharlesAdicke
Codebase 1.0.5, trunk
SVN Range
AppliesTo Engine
Component TopicUserMappingContrib
Priority Low
CurrentState Closed
WaitingFor
Checkins distro:9a6e6469b828 distro:d1d21aea3127
TargetRelease patch
ReleasedIn 1.0.6
Topic revision: r5 - 22 Jun 2009, KennethLavrsen
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