From: <de...@de...> - 2007-04-29 15:51:31
|
Author: SvenDowideit Date: 2007-04-29 10:51:33 -0500 (Sun, 29 Apr 2007) New Revision: 13586 Modified: twiki/branches/MAIN/lib/TWiki/Users.pm Log: Item3954: added supportsRegistration() method to TWiki::Users with added context, so that UI's can disable registration Modified: twiki/branches/MAIN/lib/TWiki/Users.pm =================================================================== --- twiki/branches/MAIN/lib/TWiki/Users.pm 2007-04-29 15:34:42 UTC (rev 13585) +++ twiki/branches/MAIN/lib/TWiki/Users.pm 2007-04-29 15:51:33 UTC (rev 13586) @@ -110,7 +110,7 @@ die "User Mapping Manager: $@" if $@; $this->{mapping} = $implUserMappingManager->new( $session ); #the UI for rego supported/not is different from rego temporarily turned off - $session->enterContext('registration_supported') if $this->{mapping}->supportsRegistration(); + $session->enterContext('registration_supported') if $this->supportsRegistration(); $implUserMappingManager =~ /^TWiki::Users::(.*)$/; $this->{mapping_id} = $1.'_'; @@ -140,6 +140,12 @@ $this->{login} = {}; } +#return 1 if the UserMapper supports registration (ie can create new users) +sub supportsRegistration { + my( $this ) = @_; + return $this->{mapping}->supportsRegistration(); +} + # global used by test harness to give predictable results use vars qw( $password ); @@ -156,7 +162,7 @@ =pod ----++ ObjectMethod addUser($login, $wikiname, $password, $emails) -> ($status, $user, $password) +---++ ObjectMethod addUser($login, $wikiname, $password, $emails) -> ($user, $password) * =$login= - user login name. If =undef=, =$wikiname= will be used as the login name. * =$wikiname= - user wikiname. If =undef=, the user mapper will be asked |