diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index 67e0bf0428..d5efebd585 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.1.001'; + $setup_info['phpgwapi']['version'] = '1.0.1.002'; $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 8b35cb84a9..b618b2581e 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -46,4 +46,30 @@ // identical to 1.0.0.001, only created to get a new version of the final 1.0 packages return phpgwapi_upgrade1_0_0_001(); } + + $test[] = '1.0.0.004'; + function phpgwapi_upgrade1_0_0_004() + { + phpgwapi_upgrade1_0_0_001(); + + // we skip the 1.0.1.001 update as its identitcal to the 1.0.0.003 update, which we already have + $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.0.1.002'; + return $GLOBALS['setup_info']['phpgwapi']['currentver']; + } + + $test[] = '1.0.1.001'; + function phpgwapi_upgrade1_0_1_001() + { + // 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.1.002'; + return $GLOBALS['setup_info']['phpgwapi']['currentver']; + } + ?>