aboutsummaryrefslogtreecommitdiff
path: root/vendors/dokuwiki/lib/plugins/acl/ajax.php
diff options
context:
space:
mode:
authorsembrestels <sembrestels@riseup.net>2011-10-13 15:23:11 +0200
committersembrestels <sembrestels@riseup.net>2011-10-13 15:23:11 +0200
commit74bd6999c5e5c23ebbf90dbb6bdaabbddd7594cf (patch)
tree834c120d692be288f261bcae169eedd3d6b31d74 /vendors/dokuwiki/lib/plugins/acl/ajax.php
parentf8be8643f0faadb2c0ce87d553b7b9d569af5afd (diff)
downloadelgg-74bd6999c5e5c23ebbf90dbb6bdaabbddd7594cf.tar.gz
elgg-74bd6999c5e5c23ebbf90dbb6bdaabbddd7594cf.tar.bz2
Rename lib/dokuwiki to vendors/dokuwiki
Diffstat (limited to 'vendors/dokuwiki/lib/plugins/acl/ajax.php')
-rw-r--r--vendors/dokuwiki/lib/plugins/acl/ajax.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/vendors/dokuwiki/lib/plugins/acl/ajax.php b/vendors/dokuwiki/lib/plugins/acl/ajax.php
new file mode 100644
index 000000000..d3e88d932
--- /dev/null
+++ b/vendors/dokuwiki/lib/plugins/acl/ajax.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * AJAX call handler for ACL plugin
+ *
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+
+//fix for Opera XMLHttpRequests
+if(!count($_POST) && $HTTP_RAW_POST_DATA){
+ parse_str($HTTP_RAW_POST_DATA, $_POST);
+}
+
+if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../../');
+require_once(DOKU_INC.'inc/init.php');
+require_once(DOKU_INC.'inc/common.php');
+require_once(DOKU_INC.'inc/pageutils.php');
+require_once(DOKU_INC.'inc/auth.php');
+//close session
+session_write_close();
+
+if(!auth_isadmin()) die('for admins only');
+if(!checkSecurityToken()) die('CRSF Attack');
+
+$ID = getID();
+
+require_once(DOKU_INC.'inc/pluginutils.php');
+require_once(DOKU_INC.'inc/html.php');
+$acl = plugin_load('admin','acl');
+$acl->handle();
+
+$ajax = $_REQUEST['ajax'];
+header('Content-Type: text/html; charset=utf-8');
+
+if($ajax == 'info'){
+ $acl->_html_info();
+}elseif($ajax == 'tree'){
+ require_once(DOKU_INC.'inc/search.php');
+ global $conf;
+ global $ID;
+
+ $dir = $conf['datadir'];
+ $ns = $_REQUEST['ns'];
+ if($ns == '*'){
+ $ns ='';
+ }
+ $ns = cleanID($ns);
+ $lvl = count(explode(':',$ns));
+ $ns = utf8_encodeFN(str_replace(':','/',$ns));
+
+ $data = $acl->_get_tree($ns,$ns);
+
+ foreach($data as $item){
+ $item['level'] = $lvl+1;
+ echo $acl->_html_li_acl($item);
+ echo '<div class="li">';
+ echo $acl->_html_list_acl($item);
+ echo '</div>';
+ echo '</li>';
+ }
+}
+