diff --git a/admin/inc/accounts_ldap.inc.php b/admin/inc/accounts_ldap.inc.php index 4ae2b26e49..107b94cf4c 100644 --- a/admin/inc/accounts_ldap.inc.php +++ b/admin/inc/accounts_ldap.inc.php @@ -58,22 +58,39 @@ global $phpgw_info, $ldap; $filter = "(|(uid=*))"; - $sr = ldap_search($ldap,$phpgw_info["server"]["ldap_context"],$filter,array("sn","givenname","uid")); + $sr = ldap_search($ldap,$phpgw_info["server"]["ldap_context"],$filter,array("uid")); $info = ldap_get_entries($ldap, $sr); return count($info); } + + function account_view($loginid) + { + global $phpgw_info, $ldap; + + $filter = "(|(uid=$loginid))"; + $sr = ldap_search($ldap,$phpgw_info["server"]["ldap_context"],$filter,array("sn","givenname","uid","uidnumber")); + $aci = ldap_get_entries($ldap, $sr); + + $account_info["account_id"] = $aci[0]["uid"][0]; + $account_info["account_lid"] = $aci[0]["uidnumber"][0]; + $account_info["account_lastname"] = $aci[0]["sn"][0]; + $account_info["account_firstname"] = $aci[0]["givenname"][0]; + + return $account_info; + } function account_read($method,$start,$sort,$order) { global $phpgw_info, $ldap; $filter = "(|(uid=*))"; - $sr = ldap_search($ldap,$phpgw_info["server"]["ldap_context"],$filter,array("sn","givenname","uid")); + $sr = ldap_search($ldap,$phpgw_info["server"]["ldap_context"],$filter,array("sn","givenname","uid","uidnumber")); $info = ldap_get_entries($ldap, $sr); for ($i=0; $ilink("accounts.php")); } $phpgw->db->query("select account_lid from accounts where account_id='$account_id'"); $phpgw->db->next_record(); - $db_perms = $phpgw->accounts->read_apps($phpgw->db->f("account_lid")); + $loginid = $phpgw->db->f("account_lid"); + + $db_perms = $phpgw->accounts->read_apps($loginid); + $account_info = account_view($loginid); - $phpgw->db->query("select * from accounts where account_id='$account_id'"); + $phpgw->db->query("select account_lastlogin,account_lastloginfrom,account_status from accounts " + . "where account_id='$account_id'"); $phpgw->db->next_record(); $account_lastlogin = $phpgw->db->f("account_lastlogin"); $account_lastloginfrom = $phpgw->db->f("account_lastloginfrom"); + $account_status = $phpgw->db->f("account_status"); ?>
@@ -42,17 +50,17 @@ "> - db->f("account_lid"); ?> + "> - db->f("account_firstname"); ?>  +   "> - db->f("account_lastname"); ?>  +   ">