Fix add distribution list doesn't work if add_default gets set as default/forced by admin

This commit is contained in:
Hadi Nategh 2016-09-15 17:37:04 +02:00
parent 88128b6a8b
commit 7442bff49c

View File

@ -943,7 +943,14 @@ window.egw_LAB.wait(function() {
{
// Set owner to current user, if not set
$owner = $_owner ? $_owner : $GLOBALS['egw_info']['user']['account_id'];
// if admin forced or set default for add_default pref
// consider default_addressbook as owner which already
// covered all cases in contacts class.
if ($owner == (int)$GLOBALS['egw']->preferences->default['addressbook']['add_default'] ||
$owner == (int)$GLOBALS['egw']->preferences->forced['addressbook']['add_default'])
{
$owner = $this->default_addressbook;
}
// Check for valid list & permissions
if(!(int)$list_id && !$this->check_list(null,EGW_ACL_ADD|EGW_ACL_EDIT,$owner))
{