Ignore:
Timestamp:
01/23/12 19:00:19 (4 months ago)
Author:
CrawfordCurrie
Message:

Item11458: simplify and streamline handling of password file; it now must exist for Foswiki to run, and will be created by =configure= if not. This lets us do enhanced checking in =configure= while reducing the runtime burden.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/lib/Foswiki/UI/Register.pm

    r13643 r13796  
    101101    } 
    102102    elsif ( $action eq 'resetPassword' ) { 
     103        if ( !$session->inContext("passwords_modifyable") ) { 
     104            throw Foswiki::OopsException( 
     105                'attention', 
     106                web   => $session->{webName}, 
     107                topic => $session->{topicName}, 
     108                def   => 'passwords_disabled' 
     109            ); 
     110        } 
    103111        require Foswiki::UI::Passwords; 
    104112        Foswiki::UI::Passwords::resetpasswd($session); 
     
    287295        my $cUID = $users->addUser( 
    288296            $row->{LoginName}, $row->{WikiName}, 
    289             $row->{Password},  $row->{Email} 
     297            $session->inContext("passwords_modifyable") ? $row->{Password} : undef, 
     298            $row->{Email} 
    290299        ); 
    291300        $log .= 
     
    837846    my $users = $session->{users}; 
    838847    try { 
    839         unless ( defined( $data->{Password} ) ) { 
     848        unless ( !$session->inContext("passwords_modifyable") || 
     849                 defined( $data->{Password} ) ) { 
    840850 
    841851            # SMELL: should give consideration to disabling 
     
    855865        my $cUID = $users->addUser( 
    856866            $data->{LoginName}, $data->{WikiName}, 
    857             $data->{Password},  $data->{Email} 
     867            $session->inContext("passwords_modifyable") ? $data->{Password} : undef, 
     868            $data->{Email} 
    858869        ); 
    859870        my $log = _createUserTopic( $session, $data ); 
Note: See TracChangeset for help on using the changeset viewer.