Item1712: Warning in TopicUserMapping when Registration is disabled
Priority: Low
Current State: Closed
Released In: 1.0.6
Target Release: patch
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