From a6c1ff4f92ba2c93f8ebfed3787dc12584d299d4 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 8 May 2019 15:47:10 -0600 Subject: [PATCH] admin_cmd_account_app bugfixes - Fix old/new apps not properly saved for history - Fix documentation not saved --- admin/inc/class.admin_acl.inc.php | 2 +- admin/inc/class.admin_cmd_account_app.inc.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/inc/class.admin_acl.inc.php b/admin/inc/class.admin_acl.inc.php index 8c2819360b..d33821b3fb 100644 --- a/admin/inc/class.admin_acl.inc.php +++ b/admin/inc/class.admin_acl.inc.php @@ -377,7 +377,7 @@ class admin_acl )+(array)$values['admin_cmd']; if($location == 'run') { - $cmd = new admin_cmd_account_app($set_it,$account_id, $app); + $cmd = new admin_cmd_account_app($set_it,$account_id, $app, (array)$values['admin_cmd']); } else { diff --git a/admin/inc/class.admin_cmd_account_app.inc.php b/admin/inc/class.admin_cmd_account_app.inc.php index 930241bd81..4282f82ffb 100644 --- a/admin/inc/class.admin_cmd_account_app.inc.php +++ b/admin/inc/class.admin_cmd_account_app.inc.php @@ -29,7 +29,7 @@ class admin_cmd_account_app extends admin_cmd * @param string|int $account =null account name or id * @param array|string $apps =null app-names */ - function __construct($allow,$account=null,$apps=null) + function __construct($allow,$account=null,$apps=null, $other=array()) { if (!is_array($allow)) { @@ -37,7 +37,7 @@ class admin_cmd_account_app extends admin_cmd 'allow' => $allow, 'account' => $account, 'apps' => $apps, - ); + )+(array)$other; } if (isset($allow['apps']) && !is_array($allow['apps'])) { @@ -65,7 +65,7 @@ class admin_cmd_account_app extends admin_cmd $old_rights = (array)$GLOBALS['egw']->acl->get_app_list_for_id('run', Egroupware\Api\Acl::READ, $account_id); $new_rights = $this->allow ? - $old_rights + array($apps) : + array_merge($old_rights, $apps) : array_diff($old_rights, $apps); $this->set = Array('app' => $new_rights);