mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 12:21:26 +02:00
building the new class
This commit is contained in:
parent
a6abda7775
commit
2dbca7efea
@ -103,45 +103,30 @@
|
|||||||
|
|
||||||
function get_list()
|
function get_list()
|
||||||
{
|
{
|
||||||
global $phpgw, $phpgw_info;
|
global $phpgw;
|
||||||
|
|
||||||
$sql = "select * from phpgw_accounts";
|
|
||||||
$this->db->query($sql,__LINE__,__FILE__);
|
|
||||||
while ($this->db->next_record())
|
|
||||||
{
|
|
||||||
$accounts[] = Array("account_id" => $this->db->f("account_id"),
|
|
||||||
"account_lid" => $this->db->f("account_lid"),
|
|
||||||
"account_type" => $this->db->f("account_type"),
|
|
||||||
"account_firstname" => $this->db->f("account_firstname"),
|
|
||||||
"account_lastname" => $this->db->f("account_lastname"),
|
|
||||||
"account_status" => $this->db->f("account_status")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// get a ldap connection handle
|
// get a ldap connection handle
|
||||||
$ds = $phpgw->common->ldapConnect();
|
$ds = $phpgw->common->ldapConnect();
|
||||||
|
|
||||||
// search the dn for the given uid
|
// search the dn for the given uid
|
||||||
$sri = ldap_search($ds, $phpgw_info["server"]["ldap_context"], "uid=".$this->account_id);
|
$sri = ldap_search($ds, $phpgw_info["server"]["ldap_context"], "uid=*kd");
|
||||||
$allValues = ldap_get_entries($ds, $sri);
|
$allValues = ldap_get_entries($ds, $sri);
|
||||||
|
|
||||||
/* Now dump it into the array; take first entry found */
|
for ($i=0, $j=0; $i<$info["count"]; $i++,$j++)
|
||||||
$this->data["account_id"] = $allValues[0]["uidnumber"][0];
|
{
|
||||||
$this->data["account_lid"] = $allValues[0]["uid"][0];
|
|
||||||
$this->data["account_dn"] = $allValues[0]["dn"];
|
|
||||||
$this->data["firstname"] = $allValues[0]["givenname"][0];
|
|
||||||
$this->data["lastname"] = $allValues[0]["sn"][0];
|
|
||||||
$this->data["fullname"] = $allValues[0]["cn"][0];
|
|
||||||
|
|
||||||
$this->db->query("select * from phpgw_accounts where account_id='" . $this->account_id . "'",__LINE__,__FILE__);
|
$this->db->query("select * from phpgw_accounts where account_id='" . $allValues[$i]["uidnumber"][0] . "'",__LINE__,__FILE__);
|
||||||
$this->db->next_record();
|
$this->db->next_record();
|
||||||
|
|
||||||
$this->data["lastlogin"] = $this->db->f("account_lastlogin");
|
$accounts[] = Array("account_id" => $allValues[$i]["uidnumber"][0],
|
||||||
$this->data["lastloginfrom"] = $this->db->f("account_lastloginfrom");
|
"account_lid" => $allValues[$i]["uid"][0],
|
||||||
$this->data["lastpasswd_change"] = $this->db->f("account_lastpwd_change");
|
"account_type" => $this->db->f("account_type"),
|
||||||
$this->data["status"] = $this->db->f("account_status");
|
"account_firstname" => $allValues[$i]["givenname"][0],
|
||||||
|
"account_lastname" => $allValues[$i]["sn"][0],
|
||||||
|
"account_status" => $this->db->f("account_status")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->data;
|
|
||||||
return $accounts;
|
return $accounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,13 +161,41 @@
|
|||||||
{
|
{
|
||||||
global $phpgw, $phpgw_info;
|
global $phpgw, $phpgw_info;
|
||||||
|
|
||||||
return "u";
|
$this->db->query("SELECT account_type FROM phpgw_accounts WHERE account_id='".$account_id."'",__LINE__,__FILE__);
|
||||||
|
if ($this->db->num_rows())
|
||||||
|
{
|
||||||
|
$this->db->next_record();
|
||||||
|
return $this->db->f("account_type");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return False;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function exists($accountname)
|
function exists($accountname)
|
||||||
|
{
|
||||||
|
global $phpgw, $phpgw_info;
|
||||||
|
|
||||||
|
if (gettype($account_id) == "string")
|
||||||
|
{
|
||||||
|
$account_id = $this->name2id($account_id);
|
||||||
|
$sql = "SELECT account_id FROM phpgw_accounts WHERE account_lid='".$account_id."'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = "SELECT account_id FROM phpgw_accounts WHERE account_id='".$account_id."'";
|
||||||
|
}
|
||||||
|
$this->db->query($sql,__LINE__,__FILE__);
|
||||||
|
if ($this->db->num_rows())
|
||||||
{
|
{
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function auto_add($account_name, $passwd, $default_prefs=False, $default_acls= False)
|
function auto_add($account_name, $passwd, $default_prefs=False, $default_acls= False)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user