Small query tweaks.
parent
8cefc4e574
commit
123d9b5b50
13
Redmine.pm
13
Redmine.pm
|
@ -359,10 +359,8 @@ sub check_login {
|
||||||
my ($r, $dbh, $password) = @_;
|
my ($r, $dbh, $password) = @_;
|
||||||
my $user = $r->user;
|
my $user = $r->user;
|
||||||
|
|
||||||
my ($hashed_password, $status, $auth_source_id, $salt) = $dbh->selectrow_array('SELECT hashed_password, status, auth_source_id, salt FROM users WHERE login = ?', undef, $user);
|
my ($hashed_password, $status, $auth_source_id, $salt) = $dbh->selectrow_array('SELECT hashed_password, status, auth_source_id, salt FROM users WHERE login = ?', undef, $user)
|
||||||
|
or return (AUTH_REQUIRED, "unknown user '$user'");
|
||||||
# Not found
|
|
||||||
return (AUTH_REQUIRED, "unknown user '$user'") unless defined($hashed_password);
|
|
||||||
|
|
||||||
# Check password
|
# Check password
|
||||||
if($auth_source_id) {
|
if($auth_source_id) {
|
||||||
|
@ -377,11 +375,8 @@ sub check_login {
|
||||||
"SELECT host,port,tls,account,account_password,base_dn,attr_login from auth_sources WHERE id = ?",
|
"SELECT host,port,tls,account,account_password,base_dn,attr_login from auth_sources WHERE id = ?",
|
||||||
undef,
|
undef,
|
||||||
$auth_source_id
|
$auth_source_id
|
||||||
);
|
)
|
||||||
|
or return (SERVER_ERROR, "Undefined authentication source for '$user'");
|
||||||
# Check them
|
|
||||||
return (SERVER_ERROR, "Undefined authentication source for '$user'")
|
|
||||||
unless defined $host;
|
|
||||||
|
|
||||||
# Connect to the LDAP server
|
# Connect to the LDAP server
|
||||||
my $ldap = Authen::Simple::LDAP->new(
|
my $ldap = Authen::Simple::LDAP->new(
|
||||||
|
|
Loading…
Reference in New Issue