From b4970a5f65f2fdc983f634e8c2241fee0ae84eba Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 23 Feb 2004 13:22:59 +0000 Subject: [PATCH] fixed prob with not changeable pw's, setup::add_acl created acl_rights=0 rows, instead of no rows --- phpgwapi/inc/class.setup.inc.php | 9 ++++++++- phpgwapi/setup/setup.inc.php | 3 +-- phpgwapi/setup/tables_update.inc.php | 12 +++++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.setup.inc.php b/phpgwapi/inc/class.setup.inc.php index f7ea1d931b..7d1a547570 100644 --- a/phpgwapi/inc/class.setup.inc.php +++ b/phpgwapi/inc/class.setup.inc.php @@ -1004,7 +1004,14 @@ } foreach($apps as $app) { - $this->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('$app','$location',$account,$rights)"); + if ($rights) + { + $this->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('$app','$location',$account,$rights)"); + } + else + { + $this->db->query("DELETE FROM phpgw_acl WHERE acl_appname='$app' AND acl_location='$location' AND acl_account=$account"); + } } } } diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index dcf5dd014c..3bef5a942f 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -10,12 +10,11 @@ \**************************************************************************/ // $Id$ - // $Source$ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'phpgwapi'; - $setup_info['phpgwapi']['version'] = '0.9.99.013'; + $setup_info['phpgwapi']['version'] = '0.9.99.014'; $setup_info['phpgwapi']['versions']['current_header'] = '1.26'; $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 2fa41ad00b..775c26490a 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -1017,4 +1017,14 @@ $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.99.013'; return $GLOBALS['setup_info']['phpgwapi']['currentver']; } -?> + + $test[] = '0.9.99.013'; + function phpgwapi_upgrade0_9_99_013() + { + // this update fixes the problem that some users cant change their password + // it was caused be 0 acl_rights values in groups (inserted by setup::add_acl which is fixed too) + $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_acl WHERE acl_appname='preferences' AND acl_location='changepassword' AND acl_rights=0"); + + $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.99.014'; + return $GLOBALS['setup_info']['phpgwapi']['currentver']; + }