mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
Fixes to deal with customfields when LDAP is the backend
This commit is contained in:
parent
686ada2d40
commit
b71e8899b3
@ -432,8 +432,9 @@ class addressbook_so
|
||||
if ($this->somain->delete($where))
|
||||
{
|
||||
// delete customfields, can return 0 if there are no customfields
|
||||
if(!($this->somain instanceof addressbook_sql)) {
|
||||
$this->soextra->delete(array($this->extra_id => $contact));
|
||||
if(!($this->somain instanceof addressbook_sql))
|
||||
{
|
||||
$this->soextra->delete_customfields(array($this->extra_id => $contact));
|
||||
}
|
||||
|
||||
// delete from distribution list(s)
|
||||
@ -504,8 +505,9 @@ class addressbook_so
|
||||
if($error_nr) return $error_nr;
|
||||
|
||||
// save customfields, if not already done by somain->save();
|
||||
if(!($this->somain instanceof addressbook_sql)) {
|
||||
$this->soextra->save($this->data2db($contact));
|
||||
if(!($this->somain instanceof addressbook_sql))
|
||||
{
|
||||
$this->soextra->save_customfields($this->data2db($contact));
|
||||
}
|
||||
return false; // no error
|
||||
}
|
||||
@ -737,8 +739,9 @@ class addressbook_so
|
||||
if (!$new_owner)
|
||||
{
|
||||
$this->somain->delete(array('owner' => $account_id));
|
||||
if(!($this->somain instanceof addressbook_sql)) {
|
||||
$this->soextra->delete(array($this->extra_owner => $account_id));
|
||||
if(!($this->somain instanceof addressbook_sql))
|
||||
{
|
||||
$this->soextra->delete_customfields(array($this->extra_owner => $account_id));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -655,4 +655,13 @@ class addressbook_sql extends so_sql_cf
|
||||
}
|
||||
return false; // no error
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes custom field data
|
||||
* Implemented to deal with LDAP backend, which saves CFs in SQL, but the account record is in LDAP
|
||||
*/
|
||||
function delete_customfields($data)
|
||||
{
|
||||
$this->db->delete($this->extra_table,$data,__LINE__,__FILE__);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user