Mercurial > hg > soundsoftware-site
comparison extra/soundsoftware/SoundSoftware.pm @ 1331:1e9b1bdd062e live
SHA1 -> SHA (module renamed)
author | Chris Cannam |
---|---|
date | Thu, 20 Jun 2013 11:33:30 +0100 |
parents | cf4cc816278a |
children | 42618fc5ab46 |
comparison
equal
deleted
inserted
replaced
1330:441b66f148b6 | 1331:1e9b1bdd062e |
---|---|
70 | 70 |
71 use strict; | 71 use strict; |
72 use warnings FATAL => 'all', NONFATAL => 'redefine'; | 72 use warnings FATAL => 'all', NONFATAL => 'redefine'; |
73 | 73 |
74 use DBI; | 74 use DBI; |
75 use Digest::SHA1; | 75 use Digest::SHA; |
76 use Authen::Simple::LDAP; | 76 use Authen::Simple::LDAP; |
77 use Apache2::Module; | 77 use Apache2::Module; |
78 use Apache2::Access; | 78 use Apache2::Access; |
79 use Apache2::ServerRec qw(); | 79 use Apache2::ServerRec qw(); |
80 use Apache2::RequestRec qw(); | 80 use Apache2::RequestRec qw(); |
400 my $project_id = shift; | 400 my $project_id = shift; |
401 my $redmine_user = shift; | 401 my $redmine_user = shift; |
402 my $redmine_pass = shift; | 402 my $redmine_pass = shift; |
403 my $r = shift; | 403 my $r = shift; |
404 | 404 |
405 my $pass_digest = Digest::SHA1::sha1_hex($redmine_pass); | 405 my $pass_digest = Digest::SHA::sha1_hex($redmine_pass); |
406 | 406 |
407 my $cfg = Apache2::Module::get_config | 407 my $cfg = Apache2::Module::get_config |
408 (__PACKAGE__, $r->server, $r->per_dir_config); | 408 (__PACKAGE__, $r->server, $r->per_dir_config); |
409 | 409 |
410 my $query = $cfg->{SoundSoftwareQuery}; | 410 my $query = $cfg->{SoundSoftwareQuery}; |
427 # credentials checked out -- test those now | 427 # credentials checked out -- test those now |
428 | 428 |
429 print STDERR "SoundSoftware.pm: User $redmine_user has required role, checking credentials\n"; | 429 print STDERR "SoundSoftware.pm: User $redmine_user has required role, checking credentials\n"; |
430 | 430 |
431 unless ($auth_source_id) { | 431 unless ($auth_source_id) { |
432 my $salted_password = Digest::SHA1::sha1_hex($salt.$pass_digest); | 432 my $salted_password = Digest::SHA::sha1_hex($salt.$pass_digest); |
433 if ($hashed_password eq $salted_password) { | 433 if ($hashed_password eq $salted_password) { |
434 print STDERR "SoundSoftware.pm: User $redmine_user authenticated via password\n"; | 434 print STDERR "SoundSoftware.pm: User $redmine_user authenticated via password\n"; |
435 $ret = 1; | 435 $ret = 1; |
436 last; | 436 last; |
437 } | 437 } |