From b5b6784ec181356f89c5b0deedc3aaaf8f6b6ff2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 4 Aug 2015 09:55:29 +0000 Subject: [PATCH] * Admin/PostgreSQL: shorten ACL labels used to limit admin rights to 16 char and fixed stalled 14.3 update for PostgreSQL --- admin/inc/class.admin_accesslog.inc.php | 4 +- admin/inc/class.admin_categories.inc.php | 14 +- admin/inc/class.admin_hooks.inc.php | 20 +-- admin/inc/class.uiasyncservice.inc.php | 2 +- admin/inc/class.uiconfig.inc.php | 6 +- admin/inc/class.uimainscreen.inc.php | 6 +- admin/inc/hook_acl_manager.inc.php | 213 +++++++++++------------ phpgwapi/setup/tables_update.inc.php | 7 + 8 files changed, 138 insertions(+), 134 deletions(-) diff --git a/admin/inc/class.admin_accesslog.inc.php b/admin/inc/class.admin_accesslog.inc.php index 4aed86e0a8..2af7986864 100644 --- a/admin/inc/class.admin_accesslog.inc.php +++ b/admin/inc/class.admin_accesslog.inc.php @@ -142,7 +142,7 @@ class admin_accesslog if (is_array($content)) $sessions_list = $content['nm']['session_list']; // check if user has access to requested functionality - if ($GLOBALS['egw']->acl->check($sessions_list ? 'current_sessions_access' : 'access_log_access',1,'admin')) + if ($GLOBALS['egw']->acl->check($sessions_list ? 'current_sessions' : 'access_log_acces',1,'admin')) { $GLOBALS['egw']->redirect_link('/index.php'); } @@ -283,7 +283,7 @@ class admin_accesslog { unset($sessionid[$key]); // dont allow to kill own sessions } - if ($GLOBALS['egw']->acl->check('current_sessions_access',8,'admin')) + if ($GLOBALS['egw']->acl->check('current_sessions',8,'admin')) { $failed ++; } diff --git a/admin/inc/class.admin_categories.inc.php b/admin/inc/class.admin_categories.inc.php index e272f18584..7f6fb7c875 100644 --- a/admin/inc/class.admin_categories.inc.php +++ b/admin/inc/class.admin_categories.inc.php @@ -57,7 +57,7 @@ class admin_categories { throw new egw_exception_no_permission_admin(); } - if ($GLOBALS['egw']->acl->check('global_categories_access',1,'admin')) + if ($GLOBALS['egw']->acl->check('global_categorie',1,'admin')) { $GLOBALS['egw']->redirect_link('/index.php'); } @@ -71,12 +71,12 @@ class admin_categories { if (is_null(self::$acl_search)) { - self::$acl_search = !$GLOBALS['egw']->acl->check('global_categories_access',2,'admin'); - self::$acl_add = !$GLOBALS['egw']->acl->check('global_categories_access',4,'admin'); - self::$acl_view = !$GLOBALS['egw']->acl->check('global_categories_access',8,'admin'); - self::$acl_edit = !$GLOBALS['egw']->acl->check('global_categories_access',16,'admin'); - self::$acl_delete = !$GLOBALS['egw']->acl->check('global_categories_access',32,'admin'); - self::$acl_add_sub= !$GLOBALS['egw']->acl->check('global_categories_access',64,'admin'); + self::$acl_search = !$GLOBALS['egw']->acl->check('global_categorie',2,'admin'); + self::$acl_add = !$GLOBALS['egw']->acl->check('global_categorie',4,'admin'); + self::$acl_view = !$GLOBALS['egw']->acl->check('global_categorie',8,'admin'); + self::$acl_edit = !$GLOBALS['egw']->acl->check('global_categorie',16,'admin'); + self::$acl_delete = !$GLOBALS['egw']->acl->check('global_categorie',32,'admin'); + self::$acl_add_sub= !$GLOBALS['egw']->acl->check('global_categorie',64,'admin'); } } diff --git a/admin/inc/class.admin_hooks.inc.php b/admin/inc/class.admin_hooks.inc.php index bbc95bd440..89ba8a24a4 100644 --- a/admin/inc/class.admin_hooks.inc.php +++ b/admin/inc/class.admin_hooks.inc.php @@ -53,7 +53,7 @@ class admin_hooks if ($GLOBALS['egw_info']['user']['apps']['admin']) { - if (! $GLOBALS['egw']->acl->check('site_config_access',1,'admin')) + if (! $GLOBALS['egw']->acl->check('site_config_acce',1,'admin')) { $file['Site Configuration'] = egw::link('/index.php','menuaction=admin.uiconfig.index&appname=admin'); } @@ -80,26 +80,26 @@ class admin_hooks ); } - if (! $GLOBALS['egw']->acl->check('applications_access',1,'admin')) + if (! $GLOBALS['egw']->acl->check('applications_acc',1,'admin')) { $file['Applications'] = egw::link('/index.php','menuaction=admin.admin_applications.index'); } - if (! $GLOBALS['egw']->acl->check('global_categories_access',1,'admin')) + if (! $GLOBALS['egw']->acl->check('global_categorie',1,'admin')) { $file['Global Categories'] = egw::link('/index.php','menuaction=admin.admin_categories.index&appname=phpgw&ajax=true'); } - if (!$GLOBALS['egw']->acl->check('mainscreen_message_access',1,'admin') || !$GLOBALS['egw']->acl->check('mainscreen_message_access',2,'admin')) + if (!$GLOBALS['egw']->acl->check('mainscreen_messa',1,'admin') || !$GLOBALS['egw']->acl->check('mainscreen_messa',2,'admin')) { $file['Change Main Screen Message'] = egw::link('/index.php','menuaction=admin.uimainscreen.index'); } - if (! $GLOBALS['egw']->acl->check('current_sessions_access',1,'admin')) + if (! $GLOBALS['egw']->acl->check('current_sessions',1,'admin')) { $file['View Sessions'] = egw::link('/index.php','menuaction=admin.admin_accesslog.sessions&ajax=true'); } - if (! $GLOBALS['egw']->acl->check('access_log_access',1,'admin')) + if (! $GLOBALS['egw']->acl->check('access_log_acces',1,'admin')) { $file['View Access Log'] = egw::link('/index.php','menuaction=admin.admin_accesslog.index&ajax=true'); } @@ -110,12 +110,12 @@ class admin_hooks $file['View Error Log'] = egw::link('/index.php','menuaction=admin.uilog.list_log'); }*/ - if (! $GLOBALS['egw']->acl->check('applications_access',16,'admin')) + if (! $GLOBALS['egw']->acl->check('applications_acc',16,'admin')) { $file['Clear cache and register hooks'] = egw::link('/index.php','menuaction=admin.admin_hooks.register_all_hooks'); } - if (! $GLOBALS['egw']->acl->check('asyncservice_access',1,'admin')) + if (! $GLOBALS['egw']->acl->check('asyncservice_acc',1,'admin')) { $file['Asynchronous timed services'] = egw::link('/index.php','menuaction=admin.uiasyncservice.index'); } @@ -156,7 +156,7 @@ class admin_hooks */ function register_all_hooks() { - if ($GLOBALS['egw']->acl->check('applications_access',16,'admin')) + if ($GLOBALS['egw']->acl->check('applications_acc',16,'admin')) { $GLOBALS['egw']->redirect_link('/index.php'); } @@ -193,7 +193,7 @@ class admin_hooks 'icon' => 'lock', ); - if (!$GLOBALS['egw']->acl->check('current_sessions_access',1,'admin')) // no rights to view + if (!$GLOBALS['egw']->acl->check('current_sessions',1,'admin')) // no rights to view { $actions[] = array( 'description' => 'Login History', diff --git a/admin/inc/class.uiasyncservice.inc.php b/admin/inc/class.uiasyncservice.inc.php index cec90d57ca..cde4aec042 100644 --- a/admin/inc/class.uiasyncservice.inc.php +++ b/admin/inc/class.uiasyncservice.inc.php @@ -20,7 +20,7 @@ class uiasyncservice function index() { - if ($GLOBALS['egw']->acl->check('asyncservice_access',1,'admin')) + if ($GLOBALS['egw']->acl->check('asyncservice_acc',1,'admin')) { egw::redirect_link('/index.php'); } diff --git a/admin/inc/class.uiconfig.inc.php b/admin/inc/class.uiconfig.inc.php index 1829bf5a79..555febaf1b 100644 --- a/admin/inc/class.uiconfig.inc.php +++ b/admin/inc/class.uiconfig.inc.php @@ -36,7 +36,7 @@ class uiconfig //_debug_array($params); $_appname = $_GET['appname']; } - if ($GLOBALS['egw']->acl->check('site_config_access',1,'admin')) + if ($GLOBALS['egw']->acl->check('site_config_acce',1,'admin')) { egw::redirect_link('/index.php'); } @@ -105,7 +105,7 @@ class uiconfig $c = new config($config_appname); $c->read_repository(); - if ($_POST['cancel'] || ($_POST['submit'] || $_POST['save'] || $_POST['apply']) && $GLOBALS['egw']->acl->check('site_config_access',2,'admin')) + if ($_POST['cancel'] || ($_POST['submit'] || $_POST['save'] || $_POST['apply']) && $GLOBALS['egw']->acl->check('site_config_acce',2,'admin')) { egw::redirect_link('/admin/index.php?ajax=true'); } @@ -261,7 +261,7 @@ class uiconfig } } $t->set_var('submit', '
'. - ($GLOBALS['egw']->acl->check('site_config_access',2,'admin') ? '' : + ($GLOBALS['egw']->acl->check('site_config_acce',2,'admin') ? '' : html::submit_button('save', 'Save')."\n". html::submit_button('apply', 'Apply'))); $t->set_var('cancel', html::submit_button('cancel', 'Cancel').'
'); diff --git a/admin/inc/class.uimainscreen.inc.php b/admin/inc/class.uimainscreen.inc.php index 7811197295..19e4fbe44c 100644 --- a/admin/inc/class.uimainscreen.inc.php +++ b/admin/inc/class.uimainscreen.inc.php @@ -18,11 +18,11 @@ class uimainscreen $select_lang = $_POST['select_lang']; $message = get_magic_quotes_gpc() ? stripslashes($_POST['message']) : $_POST['message']; $acl_ok = array(); - if (!$GLOBALS['egw']->acl->check('mainscreen_message_access',1,'admin')) + if (!$GLOBALS['egw']->acl->check('mainscreen_messa',1,'admin')) { $acl_ok['mainscreen'] = True; } - if (!$GLOBALS['egw']->acl->check('mainscreen_message_access',2,'admin')) + if (!$GLOBALS['egw']->acl->check('mainscreen_messa',2,'admin')) { $acl_ok['loginscreen'] = True; } @@ -80,7 +80,7 @@ class uimainscreen $GLOBALS['egw']->template->fp('rows','row',True); $select_section = '