summaryrefslogtreecommitdiff
path: root/inc/actions.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-05-20 09:17:37 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-05-20 09:17:37 +0200
commitdae73d6abd9c0621fc75b85072812ae5c31f6d45 (patch)
tree9ee5dc386e7be96326f16e40f4d7460ff47d7a85 /inc/actions.php
parent3bc8c0d72be15e1210feef5c8f4c670d7ab71dc4 (diff)
parent714ca83d81222f48db9b9db4b216715efe70cdf3 (diff)
downloadrpg-dae73d6abd9c0621fc75b85072812ae5c31f6d45.tar.gz
rpg-dae73d6abd9c0621fc75b85072812ae5c31f6d45.tar.bz2
Merge pull request #1156 from splitbrain/refactor_admin_plugin_get
Provide a function to return admin plugin for the page request.
Diffstat (limited to 'inc/actions.php')
-rw-r--r--inc/actions.php17
1 files changed, 3 insertions, 14 deletions
diff --git a/inc/actions.php b/inc/actions.php
index 709c19ddd..b0753b22e 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -162,20 +162,9 @@ function act_dispatch(){
if($ACT == 'admin'){
// retrieve admin plugin name from $_REQUEST['page']
if (($page = $INPUT->str('page', '', true)) != '') {
- $pluginlist = plugin_list('admin');
- if (in_array($page, $pluginlist)) {
- // attempt to load the plugin
-
- if (($plugin = plugin_load('admin',$page)) !== null){
- /** @var DokuWiki_Admin_Plugin $plugin */
- if($plugin->forAdminOnly() && !$INFO['isadmin']){
- // a manager tried to load a plugin that's for admins only
- $INPUT->remove('page');
- msg('For admins only',-1);
- }else{
- $plugin->handle();
- }
- }
+ /** @var $plugin DokuWiki_Admin_Plugin */
+ if ($plugin = plugin_getRequestAdminPlugin()){
+ $plugin->handle();
}
}
}