From bd07158f0f2569ae470f980dd49d69b7f1fd2c49 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Tue, 22 Feb 2011 23:11:13 +0000 Subject: deleted redundant line --- inc/actions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'inc/actions.php') diff --git a/inc/actions.php b/inc/actions.php index 016af4aea..321d928b3 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -244,7 +244,6 @@ function act_permcheck($act){ $permneed = AUTH_CREATE; } }elseif(in_array($act,array('login','search','recent','profile','index', 'sitemap'))){ - }elseif(in_array($act,array('login','search','recent','profile','sitemap'))){ $permneed = AUTH_NONE; }elseif($act == 'revert'){ $permneed = AUTH_ADMIN; @@ -610,7 +609,7 @@ function act_sitemap($act) { print "Sitemap generation is disabled."; exit; } - + $sitemap = Sitemapper::getFilePath(); if(strrchr($sitemap, '.') === '.gz'){ $mime = 'application/x-gzip'; -- cgit v1.2.3 From 24ea6500cc5285aac7f02df7f535ea10f8f97729 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 4 Mar 2011 20:29:24 +0100 Subject: check manager/admin role earlier for admin plugins FS#2180 --- inc/actions.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'inc/actions.php') diff --git a/inc/actions.php b/inc/actions.php index 321d928b3..fa11bb7f1 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -18,6 +18,7 @@ if(!defined('DOKU_INC')) die('meh.'); function act_dispatch(){ global $ACT; global $ID; + global $INFO; global $QUERY; global $lang; global $conf; @@ -134,8 +135,15 @@ function act_dispatch(){ $pluginlist = plugin_list('admin'); if (in_array($_REQUEST['page'], $pluginlist)) { // attempt to load the plugin - if ($plugin =& plugin_load('admin',$_REQUEST['page']) !== null) - $plugin->handle(); + if ($plugin =& plugin_load('admin',$_REQUEST['page']) !== null){ + if($plugin->forAdminOnly() && !$INFO['isadmin']){ + // a manager tried to load a plugin that's for admins only + unset($_REQUEST['page']); + msg('For admins only',-1); + }else{ + $plugin->handle(); + } + } } } } -- cgit v1.2.3