diff options
-rw-r--r-- | _test/tests/inc/template_include_page.test.php | 5 | ||||
-rw-r--r-- | lib/plugins/admin.php | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/_test/tests/inc/template_include_page.test.php b/_test/tests/inc/template_include_page.test.php index ea9e89558..c6a75ac95 100644 --- a/_test/tests/inc/template_include_page.test.php +++ b/_test/tests/inc/template_include_page.test.php @@ -32,9 +32,7 @@ class template_pagetitle_test extends DokuWikiTest { } function test_adminPluginTitle() { - global $ID,$ACT,$INPUT,$conf,$INFO; - $INFO['isadmin'] = true; - $INFO['ismanager'] = true; + global $ID,$ACT,$INPUT,$conf,$USERINFO; if (!plugin_load('admin','revert')) { $this->markTestSkipped('Revert plugin not found, unable to test admin plugin titles'); @@ -46,6 +44,7 @@ class template_pagetitle_test extends DokuWikiTest { $conf['lang'] = 'en'; $INPUT->set('page','revert'); + $INPUT->server->set('REMOTE_USER', 'testuser'); // this user is admin $this->assertEquals('Revert Manager', tpl_pagetitle(null, true)); } diff --git a/lib/plugins/admin.php b/lib/plugins/admin.php index d9c7d2969..9554ce511 100644 --- a/lib/plugins/admin.php +++ b/lib/plugins/admin.php @@ -78,8 +78,6 @@ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin { * @return bool true if the current user may access this admin plugin */ public function isAccessibleByCurrentUser() { - global $INFO; - $data = []; $data['instance'] = $this; $data['hasAccess'] = false; @@ -87,9 +85,9 @@ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin { $event = new Doku_Event('ADMINPLUGIN_ACCESS_CHECK', $data); if($event->advise_before()) { if ($this->forAdminOnly()) { - $data['hasAccess'] = $INFO['isadmin']; + $data['hasAccess'] = auth_isadmin(); } else { - $data['hasAccess'] = $INFO['ismanager']; + $data['hasAccess'] = auth_ismanager(); } } $event->advise_after(); |