From e8538bb3daf4dfc73a49758420f0fc2de3c51914 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 15 Sep 2016 17:37:04 +0200 Subject: [PATCH] Fix add distribution list doesn't work if add_default gets set as default/forced by admin --- addressbook/inc/class.addressbook_ui.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index c6115f6994..8795fe0638 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -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)) {