*/ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'syntax.php'); class syntax_plugin_aclauditor extends DokuWiki_Syntax_Plugin { function getInfo() { return array( 'author' => 'Etienne MELEARD', 'email' => 'etienne.meleard@free.fr', 'date' => @file_get_contents(DOKU_PLUGIN.'aclauditor/VERSION'), 'name' => 'ACL Auditor Plugin (syntax)', 'desc' => 'Functions to get info about user /group ACLs of a wiki page', 'url' => 'http://dokuwiki.org/plugin:aclauditor', ); } function getType() { return 'substition'; } function getSort() { return 155; } function connectTo($mode) { $this->Lexer->addSpecialPattern('', $mode, 'plugin_aclauditor'); } function handle($match, $state, $pos, &$handler) { $params = array(); foreach(preg_split('`\s+`', trim(substr($match, 11, -2))) as $p) { $p = explode('=', $p, 2); if(!in_array($p[0], array('who', 'what', 'scenario'))) continue; $params[$p[0]] = isset($p[1]) ? $p[1] : null; } return $params; } function render($format, &$renderer, $data) { if($format != 'xhtml') return false; $renderer->info['cache'] = false; if(!auth_isadmin()) return true; global $ID; if(!isset($data['scenario'])) { $renderer->doc .= '
'; if(isset($data['who']) && !empty($data['who'])) $renderer->doc .= ''; if(isset($data['what']) && !empty($data['what'])) $renderer->doc .= ''; $renderer->doc .= ''; $renderer->doc .= '
'; }else{ $renderer->doc .= '
'; if(!empty($data['scenario'])) { $renderer->doc .= ''; $renderer->doc .= ''; $renderer->doc .= ''; }else $renderer->doc .= ''; $renderer->doc .= '
'; } return true; } }