Changeset 11609
- Timestamp:
- 05/03/11 20:20:04 (13 months ago)
- File:
-
- 1 edited
-
trunk/core/lib/Foswiki/Users/HtPasswdUser.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/lib/Foswiki/Users/HtPasswdUser.pm
r11608 r11609 183 183 184 184 # 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 188 190 $data->{$hID}->{pass} = $hRealm; 189 191 $data->{$hID}->{emails} = $hPasswd || ''; … … 194 196 } 195 197 } 196 else { # htpasswd format198 else { # htpasswd format 197 199 if ( $line =~ /^(.*?):(.*?)(?::(.*))?$/ ) { 198 200 … … 230 232 my $db = shift; 231 233 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"; 241 247 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); 244 251 } 245 252
Note: See TracChangeset
for help on using the changeset viewer.
