Changeset 11609


Ignore:
Timestamp:
05/03/11 20:20:04 (13 months ago)
Author:
OlivierRaginel
Message:

Item1518: perltidy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/lib/Foswiki/Users/HtPasswdUser.pm

    r11608 r11609  
    183183 
    184184            # implicit untaint OK; data from htpasswd 
    185             my ($hID, $hRealm, $hPasswd, $hEmail ) = $line =~ /^(.*?):(.*?):(.*?)(?::(.*))?$/; 
    186  
    187             if (! $hEmail && $hPasswd =~ m/@/ ) {   # Missing email and Password might contain an email address 
     185            my ( $hID, $hRealm, $hPasswd, $hEmail ) = 
     186              $line =~ /^(.*?):(.*?):(.*?)(?::(.*))?$/; 
     187 
     188            if ( !$hEmail && $hPasswd =~ m/@/ ) 
     189            {    # Missing email and Password might contain an email address 
    188190                $data->{$hID}->{pass} = $hRealm; 
    189191                $data->{$hID}->{emails} = $hPasswd || ''; 
     
    194196            } 
    195197        } 
    196         else {                                      # htpasswd format 
     198        else {    # htpasswd format 
    197199            if ( $line =~ /^(.*?):(.*?)(?::(.*))?$/ ) { 
    198200 
     
    230232    my $db = shift; 
    231233 
    232     unless (-e "$Foswiki::cfg{Htpasswd}{FileName}" ) { 
    233         # Item4544: Document special format used in .htpasswd for email addresses 
    234         open( my $readme, '>', "$Foswiki::cfg{Htpasswd}{FileName}.README" ) or 
    235           throw Error::Simple( $Foswiki::cfg{Htpasswd}{FileName}. 
    236                                  '.README open failed: '.$! ); 
    237  
    238         print $readme "# Foswiki uses a specially crafted .htpasswd file format that should not be\n"; 
    239         print $readme "# manipulated using a standard htpasswd utility or loss of registered emails might occur..\n"; 
    240         print $readme "# (3rd-party utilities do not support the email address format used by Foswiki).\n"; 
     234    unless ( -e "$Foswiki::cfg{Htpasswd}{FileName}" ) { 
     235 
     236       # Item4544: Document special format used in .htpasswd for email addresses 
     237        open( my $readme, '>', "$Foswiki::cfg{Htpasswd}{FileName}.README" ) 
     238          or throw Error::Simple( 
     239            $Foswiki::cfg{Htpasswd}{FileName} . '.README open failed: ' . $! ); 
     240 
     241        print $readme 
     242"# Foswiki uses a specially crafted .htpasswd file format that should not be\n"; 
     243        print $readme 
     244"# manipulated using a standard htpasswd utility or loss of registered emails might occur..\n"; 
     245        print $readme 
     246"# (3rd-party utilities do not support the email address format used by Foswiki).\n"; 
    241247        print $readme "# \n"; 
    242         print $readme "# More information available at: http://foswiki.org/System/UserAuthentication.\n"; 
    243         close( $readme ); 
     248        print $readme 
     249"# More information available at: http://foswiki.org/System/UserAuthentication.\n"; 
     250        close($readme); 
    244251    } 
    245252 
Note: See TracChangeset for help on using the changeset viewer.