##// END OF EJS Templates
Merged r8882 from trunk....
Jean-Philippe Lang -
r8998:0b0f819cfa51
parent child
Show More
@@ -99,7 +99,7 use strict;
99 use warnings FATAL => 'all', NONFATAL => 'redefine';
99 use warnings FATAL => 'all', NONFATAL => 'redefine';
100
100
101 use DBI;
101 use DBI;
102 use Digest::SHA1;
102 use Digest::SHA;
103 # optional module for LDAP authentication
103 # optional module for LDAP authentication
104 my $CanUseLDAPAuth = eval("use Authen::Simple::LDAP; 1");
104 my $CanUseLDAPAuth = eval("use Authen::Simple::LDAP; 1");
105
105
@@ -327,7 +327,7 sub is_member {
327 my $dbh = connect_database($r);
327 my $dbh = connect_database($r);
328 my $project_id = get_project_identifier($r);
328 my $project_id = get_project_identifier($r);
329
329
330 my $pass_digest = Digest::SHA1::sha1_hex($redmine_pass);
330 my $pass_digest = Digest::SHA::sha1_hex($redmine_pass);
331
331
332 my $access_mode = defined $read_only_methods{$r->method} ? "R" : "W";
332 my $access_mode = defined $read_only_methods{$r->method} ? "R" : "W";
333
333
@@ -346,7 +346,7 sub is_member {
346
346
347 unless ($auth_source_id) {
347 unless ($auth_source_id) {
348 my $method = $r->method;
348 my $method = $r->method;
349 my $salted_password = Digest::SHA1::sha1_hex($salt.$pass_digest);
349 my $salted_password = Digest::SHA::sha1_hex($salt.$pass_digest);
350 if ($hashed_password eq $salted_password && (($access_mode eq "R" && $permissions =~ /:browse_repository/) || $permissions =~ /:commit_access/) ) {
350 if ($hashed_password eq $salted_password && (($access_mode eq "R" && $permissions =~ /:browse_repository/) || $permissions =~ /:commit_access/) ) {
351 $ret = 1;
351 $ret = 1;
352 last;
352 last;
General Comments 0
You need to be logged in to leave comments. Login now