forked from extern/egroupware
Add change_owner for admin
This commit is contained in:
parent
ef73912b1e
commit
95dc6489fc
@ -701,6 +701,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Used by admin to change ownership on account delete
|
||||
function change_owner($old_owner='',$new_owner='')
|
||||
{
|
||||
if (!($new_owner && $old_owner))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
$sri = ldap_search($this->ldap, $phpgw_info["server"]["ldap_contact_context"], "phpgwowner=".$old_owner);
|
||||
$ldap_fields = ldap_get_entries($this->ldap, $sri);
|
||||
|
||||
$entry = "";
|
||||
while (list($null,$entry) = each($ldap_fields)) {
|
||||
$err = ldap_modify($this->ldap,$dn,array('phpgwowner' => $new_owner));
|
||||
}
|
||||
|
||||
$this->db->query("update $this->ext_table set contact_owner='$new_owner' WHERE contact_owner=$owner",__LINE__,__FILE__);
|
||||
return;
|
||||
}
|
||||
|
||||
// This is where the real work of delete() is done, shared class file contains calling function
|
||||
function delete_($id)
|
||||
{
|
||||
@ -733,7 +753,7 @@
|
||||
}
|
||||
|
||||
if ($owner) {
|
||||
$sri = ldap_search($this->ldap, $phpgw_info["server"]["ldap_contact_context"], "uidnumber=".$owner);
|
||||
$sri = ldap_search($this->ldap, $phpgw_info["server"]["ldap_contact_context"], "phpgwowner=".$owner);
|
||||
$ldap_fields = ldap_get_entries($this->ldap, $sri);
|
||||
|
||||
$entry = "";
|
||||
|
@ -577,6 +577,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Used by admin to change ownership on account delete
|
||||
function change_owner($old_owner='',$new_owner='')
|
||||
{
|
||||
if (!($new_owner && $old_owner))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
$this->db->query("update $this->std_table set owner='$new_owner' WHERE owner=$old_owner",__LINE__,__FILE__);
|
||||
$this->db->query("update $this->ext_table set contact_owner='$new_owner' WHERE contact_owner=$old_owner",__LINE__,__FILE__);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// This is where the real work of delete() is done, shared class file contains calling function
|
||||
function delete_($id)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user