From: <ral...@us...> - 2003-09-24 12:21:42
|
Update of /cvsroot/egroupware/phpgwapi/inc In directory sc8-pr-cvs1:/tmp/cvs-serv3506 Modified Files: class.auth_ldap.inc.php Log Message: fixed account-enabled check for account-storage != ldap Index: class.auth_ldap.inc.php =================================================================== RCS file: /cvsroot/egroupware/phpgwapi/inc/class.auth_ldap.inc.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** class.auth_ldap.inc.php 21 Sep 2003 19:02:12 -0000 1.21 --- class.auth_ldap.inc.php 24 Sep 2003 12:21:38 -0000 1.22 *************** *** 57,61 **** /* find the dn for this uid, the uid is not always in the dn */ $attributes = array( "uid", "dn" ); ! $filter = "(&(uid=$username)(phpgwaccountstatus=A))"; $sri = ldap_search($ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $attributes); $allValues = ldap_get_entries($ldap, $sri); --- 57,68 ---- /* find the dn for this uid, the uid is not always in the dn */ $attributes = array( "uid", "dn" ); ! 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); *************** *** 75,78 **** --- 82,91 ---- 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; } |