aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/plugins/acl/action.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plugins/acl/action.php')
-rw-r--r--lib/plugins/acl/action.php42
1 files changed, 20 insertions, 22 deletions
diff --git a/lib/plugins/acl/action.php b/lib/plugins/acl/action.php
index 1d6d05b80..86e587093 100644
--- a/lib/plugins/acl/action.php
+++ b/lib/plugins/acl/action.php
@@ -6,13 +6,11 @@
* @author Andreas Gohr <andi@splitbrain.org>
*/
-// must be run within Dokuwiki
-if(!defined('DOKU_INC')) die();
-
/**
* Register handler
*/
-class action_plugin_acl extends DokuWiki_Action_Plugin {
+class action_plugin_acl extends DokuWiki_Action_Plugin
+{
/**
* Registers a callback function for a given event
@@ -20,10 +18,10 @@ class action_plugin_acl extends DokuWiki_Action_Plugin {
* @param Doku_Event_Handler $controller DokuWiki's event controller object
* @return void
*/
- public function register(Doku_Event_Handler $controller) {
-
- $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'handle_ajax_call_acl');
+ public function register(Doku_Event_Handler $controller)
+ {
+ $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'handleAjaxCallAcl');
}
/**
@@ -33,9 +31,9 @@ class action_plugin_acl extends DokuWiki_Action_Plugin {
* @param mixed $param empty
* @return void
*/
-
- public function handle_ajax_call_acl(Doku_Event $event, $param) {
- if($event->data !== 'plugin_acl') {
+ public function handleAjaxCallAcl(Doku_Event $event, $param)
+ {
+ if ($event->data !== 'plugin_acl') {
return;
}
$event->stopPropagation();
@@ -46,12 +44,11 @@ class action_plugin_acl extends DokuWiki_Action_Plugin {
/** @var $acl admin_plugin_acl */
$acl = plugin_load('admin', 'acl');
-
- if(!$acl->isAccessibleByCurrentUser()) {
+ if (!$acl->isAccessibleByCurrentUser()) {
echo 'for admins only';
return;
}
- if(!checkSecurityToken()) {
+ if (!checkSecurityToken()) {
echo 'CRSF Attack';
return;
}
@@ -62,26 +59,27 @@ class action_plugin_acl extends DokuWiki_Action_Plugin {
$ajax = $INPUT->str('ajax');
header('Content-Type: text/html; charset=utf-8');
- if($ajax == 'info') {
- $acl->_html_info();
- } elseif($ajax == 'tree') {
-
+ if ($ajax == 'info') {
+ $acl->printInfo();
+ } elseif ($ajax == 'tree') {
$ns = $INPUT->str('ns');
- if($ns == '*') {
+ if ($ns == '*') {
$ns = '';
}
$ns = cleanID($ns);
$lvl = count(explode(':', $ns));
$ns = utf8_encodeFN(str_replace(':', '/', $ns));
- $data = $acl->_get_tree($ns, $ns);
+ $data = $acl->makeTree($ns, $ns);
- foreach(array_keys($data) as $item) {
+ foreach (array_keys($data) as $item) {
$data[$item]['level'] = $lvl + 1;
}
echo html_buildlist(
- $data, 'acl', array($acl, '_html_list_acl'),
- array($acl, '_html_li_acl')
+ $data,
+ 'acl',
+ array($acl, 'makeTreeItem'),
+ array($acl, 'makeListItem')
);
}
}