From 61b954620eb054da38ce72d1737e82b2ba647bb5 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 10 Jul 2005 10:00:37 +0000 Subject: [PATCH] update to automatic install the new home app --- phpgwapi/setup/setup.inc.php | 2 +- phpgwapi/setup/tables_update.inc.php | 43 ++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index b659f27db7..646d599808 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.009'; + $setup_info['phpgwapi']['version'] = '1.0.1.010'; $setup_info['phpgwapi']['versions']['current_header'] = '1.28'; $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 e2f9c929fa..ef4c1133ed 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -462,4 +462,47 @@ return $GLOBALS['setup_info']['phpgwapi']['currentver']; } + $test[] = '1.0.1.009'; + function phpgwapi_upgrade1_0_1_009() + { + if (@file_exists(EGW_SERVER_ROOT . '/home/setup/setup.inc.php')) + { + // automatic install of the new home app + include(EGW_SERVER_ROOT . '/home/setup/setup.inc.php'); + $home_version = $setup_info['home']['version']; + + $GLOBALS['phpgw_setup']->db->insert('phpgw_applications',array( + 'app_enabled' => $setup_info['home']['enable'], + 'app_order' => $setup_info['home']['app_order'], + 'app_version' => $setup_info['home']['version'], + 'app_tables' => '', + ),array( + 'app_name' => 'home', + ),__LINE__,__FILE__); + + // give all users and groups with preferences rights, rights for the home app. + $GLOBALS['phpgw_setup']->db->select('phpgw_acl','acl_account',array( + 'acl_appname' => 'preferences', + 'acl_location' => 'run', + 'acl_rights' => 1, + ),__LINE__,__FILE__); + $accounts_with_preference_rights = array(); + while (($row = $GLOBALS['phpgw_setup']->db->row(true))) + { + $accounts_with_preference_rights[] = $row['acl_account']; + } + foreach($accounts_with_preference_rights as $account) + { + $GLOBALS['phpgw_setup']->db->insert('phpgw_acl',array( + 'acl_rights' => 1, + ),array( + 'acl_appname' => 'home', + 'acl_location' => 'run', + 'acl_account' => $account, + ),__LINE__,__FILE__); + } + } + $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.0.1.010'; + return $GLOBALS['setup_info']['phpgwapi']['currentver']; + } ?>