mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
* Admin/Addressbook: do NOT mark accounts as deleted, as accounts do NOT know that state, always deleted them and allow to cleanup already marked as deleted accounts in addressbook
This commit is contained in:
parent
3699d928ac
commit
e297cc3fa1
@ -725,7 +725,10 @@ class addressbook_bo extends addressbook_so
|
||||
if ($this->check_perms(EGW_ACL_DELETE,$c,$deny_account_delete))
|
||||
{
|
||||
if (!($old = $this->read($id))) return false;
|
||||
if ($this->delete_history != '' && $old['tid'] != addressbook_so::DELETED_TYPE)
|
||||
// check if we only mark contacts as deleted, or really delete them
|
||||
// already marked as deleted item and accounts are always really deleted
|
||||
// we cant mark accounts as deleted, as no such thing exists for accounts!
|
||||
if ($old['owner'] && $this->delete_history != '' && $old['tid'] != addressbook_so::DELETED_TYPE)
|
||||
{
|
||||
$delete = $old;
|
||||
$delete['tid'] = addressbook_so::DELETED_TYPE;
|
||||
@ -745,10 +748,11 @@ class addressbook_bo extends addressbook_so
|
||||
}
|
||||
else
|
||||
{
|
||||
return $ok;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
//error_log(__METHOD__.'('.array2string($contact).', deny_account_delete='.array2string($deny_account_delete).', check_etag='.array2string($check_etag).' returning '.array2string($ok));
|
||||
return $ok;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -691,9 +691,11 @@ class addressbook_ui extends addressbook_bo
|
||||
$action_msg = lang('deleted');
|
||||
if (($Ok = !!($contact = $this->read($id)) && $this->check_perms(EGW_ACL_DELETE,$contact)))
|
||||
{
|
||||
if ($contact['owner']) // regular contact
|
||||
if ($contact['owner'] || // regular contact or
|
||||
// already deleted account (should no longer happen, but needed to allow for cleanup)
|
||||
$contact['tid'] == addressbook_so::DELETED_TYPE)
|
||||
{
|
||||
$Ok = $this->delete($id);
|
||||
$Ok = $this->delete($id, $contact['tid'] != addressbook_so::DELETED_TYPE);
|
||||
}
|
||||
// delete single account --> redirect to admin
|
||||
elseif (count($checked) == 1 && $contact['account_id'])
|
||||
|
Loading…
Reference in New Issue
Block a user