From d278fe4931ea678666ec00dc2fcf0c0724c103e3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 21 Aug 2004 16:19:40 +0000 Subject: [PATCH] deleting all acl-entries of not (longer) existing accounts (users and groups), these entries have'nt got delete so far and cause a lot of mailfunctioning in the ACL class ==> update to version 1.0.0.004 --- phpgwapi/setup/setup.inc.php | 2 +- phpgwapi/setup/tables_update.inc.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index 556a4ced45..64af13093c 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -14,7 +14,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'phpgwapi'; - $setup_info['phpgwapi']['version'] = '1.0.0.003'; + $setup_info['phpgwapi']['version'] = '1.0.0.004'; $setup_info['phpgwapi']['versions']['current_header'] = '1.27'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index 27bd242aac..bc33d03327 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -1410,4 +1410,20 @@ $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.0.0.003'; return $GLOBALS['setup_info']['phpgwapi']['currentver']; } + + + $test[] = '1.0.0.003'; + function phpgwapi_upgrade1_0_0_003() + { + // removing the ACL entries of deleted accounts + $GLOBALS['phpgw_setup']->setup_account_object(); + if (($all_accounts = $GLOBALS['phpgw']->accounts->search(array('type'=>'both')))) + { + $all_accounts = array_keys($all_accounts); + $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_acl WHERE acl_account NOT IN (".implode(',',$all_accounts).")",__LINE__,__FILE__); + $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_acl WHERE acl_appname='phpgw_group' AND acl_location NOT IN ('".implode("','",$all_accounts)."')",__LINE__,__FILE__); + } + $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.0.0.004'; + return $GLOBALS['setup_info']['phpgwapi']['currentver']; + } ?>