mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-12 17:08:34 +01:00
fixed account-enabled check for account-storage != ldap
This commit is contained in:
parent
d0d9dc1721
commit
54bcb34236
@ -56,7 +56,14 @@
|
||||
}
|
||||
/* find the dn for this uid, the uid is not always in the dn */
|
||||
$attributes = array( "uid", "dn" );
|
||||
$filter = "(&(uid=$username)(phpgwaccountstatus=A))";
|
||||
if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap')
|
||||
{
|
||||
$filter = "(&(uid=$username)(phpgwaccountstatus=A))";
|
||||
}
|
||||
else
|
||||
{
|
||||
$filter = "(uid=$username)";
|
||||
}
|
||||
$sri = ldap_search($ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $attributes);
|
||||
$allValues = ldap_get_entries($ldap, $sri);
|
||||
if ($allValues['count'] > 0)
|
||||
@ -74,6 +81,12 @@
|
||||
/* try to bind as the user with user suplied password */
|
||||
if (@ldap_bind($ldap, $userDN, $passwd))
|
||||
{
|
||||
if ($GLOBALS['phpgw_info']['server']['account_repository'] != 'ldap')
|
||||
{
|
||||
$account = CreateObject('phpgwapi.accounts',$username,'u');
|
||||
$data = $account->read_repository();
|
||||
return $data['status'] == 'A';
|
||||
}
|
||||
return True;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user