summaryrefslogtreecommitdiff
path: root/lib/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/acl/admin.php940
-rw-r--r--lib/plugins/acl/ajax.php60
-rw-r--r--lib/plugins/acl/lang/ar/intro.txt5
-rw-r--r--lib/plugins/acl/lang/bg/intro.txt11
-rw-r--r--lib/plugins/acl/lang/ca/intro.txt13
-rw-r--r--lib/plugins/acl/lang/cs/intro.txt11
-rw-r--r--lib/plugins/acl/lang/da/intro.txt13
-rw-r--r--lib/plugins/acl/lang/de/intro.txt12
-rw-r--r--lib/plugins/acl/lang/el/intro.txt14
-rw-r--r--lib/plugins/acl/lang/en/intro.txt12
-rw-r--r--lib/plugins/acl/lang/en/lang.php19
-rw-r--r--lib/plugins/acl/lang/eo/intro.txt6
-rw-r--r--lib/plugins/acl/lang/eo/lang.php14
-rw-r--r--lib/plugins/acl/lang/es/intro.txt11
-rw-r--r--lib/plugins/acl/lang/et/intro.txt11
-rw-r--r--lib/plugins/acl/lang/eu/intro.txt5
-rw-r--r--lib/plugins/acl/lang/fi/intro.txt11
-rw-r--r--lib/plugins/acl/lang/fr/intro.txt12
-rw-r--r--lib/plugins/acl/lang/fr/lang.php42
-rw-r--r--lib/plugins/acl/lang/gl/intro.txt5
-rw-r--r--lib/plugins/acl/lang/he/intro.txt12
-rw-r--r--lib/plugins/acl/lang/id/intro.txt12
-rw-r--r--lib/plugins/acl/lang/id/lang.php30
-rw-r--r--lib/plugins/acl/lang/it/intro.txt12
-rw-r--r--lib/plugins/acl/lang/ja/intro.txt7
-rw-r--r--lib/plugins/acl/lang/ko/intro.txt8
-rw-r--r--lib/plugins/acl/lang/lt/intro.txt6
-rw-r--r--lib/plugins/acl/lang/lv/intro.txt8
-rw-r--r--lib/plugins/acl/lang/nl/intro.txt11
-rw-r--r--lib/plugins/acl/lang/no/intro.txt11
-rw-r--r--lib/plugins/acl/lang/pl/intro.txt12
-rw-r--r--lib/plugins/acl/lang/pt-br/intro.txt5
-rw-r--r--lib/plugins/acl/lang/pt-br/lang.php31
-rw-r--r--lib/plugins/acl/lang/pt/intro.txt7
-rw-r--r--lib/plugins/acl/lang/ru/intro.txt6
-rw-r--r--lib/plugins/acl/lang/ru/lang.php31
-rw-r--r--lib/plugins/acl/lang/sk/intro.txt7
-rw-r--r--lib/plugins/acl/lang/sr/intro.txt10
-rw-r--r--lib/plugins/acl/lang/sv/intro.txt15
-rw-r--r--lib/plugins/acl/lang/tr/intro.txt12
-rw-r--r--lib/plugins/acl/lang/uk/intro.txt11
-rw-r--r--lib/plugins/acl/lang/vi/intro.txt13
-rw-r--r--lib/plugins/acl/lang/zh-tw/intro.txt9
-rw-r--r--lib/plugins/acl/lang/zh/intro.txt7
-rw-r--r--lib/plugins/acl/script.js159
-rw-r--r--lib/plugins/acl/style.css91
46 files changed, 1013 insertions, 757 deletions
diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php
index 190ead761..e15d8aa9a 100644
--- a/lib/plugins/acl/admin.php
+++ b/lib/plugins/acl/admin.php
@@ -3,7 +3,9 @@
* ACL administration functions
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
- * @author Frank Schubert <frank@schokilade.de>
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @author Anika Henke <a.c.henke@arcor.de> (concepts)
+ * @author Frank Schubert <frank@schokilade.de> (old version)
*/
// must be run within Dokuwiki
if(!defined('DOKU_INC')) die();
@@ -16,85 +18,125 @@ require_once(DOKU_PLUGIN.'admin.php');
* need to inherit from this class
*/
class admin_plugin_acl extends DokuWiki_Admin_Plugin {
-
-
- function admin_plugin_acl(){
- $this->setupLocale();
- }
-
+ var $acl = null;
+ var $ns = null;
+ var $who = '';
+ var $usersgroups = array();
/**
* return some info
*/
function getInfo(){
- return array(
- 'author' => 'Frank Schubert',
- 'email' => 'frank@schokilade.de',
- 'date' => '2005-08-08',
- 'name' => 'ACL',
- 'desc' => 'Manage Page Access Control Lists',
- 'url' => 'http://wiki.splitbrain.org/wiki:acl',
- );
+ return array(
+ 'author' => 'Andreas Gohr',
+ 'email' => 'andi@splitbrain.org',
+ 'date' => '2007-11-17',
+ 'name' => 'ACL',
+ 'desc' => 'Manage Page Access Control Lists',
+ 'url' => 'http://wiki.splitbrain.org/wiki:acl',
+ );
}
/**
* return prompt for admin menu
*/
function getMenuText($language) {
- return $this->lang['admin_acl'];
+ return $this->getLang('admin_acl');
}
/**
* return sort order for position in admin menu
*/
function getMenuSort() {
- return 1;
+ return 1;
}
/**
* handle user request
+ *
+ * Initializes internal vars and handles modifications
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
*/
function handle() {
- global $AUTH_ACL;
-
- $cmd = $_REQUEST['acl_cmd'];
- $scope = $_REQUEST['acl_scope'];
- $type = $_REQUEST['acl_type'];
- $user = $_REQUEST['acl_user'];
- $perm = $_REQUEST['acl_perm'];
-
- if(is_array($perm)){
- //use the maximum
- sort($perm);
- $perm = array_pop($perm);
- }else{
- $perm = 0;
- }
-
- //sanitize
- $user = auth_nameencode($user);
- if($type == '@') $user = '@'.$user;
- if($user == '@all') $user = '@ALL'; //special group! (now case insensitive)
- $perm = (int) $perm;
- if($perm > AUTH_DELETE) $perm = AUTH_DELETE;
-
- //nothing to do?
- if(empty($cmd) || empty($scope) || empty($user)) return;
-
- // check token
- if(!checkSecurityToken()) return;
-
-
- if($cmd == 'save'){
- $this->admin_acl_del($scope, $user);
- $this->admin_acl_add($scope, $user, $perm);
- }elseif($cmd == 'delete'){
- $this->admin_acl_del($scope, $user);
- }
-
- // reload ACL config
- $AUTH_ACL = file(DOKU_CONF.'acl.auth.php');
+ global $AUTH_ACL;
+ global $ID;
+
+ // namespace given?
+ if($_REQUEST['ns'] == '*'){
+ $this->ns = '*';
+ }else{
+ $this->ns = cleanID($_REQUEST['ns']);
+ }
+
+ // user or group choosen?
+ $who = trim($_REQUEST['acl_w']);
+ if($_REQUEST['acl_t'] == '__g__' && $who){
+ $this->who = '@'.ltrim($who,'@');
+ }elseif($_REQUEST['acl_t'] == '__u__' && $who){
+ $this->who = ltrim($who,'@');
+ }elseif($_REQUEST['acl_t'] &&
+ $_REQUEST['acl_t'] != '__u__' &&
+ $_REQUEST['acl_t'] != '__g__'){
+ $this->who = $_REQUEST['acl_t'];
+ }elseif($who){
+ $this->who = $who;
+ }
+
+ // handle modifications
+ if(isset($_REQUEST['cmd'])){
+ // scope for modifications
+ if($this->ns){
+ if($this->ns == '*'){
+ $scope = '*';
+ }else{
+ $scope = $this->ns.':*';
+ }
+ }else{
+ $scope = $ID;
+ }
+
+ if(isset($_REQUEST['cmd']['save']) && $scope && $this->who && isset($_REQUEST['acl'])){
+ // handle additions or single modifications
+ $this->_acl_del($scope, $this->who);
+ $this->_acl_add($scope, $this->who, (int) $_REQUEST['acl']);
+ }elseif(isset($_REQUEST['cmd']['del']) && $scope && $this->who){
+ // handle single deletions
+ $this->_acl_del($scope, $this->who);
+ }elseif(isset($_REQUEST['cmd']['update'])){
+ // handle update of the whole file
+ foreach((array) $_REQUEST['del'] as $where => $who){
+ // remove all rules marked for deletion
+ unset($_REQUEST['acl'][$where][$who]);
+ }
+ // prepare lines
+ $lines = array();
+ // keep header
+ foreach($AUTH_ACL as $line){
+ if($line{0} == '#'){
+ $lines[] = $line;
+ }else{
+ break;
+ }
+ }
+ // re-add all rules
+ foreach((array) $_REQUEST['acl'] as $where => $opt){
+ foreach($opt as $who => $perm){
+ $who = auth_nameencode($who,true);
+ $lines[] = "$where\t$who\t$perm\n";
+ }
+ }
+ // save it
+ io_saveFile(DOKU_CONF.'acl.auth.php', join('',$lines));
+ }
+
+ // reload ACL config
+ $AUTH_ACL = file(DOKU_CONF.'acl.auth.php');
+ }
+
+ // initialize ACL array
+ $this->_init_acl_config();
}
/**
@@ -107,344 +149,592 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html() {
- global $ID;
+ global $ID;
- print $this->locale_xhtml('intro');
+ echo '<div id="acl_manager">'.NL;
+ echo '<h1>'.$this->getLang('admin_acl').'</h1>'.NL;
+ echo '<div class="level1">'.NL;
- ptln('<div id="acl__manager">');
- ptln('<table class="inline">');
+ echo '<div id="acl__tree">'.NL;
+ $this->_html_explorer($_REQUEST['ns']);
+ echo '</div>'.NL;
- //new
- $this->admin_acl_html_new();
+ echo '<div id="acl__detail">'.NL;
+ $this->_html_detail();
+ echo '</div>'.NL;
+ echo '</div>'.NL;
- //current config
- $acls = $this->get_acl_config($ID);
- foreach ($acls as $id => $acl){
- $this->admin_acl_html_current($id,$acl);
- }
+ echo '<div class="clearer"></div>';
+ echo '<h2>'.$this->getLang('current').'</h2>'.NL;
+ echo '<div class="level2">'.NL;
+ $this->_html_table();
+ echo '</div>'.NL;
- ptln('</table>');
- ptln('</div>');
+ echo '</div>'.NL;
}
-
/**
- * Get matching ACL lines for a page
+ * returns array with set options for building links
*
- * $ID is pagename, reads matching lines from $AUTH_ACL,
- * also reads acls from namespace
- * returns multi-array with key=pagename and value=array(user, acl)
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+ function _get_opts($addopts=null){
+ global $ID;
+ $opts = array(
+ 'do'=>'admin',
+ 'page'=>'acl',
+ );
+ if($this->ns) $opts['ns'] = $this->ns;
+ if($this->who) $opts['acl_w'] = $this->who;
+
+ if(is_null($addopts)) return $opts;
+ return array_merge($opts, $addopts);
+ }
+
+ /**
+ * Display a tree menu to select a page or namespace
*
- * @todo Fix comment to make sense
- * @todo should this moved to auth.php?
- * @todo can this be combined with auth_aclcheck to avoid duplicate code?
- * @author Frank Schubert <frank@schokilade.de>
+ * @author Andreas Gohr <andi@splitbrain.org>
*/
- function get_acl_config($id){
- global $AUTH_ACL;
-
- $acl_config=array();
-
- // match exact name
- $matches = preg_grep('/^'.$id.'\s+.*/',$AUTH_ACL);
- if(count($matches)){
- foreach($matches as $match){
- $match = preg_replace('/#.*$/','',$match); //ignore comments
- $acl = preg_split('/\s+/',$match);
- //0 is pagename, 1 is user, 2 is acl
- $acl_config[$acl[0]][] = array( 'name' => $acl[1], 'perm' => $acl[2]);
+ function _html_explorer(){
+ require_once(DOKU_INC.'inc/search.php');
+ global $conf;
+ global $ID;
+ global $lang;
+
+ $dir = $conf['datadir'];
+ $ns = $this->ns;
+ if(empty($ns)){
+ $ns = dirname(str_replace(':','/',$ID));
+ if($ns == '.') $ns ='';
+ }elseif($ns == '*'){
+ $ns ='';
}
- }
-
- $specific_found=array();
- // match ns
- while(($id=getNS($id)) !== false){
- $matches = preg_grep('/^'.$id.':\*\s+.*/',$AUTH_ACL);
- if(count($matches)){
- foreach($matches as $match){
- $match = preg_replace('/#.*$/','',$match); //ignore comments
- $acl = preg_split('/\s+/',$match);
- //0 is pagename, 1 is user, 2 is acl
- $acl_config[$acl[0]][] = array( 'name' => $acl[1], 'perm' => $acl[2]);
- $specific_found[]=$acl[1];
- }
+ $ns = utf8_encodeFN(str_replace(':','/',$ns));
+
+
+ $data = array();
+ search($data,$conf['datadir'],'search_index',array('ns' => $ns));
+
+
+ // wrap a list with the root level around the other namespaces
+ $item = array( 'level' => 0, 'id' => '*', 'type' => 'd',
+ 'open' =>'true', 'label' => '['.$lang['mediaroot'].']');
+
+ echo '<ul class="acltree">';
+ echo $this->_html_li_acl($item);
+ echo '<div class="li">';
+ echo $this->_html_list_acl($item);
+ echo '</div>';
+ echo html_buildlist($data,'acl',
+ array($this,'_html_list_acl'),
+ array($this,'_html_li_acl'));
+ echo '</li>';
+ echo '</ul>';
+
+ }
+
+ /**
+ * Display the current ACL for selected where/who combination with
+ * selectors and modification form
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+ function _html_detail(){
+ global $conf;
+ global $ID;
+
+ echo '<form action="'.wl().'" method="post" accept-charset="utf-8">'.NL;
+
+ echo '<div id="acl__user">';
+ echo $this->getLang('acl_perms').' ';
+ $inl = $this->_html_select();
+ echo '<input type="text" name="acl_w" class="edit" value="'.(($inl)?'':hsc(ltrim($this->who,'@'))).'" />'.NL;
+ echo '<input type="submit" value="Select" class="button" />'.NL;
+ echo '</div>'.NL;
+
+ echo '<div id="acl__info">';
+ $this->_html_info();
+ echo '</div>';
+
+ echo '<input type="hidden" name="ns" value="'.hsc($this->ns).'" />'.NL;
+ echo '<input type="hidden" name="id" value="'.hsc($ID).'" />'.NL;
+ echo '<input type="hidden" name="do" value="admin" />'.NL;
+ echo '<input type="hidden" name="page" value="acl" />'.NL;
+ echo '</form>'.NL;
+ }
+
+ /**
+ * Print infos and editor
+ */
+ function _html_info(){
+ global $ID;
+
+ if($this->who){
+ $current = $this->_get_exact_perm();
+
+ // explain current permissions
+ $this->_html_explain($current);
+ // load editor
+ $this->_html_acleditor($current);
+ }else{
+ echo '<p>';
+ if($this->ns){
+ printf($this->getLang('p_choose_ns'),hsc($this->ns));
+ }else{
+ printf($this->getLang('p_choose_id'),hsc($ID));
+ }
+ echo '</p>';
+
+ echo $this->locale_xhtml('help');
}
- }
-
- //include *-config
- $matches = preg_grep('/^\*\s+.*/',$AUTH_ACL);
- if(count($matches)){
- foreach($matches as $match){
- $match = preg_replace('/#.*$/','',$match); //ignore comments
- $acl = preg_split('/\s+/',$match);
- // only include * for this user if not already found in ns
- if(!in_array($acl[1], $specific_found)){
- //0 is pagename, 1 is user, 2 is acl
- $acl_config[$acl[0]][] = array( 'name' => $acl[1], 'perm' => $acl[2]);
- }
+ }
+
+ /**
+ * Display the ACL editor
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+ function _html_acleditor($current){
+ global $lang;
+
+ echo '<fieldset>';
+ if(is_null($current)){
+ echo '<legend>'.$this->getLang('acl_new').'</legend>';
+ }else{
+ echo '<legend>'.$this->getLang('acl_mod').'</legend>';
}
- }
- //sort
- //FIXME: better sort algo: first sort by key, then sort by first value
- krsort($acl_config, SORT_STRING);
- return($acl_config);
- }
+ echo $this->_html_checkboxes($current,empty($this->ns),'acl');
+
+ if(is_null($current)){
+ echo '<input type="submit" name="cmd[save]" class="button" value="'.$lang['btn_save'].'" />'.NL;
+ }else{
+ echo '<input type="submit" name="cmd[save]" class="button" value="'.$lang['btn_update'].'" />'.NL;
+ echo '<input type="submit" name="cmd[del]" class="button" value="'.$lang['btn_delete'].'" />'.NL;
+ }
+ echo '</fieldset>';
+ }
/**
- * adds new acl-entry to conf/acl.auth.php
+ * Explain the currently set permissions in plain english/$lang
*
- * @author Frank Schubert <frank@schokilade.de>
+ * @author Andreas Gohr <andi@splitbrain.org>
*/
- function admin_acl_add($acl_scope, $acl_user, $acl_level){
- $acl_config = join("",file(DOKU_CONF.'acl.auth.php'));
+ function _html_explain($current){
+ global $ID;
+ global $auth;
+
+ $who = $this->who;
+ $ns = $this->ns;
+
+ // prepare where to check
+ if($ns){
+ if($ns == '*'){
+ $check='*';
+ }else{
+ $check=$ns.':*';
+ }
+ }else{
+ $check = $ID;
+ }
- // max level for pagenames is edit
- if(strpos($acl_scope,'*') === false) {
- if($acl_level > AUTH_EDIT) $acl_level = AUTH_EDIT;
- }
+ // prepare who to check
+ if($who{0} == '@'){
+ $user = '';
+ $groups = array(ltrim($who,'@'));
+ }else{
+ $user = auth_nameencode($who);
+ $info = $auth->getUserData($user);
+ $groups = $info['groups'];
+ }
- $new_acl = "$acl_scope\t$acl_user\t$acl_level\n";
+ // check the permissions
+ $perm = auth_aclcheck($check,$user,$groups);
+
+ // build array of named permissions
+ $names = array();
+ if($perm){
+ if($ns){
+ if($perm >= AUTH_DELETE) $names[] = $this->getLang('acl_perm16');
+ if($perm >= AUTH_UPLOAD) $names[] = $this->getLang('acl_perm8');
+ if($perm >= AUTH_CREATE) $names[] = $this->getLang('acl_perm4');
+ }
+ if($perm >= AUTH_EDIT) $names[] = $this->getLang('acl_perm2');
+ if($perm >= AUTH_READ) $names[] = $this->getLang('acl_perm1');
+ $names = array_reverse($names);
+ }else{
+ $names[] = $this->getLang('acl_perm0');
+ }
- $new_config = $acl_config.$new_acl;
+ // print permission explanation
+ echo '<p>';
+ if($user){
+ if($ns){
+ printf($this->getLang('p_user_ns'),hsc($who),hsc($ns),join(', ',$names));
+ }else{
+ printf($this->getLang('p_user_id'),hsc($who),hsc($ID),join(', ',$names));
+ }
+ }else{
+ if($ns){
+ printf($this->getLang('p_group_ns'),hsc(ltrim($who,'@')),hsc($ns),join(', ',$names));
+ }else{
+ printf($this->getLang('p_group_id'),hsc(ltrim($who,'@')),hsc($ID),join(', ',$names));
+ }
+ }
+ echo '</p>';
- return io_saveFile(DOKU_CONF.'acl.auth.php', $new_config);
+ // add note if admin
+ if($perm == AUTH_ADMIN){
+ echo '<p>'.$this->getLang('p_isadmin').'</p>';
+ }elseif(is_null($current)){
+ echo '<p>'.$this->getLang('p_inherited').'</p>';
+ }
}
+
/**
- * remove acl-entry from conf/acl.auth.php
+ * Item formatter for the tree view
*
- * @author Frank Schubert <frank@schokilade.de>
+ * User function for html_buildlist()
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
*/
- function admin_acl_del($acl_scope, $acl_user){
- $acl_config = file(DOKU_CONF.'acl.auth.php');
+ function _html_list_acl($item){
+ global $ID;
+ $ret = '';
+ // what to display
+ if($item['label']){
+ $base = $item['label'];
+ }else{
+ $base = ':'.$item['id'];
+ $base = substr($base,strrpos($base,':')+1);
+ }
- $acl_pattern = '^'.preg_quote($acl_scope,'/').'\s+'.$acl_user.'\s+[0-8].*$';
+ // highlight?
+ if(($item['type']=='d' &&
+ $item['id'] == $this->ns) ||
+ $item['id'] == $ID) $cl = ' cur';
+
+ // namespace or page?
+ if($item['type']=='d'){
+ if($item['open']){
+ $img = DOKU_BASE.'lib/images/minus.gif';
+ $alt = '&minus;';
+ }else{
+ $img = DOKU_BASE.'lib/images/plus.gif';
+ $alt = '+';
+ }
+ $ret .= '<img src="'.$img.'" alt="'.$alt.'" />';
+ $ret .= '<a href="'.wl('',$this->_get_opts(array('ns'=>$item['id']))).'" class="idx_dir'.$cl.'">';
+ $ret .= $base;
+ $ret .= '</a>';
+ }else{
+ $ret .= '<a href="'.wl('',$this->_get_opts(array('id'=>$item['id'],'ns'=>''))).'" class="wikilink1'.$cl.'">';
+ $ret .= noNS($item['id']);
+ $ret .= '</a>';
+ }
+ return $ret;
+ }
- // save all non!-matching #FIXME invert is available from 4.2.0 only!
- $new_config = preg_grep("/$acl_pattern/", $acl_config, PREG_GREP_INVERT);
- return io_saveFile(DOKU_CONF.'acl.auth.php', join('',$new_config));
+ function _html_li_acl($item){
+ return '<li class="level'.$item['level'].'">';
}
- // --- HTML OUTPUT FUNCTIONS BELOW --- //
/**
- * print tablerows with the current permissions for one id
+ * Get current ACL settings as multidim array
*
- * @author Frank Schubert <frank@schokilade.de>
- * @author Andreas Gohr <andi@splitbrain.org>
+ * @author Andreas Gohr <andi@splitbrain.org>
*/
- function admin_acl_html_dropdown($id){
- $cur = $id;
- $ret = '';
- $opt = array();
+ function _init_acl_config(){
+ global $AUTH_ACL;
+ global $conf;
+ $acl_config=array();
+ $usersgroups = array();
- //prepare all options
+ foreach($AUTH_ACL as $line){
+ $line = trim(preg_replace('/#.*$/','',$line)); //ignore comments
+ if(!$line) continue;
- // current page
- $opt[] = array('key'=> $id, 'val'=> $id.' ('.$this->lang['page'].')');
+ $acl = preg_split('/\s+/',$line);
+ //0 is pagename, 1 is user, 2 is acl
- // additional namespaces
- while(($id=getNS($id)) !== false){
- $opt[] = array('key'=> $id.':*', 'val'=> $id.':* ('.$this->lang['namespace'].')');
- }
+ $acl[1] = rawurldecode($acl[1]);
+ $acl_config[$acl[0]][$acl[1]] = $acl[2];
- // the top namespace
- $opt[] = array('key'=> '*', 'val'=> '* ('.$this->lang['namespace'].')');
+ // store non-special users and groups for later selection dialog
+ $ug = $acl[1];
+ if($ug == '@ALL') continue;
+ if($ug == $conf['superuser']) continue;
+ if($ug == $conf['manager']) continue;
+ $usersgroups[] = $ug;
+ }
- // set sel on second entry (current namespace)
- $opt[1]['sel'] = ' selected="selected"';
+ $usersgroups = array_unique($usersgroups);
+ sort($usersgroups);
+ uksort($acl_config,array($this,'_sort_names'));
- // flip options
- $opt = array_reverse($opt);
+ $this->acl = $acl_config;
+ $this->usersgroups = $usersgroups;
+ }
- // create HTML
- $att = array( 'name' => 'acl_scope',
- 'class' => 'edit',
- 'title' => $this->lang['page'].'/'.$this->lang['namespace']);
- $ret .= '<select '.html_attbuild($att).'>';
- foreach($opt as $o){
- $ret .= '<option value="'.$o['key'].'"'.$o['sel'].'>'.$o['val'].'</option>';
- }
- $ret .= '</select>';
+ /**
+ * Custom function to sort the ACLs by namespace names
+ *
+ * @todo This maybe could be improved to resemble the real tree structure?
+ */
+ function _sort_names($a,$b){
+ $ca = substr_count($a,':');
+ $cb = substr_count($b,':');
+ if($ca < $cb){
+ return -1;
+ }elseif($ca > $cb){
+ return 1;
+ }else{
+ return strcmp($a,$b);
+ }
+ }
+
+ /**
+ * Display all currently set permissions in a table
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+ function _html_table(){
+ global $lang;
+ global $ID;
+
+ echo '<form action="'.wl().'" method="post" accept-charset="utf-8">'.NL;
+ if($this->ns){
+ echo '<input type="hidden" name="ns" value="'.hsc($this->ns).'" />'.NL;
+ }else{
+ echo '<input type="hidden" name="id" value="'.hsc($ID).'" />'.NL;
+ }
+ echo '<input type="hidden" name="acl_w" value="'.hsc($this->who).'" />'.NL;
+ echo '<input type="hidden" name="do" value="admin" />'.NL;
+ echo '<input type="hidden" name="page" value="acl" />'.NL;
+ echo '<table class="inline">';
+ echo '<tr>';
+ echo '<th>'.$this->getLang('where').'</th>';
+ echo '<th>'.$this->getLang('who').'</th>';
+ echo '<th>'.$this->getLang('perm').'</th>';
+ echo '<th>'.$lang['btn_delete'].'</th>';
+ echo '</tr>';
+ foreach($this->acl as $where => $set){
+ foreach($set as $who => $perm){
+ echo '<tr>';
+ echo '<td>';
+ if(substr($where,-1) == '*'){
+ echo '<span class="aclns">'.hsc($where).'</span>';
+ $ispage = false;
+ }else{
+ echo '<span class="aclpage">'.hsc($where).'</span>';
+ $ispage = true;
+ }
+ echo '</td>';
+
+ echo '<td>';
+ if($who{0} == '@'){
+ echo '<span class="aclgroup">'.hsc($who).'</span>';
+ }else{
+ echo '<span class="acluser">'.hsc($who).'</span>';
+ }
+ echo '</td>';
+
+ echo '<td>';
+ echo $this->_html_checkboxes($perm,$ispage,'acl['.hsc($where).']['.hsc($who).']');
+ echo '</td>';
+
+ echo '<td align="center">';
+ echo '<input type="checkbox" name="del['.hsc($where).']" value="'.hsc($who).'" class="edit" />';
+ echo '</td>';
+ echo '</tr>';
+ }
+ }
- return $ret;
+ echo '<tr>';
+ echo '<th align="right" colspan="4">';
+ echo '<input type="submit" value="'.$lang['btn_update'].'" name="cmd[update]" class="button" />';
+ echo '</th>';
+ echo '</tr>';
+ echo '</table>';
+ echo '</form>'.NL;
}
+
/**
- * print tablerows with the current permissions for one id
+ * Returns the permission which were set for exactly the given user/group
+ * and page/namespace. Returns null if no exact match is available
*
- * @author Frank Schubert <frank@schokilade.de>
- * @author Andreas Gohr <andi@splitbrain.org>
+ * @author Andreas Gohr <andi@splitbrain.org>
*/
- function admin_acl_html_new(){
- global $ID;
- global $lang;
-
- // table headers
- ptln('<tr>',2);
- ptln(' <th class="leftalign" colspan="3">'.$this->lang['acl_new'].'</th>',2);
- ptln('</tr>',2);
-
- ptln('<tr>',2);
-
- ptln('<td class="centeralign" colspan="3">',4);
-
- ptln(' <form method="post" action="'.wl($ID).'"><div class="no">',4);
- ptln(' <input type="hidden" name="do" value="admin" />',4);
- ptln(' <input type="hidden" name="page" value="acl" />',4);
- ptln(' <input type="hidden" name="acl_cmd" value="save" />',4);
- formSecurityToken();
-
- //scope select
- ptln($this->lang['acl_perms'],4);
- ptln($this->admin_acl_html_dropdown($ID),4);
-
- $att = array( 'name' => 'acl_type',
- 'class' => 'edit',
- 'title' => $this->lang['acl_user'].'/'.$this->lang['acl_group']);
- ptln(' <select '.html_attbuild($att).'>',4);
- ptln(' <option value="@">'.$this->lang['acl_group'].'</option>',4);
- ptln(' <option value="">'.$this->lang['acl_user'].'</option>',4);
- ptln(' </select>',4);
-
- $att = array( 'name' => 'acl_user',
- 'type' => 'text',
- 'class' => 'edit',
- 'title' => $this->lang['acl_user'].'/'.$this->lang['acl_group']);
- ptln(' <input '.html_attbuild($att).' />',4);
- ptln(' <br />');
-
- ptln( $this->admin_acl_html_checkboxes(0,false),8);
-
- ptln(' <input type="submit" class="button" value="'.$lang['btn_save'].'" />',4);
- ptln(' </div></form>');
- ptln('</td>',4);
- ptln('</tr>',2);
+ function _get_exact_perm(){
+ global $ID;
+ if($this->ns){
+ if($this->ns == '*'){
+ $check = '*';
+ }else{
+ $check = $this->ns.':*';
+ }
+ }else{
+ $check = $ID;
+ }
+
+ if(isset($this->acl[$check][auth_nameencode($this->who,true)])){
+ return $this->acl[$check][auth_nameencode($this->who,true)];
+ }else{
+ return null;
+ }
}
/**
- * print tablerows with the current permissions for one id
+ * adds new acl-entry to conf/acl.auth.php
*
* @author Frank Schubert <frank@schokilade.de>
- * @author Andreas Gohr <andi@splitbrain.org>
*/
- function admin_acl_html_current($id,$permissions){
- global $lang;
- global $ID;
-
- //is it a page?
- if(substr($id,-1) == '*'){
- $ispage = false;
- }else{
- $ispage = true;
- }
-
- // table headers
- ptln(' <tr>');
- ptln(' <th class="leftalign" colspan="3">');
- ptln($this->lang['acl_perms'],6);
- if($ispage){
- ptln($this->lang['page'],6);
- }else{
- ptln($this->lang['namespace'],6);
- }
- ptln('<em>'.$id.'</em>',6);
- ptln(' </th>');
- ptln(' </tr>');
-
- sort($permissions);
-
- foreach ($permissions as $conf){
- //userfriendly group/user display
- $conf['name'] = rawurldecode($conf['name']);
- if(substr($conf['name'],0,1)=="@"){
- $group = $this->lang['acl_group'];
- $name = substr($conf['name'],1);
- $type = '@';
- }else{
- $group = $this->lang['acl_user'];
- $name = $conf['name'];
- $type = '';
+ function _acl_add($acl_scope, $acl_user, $acl_level){
+ $acl_config = file_get_contents(DOKU_CONF.'acl.auth.php');
+ $acl_user = auth_nameencode($acl_user,true);
+
+ // max level for pagenames is edit
+ if(strpos($acl_scope,'*') === false) {
+ if($acl_level > AUTH_EDIT) $acl_level = AUTH_EDIT;
}
- ptln('<tr>',2);
- ptln('<td class="leftalign">'.htmlspecialchars($group.' '.$name).'</td>',4);
-
- // update form
- ptln('<td class="centeralign">',4);
- ptln(' <form method="post" action="'.wl($ID).'"><div class="no">',4);
- formSecurityToken();
- ptln(' <input type="hidden" name="do" value="admin" />',4);
- ptln(' <input type="hidden" name="page" value="acl" />',4);
- ptln(' <input type="hidden" name="acl_cmd" value="save" />',4);
- ptln(' <input type="hidden" name="acl_scope" value="'.formtext($id).'" />',4);
- ptln(' <input type="hidden" name="acl_type" value="'.$type.'" />',4);
- ptln(' <input type="hidden" name="acl_user" value="'.formtext($name).'" />',4);
- ptln( $this->admin_acl_html_checkboxes($conf['perm'],$ispage),8);
- ptln(' <input type="submit" class="button" value="'.$lang['btn_update'].'" />',4);
- ptln(' </div></form>');
- ptln('</td>',4);
-
-
- // deletion form
-
- $ask = $lang['del_confirm'].'\\n';
- $ask .= $id.' '.$conf['name'].' '.$conf['perm'];
- ptln('<td class="centeralign">',4);
- ptln(' <form method="post" action="'.wl($ID).'" onsubmit="return confirm(\''.str_replace('\\\\n','\\n',addslashes($ask)).'\')"><div class="no">',4);
- formSecurityToken();
- ptln(' <input type="hidden" name="do" value="admin" />',4);
- ptln(' <input type="hidden" name="page" value="acl" />',4);
- ptln(' <input type="hidden" name="acl_cmd" value="delete" />',4);
- ptln(' <input type="hidden" name="acl_scope" value="'.formtext($id).'" />',4);
- ptln(' <input type="hidden" name="acl_type" value="'.$type.'" />',4);
- ptln(' <input type="hidden" name="acl_user" value="'.formtext($name).'" />',4);
- ptln(' <input type="submit" class="button" value="'.$lang['btn_delete'].'" />',4);
- ptln(' </div></form>',4);
- ptln('</td>',4);
-
- ptln('</tr>',2);
- }
+ $new_acl = "$acl_scope\t$acl_user\t$acl_level\n";
+
+ $new_config = $acl_config.$new_acl;
+
+ return io_saveFile(DOKU_CONF.'acl.auth.php', $new_config);
}
+ /**
+ * remove acl-entry from conf/acl.auth.php
+ *
+ * @author Frank Schubert <frank@schokilade.de>
+ */
+ function _acl_del($acl_scope, $acl_user){
+ $acl_config = file(DOKU_CONF.'acl.auth.php');
+ $acl_user = auth_nameencode($acl_user,true);
+
+ $acl_pattern = '^'.preg_quote($acl_scope,'/').'\s+'.$acl_user.'\s+[0-8].*$';
+
+ // save all non!-matching
+ $new_config = preg_grep("/$acl_pattern/", $acl_config, PREG_GREP_INVERT);
+
+ return io_saveFile(DOKU_CONF.'acl.auth.php', join('',$new_config));
+ }
/**
- * print the permission checkboxes
+ * print the permission radio boxes
*
* @author Frank Schubert <frank@schokilade.de>
* @author Andreas Gohr <andi@splitbrain.org>
*/
- function admin_acl_html_checkboxes($setperm,$ispage){
- global $lang;
-
- static $label = 0; //number labels
- $ret = '';
-
- foreach(array(AUTH_READ,AUTH_EDIT,AUTH_CREATE,AUTH_UPLOAD,AUTH_DELETE) as $perm){
- $label += 1;
-
- //general checkbox attributes
- $atts = array( 'type' => 'checkbox',
- 'id' => 'pbox'.$label,
- 'name' => 'acl_perm[]',
- 'value' => $perm );
- //dynamic attributes
- if($setperm >= $perm) $atts['checked'] = 'checked';
- # if($perm > AUTH_READ) $atts['onchange'] = #FIXME JS to autoadd lower perms
- if($ispage && $perm > AUTH_EDIT) $atts['disabled'] = 'disabled';
-
- //build code
- $ret .= '<label for="pbox'.$label.'" title="'.$this->lang['acl_perm'.$perm].'">';
- $ret .= '<input '.html_attbuild($atts).' />';
- $ret .= $this->lang['acl_perm'.$perm];
- $ret .= "</label>\n";
- }
- return $ret;
+ function _html_checkboxes($setperm,$ispage,$name){
+ global $lang;
+
+ static $label = 0; //number labels
+ $ret = '';
+
+ if($ispage && $setperm > AUTH_EDIT) $perm = AUTH_EDIT;
+
+ foreach(array(AUTH_NONE,AUTH_READ,AUTH_EDIT,AUTH_CREATE,AUTH_UPLOAD,AUTH_DELETE) as $perm){
+ $label += 1;
+
+ //general checkbox attributes
+ $atts = array( 'type' => 'radio',
+ 'id' => 'pbox'.$label,
+ 'name' => $name,
+ 'value' => $perm );
+ //dynamic attributes
+ if(!is_null($setperm) && $setperm == $perm) $atts['checked'] = 'checked';
+ if($ispage && $perm > AUTH_EDIT){
+ $atts['disabled'] = 'disabled';
+ $class = ' class="disabled"';
+ }else{
+ $class = '';
+ }
+
+ //build code
+ $ret .= '<label for="pbox'.$label.'" title="'.$this->getLang('acl_perm'.$perm).'"'.$class.'>';
+ $ret .= '<input '.html_attbuild($atts).' />&nbsp;';
+ $ret .= $this->getLang('acl_perm'.$perm);
+ $ret .= '</label>'.NL;
+ }
+ return $ret;
}
+ /**
+ * Print a user/group selector (reusing already used users and groups)
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+ function _html_select(){
+ global $conf;
+ $inlist = false;
+
+ $specials = array('@ALL','@'.$conf['defaultgroup']);
+ if($conf['manager'] && $conf['manager'] != '!!not set!!') $specials[] = $conf['manager'];
+
+
+ if($this->who &&
+ !in_array($this->who,$this->usersgroups) &&
+ !in_array($this->who,$specials)){
+
+ if($this->who{0} == '@'){
+ $gsel = ' selected="selected"';
+ }else{
+ $usel = ' selected="selected"';
+ }
+ }else{
+ $usel = '';
+ $gsel = '';
+ $inlist = true;
+ }
+
+
+ echo '<select name="acl_t" class="edit">'.NL;
+ echo ' <option value="__g__" class="aclgroup"'.$gsel.'>'.$this->getLang('acl_group').':</option>'.NL;
+ echo ' <option value="__u__" class="acluser"'.$usel.'>'.$this->getLang('acl_user').':</option>'.NL;
+ echo ' <optgroup label="&nbsp;">'.NL;
+ foreach($specials as $ug){
+ if($ug == $this->who){
+ $sel = ' selected="selected"';
+ $inlist = true;
+ }else{
+ $sel = '';
+ }
+
+ if($ug{0} == '@'){
+ echo ' <option value="'.hsc($ug).'" class="aclgroup"'.$sel.'>'.hsc($ug).'</option>'.NL;
+ }else{
+ echo ' <option value="'.hsc($ug).'" class="acluser"'.$sel.'>'.hsc($ug).'</option>'.NL;
+ }
+ }
+ echo ' </optgroup>'.NL;
+ echo ' <optgroup label="&nbsp;">'.NL;
+ foreach($this->usersgroups as $ug){
+ if($ug == $this->who){
+ $sel = ' selected="selected"';
+ $inlist = true;
+ }else{
+ $sel = '';
+ }
+
+ if($ug{0} == '@'){
+ echo ' <option value="'.hsc($ug).'" class="aclgroup"'.$sel.'>'.hsc($ug).'</option>'.NL;
+ }else{
+ echo ' <option value="'.hsc($ug).'" class="acluser"'.$sel.'>'.hsc($ug).'</option>'.NL;
+ }
+ }
+ echo ' </optgroup>'.NL;
+ echo '</select>'.NL;
+ return $inlist;
+ }
}
diff --git a/lib/plugins/acl/ajax.php b/lib/plugins/acl/ajax.php
new file mode 100644
index 000000000..daed03306
--- /dev/null
+++ b/lib/plugins/acl/ajax.php
@@ -0,0 +1,60 @@
+<?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 sesseion
+session_write_close();
+
+$ID = getID();
+
+if(!auth_isadmin) die('for admins only');
+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 ='';
+ }
+ $lvl = count(explode(':',$ns));
+ $ns = utf8_encodeFN(str_replace(':','/',$ns));
+
+ $data = array();
+ search($data,$conf['datadir'],'search_index',array('ns' => $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>';
+ }
+}
+
diff --git a/lib/plugins/acl/lang/ar/intro.txt b/lib/plugins/acl/lang/ar/intro.txt
deleted file mode 100644
index 7dba628fe..000000000
--- a/lib/plugins/acl/lang/ar/intro.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-====== إدارة قوائم التحكم بالدخول ======
-
-فى هذه الصفحة يمكنك أضافة أو مسح تراخيص للصفحة الحالية أو [[doku>wiki:namespaces|فضاء التسمية]] كلة. يتوجب عليك قراءه الدليل الرسمى [[doku>wiki:acl| لإدارة قوائم التحكم بالدخول]] لتتمكن من فهم كيفية عمل التحكم بالدخول.
-
-الصفحة تعرض كل التراخيص ذات أهمية للصفحة الحالية. التراخيص المعنية بصفحات أخرى لا تظهر هنا. لتغير تراخيص تلك الصفحات [[this>doku.php?do=index|تصفح]] للصفحة المرادة ثم أدخل على أدرة قوائم التحكم بالدخول. \ No newline at end of file
diff --git a/lib/plugins/acl/lang/bg/intro.txt b/lib/plugins/acl/lang/bg/intro.txt
deleted file mode 100644
index 27b8ba293..000000000
--- a/lib/plugins/acl/lang/bg/intro.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-====== Управление на Списъците за достъп ======
-
-На тази страница можете да добавяте и премахвате права за
-текущата страница и всички [[doku>wiki:namespaces|именнипространства]]
-в които е. Добре е да прочетете [[doku>wiki:acl|официалната документация за
-ACL]] за да разберете напълно как работи контролът за достъп.
-
-Тази страница показва всички права, които са значими за текущата страница.
-Правата отнасящи се до други страници не се показват -- за да ги редактирате
-[[this>doku.php?do=index|отидете]] на съответната страница първо и след това
-влезте в Настройки и Управление на списъци за достъп(ACL)
diff --git a/lib/plugins/acl/lang/ca/intro.txt b/lib/plugins/acl/lang/ca/intro.txt
deleted file mode 100644
index 492abdea5..000000000
--- a/lib/plugins/acl/lang/ca/intro.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-====== Gestió de la llista de control d'accés ======
-
-En aquesta pàgina podeu afegir i suprimir permissos per a la pàgina
-actual i per a tots els [[doku>wiki:namespaces|namespaces]] en què
-hi és. Per entendre bé com funciona el control de accés llegiu la
-[[doku>wiki:acl|documentació oficial sobre ACL]].
-
-Aquesta pàgina mostra tots els permissos relatius a la pàgina
-actual. No es mostren els permissos relatius a altres pàgines:
-aquests podeu editar-los [[this>doku.php?do=index|navegant]] fins
-la pàgina corresponent i llavors passant a Gestió de la llista de
-control d'accés.
-
diff --git a/lib/plugins/acl/lang/cs/intro.txt b/lib/plugins/acl/lang/cs/intro.txt
deleted file mode 100644
index aa255203e..000000000
--- a/lib/plugins/acl/lang/cs/intro.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-====== Správa přístupových práv (ACL) ======
-
-Na této stránce můžete přidávat i odebírat oprávnění k aktuální stránce
-i ke všem [[doku>wiki:namespaces|jmenným prostorům]], do nichž náleží. Abyste
-plně porozuměli, jak správa přístupových práv (ACL) funguje, přečtěte si
-[[doku>wiki:acl|oficiální dokumentaci k ACL]].
-
-Na této stránce jsou zobrazeny pouze přístupová práva vztahující se ke
-konkrétní stránce. Práva k ostatním stránkám se zde nezobrazují. Pro jejich
-úpravu proto [[this>doku.php?do=index|přejděte]] nejprve na danou stránku a poté
-zvolte správu přístupových práv.
diff --git a/lib/plugins/acl/lang/da/intro.txt b/lib/plugins/acl/lang/da/intro.txt
deleted file mode 100644
index cdd4bef31..000000000
--- a/lib/plugins/acl/lang/da/intro.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-====== Rettighedsadministration ======
-
-I dette dokument kan du tilføje og fjerne rettigheder for det
-nuværende dokument, samt alle de [[doku>wiki:namespaces|navnerum]]
-dokumentet er en del af. Før du går igang bør du læse den officielle
-[[doku>wiki:acl|ACL dokumentation]], for fuldt ud at forstå hvordan
-rettighedskontrollen virker.
-
-Herunder vises alle rettigheder der har betydning for det nuværende
-dokument. Rettigheder for andre dokumenter vises ikke her. For at
-ændre rettigheder for andre dokumenter, skal du først
-[[this>doku.php?do=index|finde frem]] til det pågældende dokument,
-hvorefter du kan ændre rettighederne her. \ No newline at end of file
diff --git a/lib/plugins/acl/lang/de/intro.txt b/lib/plugins/acl/lang/de/intro.txt
deleted file mode 100644
index a74aca81c..000000000
--- a/lib/plugins/acl/lang/de/intro.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-====== Zugangsverwaltung ======
-
-Hier können die Berechtigungen für die aktuelle Seite und alle übergeordneten
-[[doku>wiki:namespaces|Namensräume]] festgelegt werden. Es wird empfohlen
-zunächst die [[doku>wiki:acl|offizielle Dokumentation]] zur Zugangsverwaltung
-zu lesen, um zu verstehen wie diese arbeitet.
-
-Diese Seite zeigt nur die Berechtigungen an, die sich auf die aktuell gewählte Wiki-Seite
-auswirken. Berechtigungen für andere Seiten werden nicht gezeigt -- um diese bearbeiten
-zu können ist es erforderlich zunächst auf die [[this>doku.php?do=index|gewünschte Seite]]
-zu wechseln bevor die Zugangsverwaltung aufgerufen wird.
-
diff --git a/lib/plugins/acl/lang/el/intro.txt b/lib/plugins/acl/lang/el/intro.txt
deleted file mode 100644
index b2a6e2182..000000000
--- a/lib/plugins/acl/lang/el/intro.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-====== Διαχείριση Λιστών Δικαιωμάτων Πρόσβασης - ACL ======
-
-Εδώ μπορείτε να προσθέσετε, αφαιρέσετε ή τροποποιήσετε τις Λίστες Δικαιωμάτων Πρόσβασης
-για την τρέχουσα σελίδα και όλους τους [[doku>wiki:namespaces|φακέλους]]
-πάνω από αυτήν. Πρέπει να διαβάσετε την
-[[doku>wiki:acl|επίσημη τεκμηρίωση των Λιστών Δικαιωμάτων Πρόσβασης - ACL]]
-για να καταλάβετε πως ακριβώς δουλεύει.
-
-Παρακάτω εμφανίζονται επίσης, όλα τα Δικαιώματα Πρόσβασης που αφορούν
-την τρέχουσα σελίδα. Τα Δικαιώματα Πρόσβασης που αφορούν άλλες σελίδες
-δεν εμφανίζονται -- για να τα τροποποιήσετε [[this>doku.php?do=index|δείτε]]
-την αντίστοιχη σελίδα πρώτα, και μετά μπείτε από εκεί στη
-Διαχείριση Δικαιωμάτων Πρόσβασης.
-
diff --git a/lib/plugins/acl/lang/en/intro.txt b/lib/plugins/acl/lang/en/intro.txt
deleted file mode 100644
index ff5442e24..000000000
--- a/lib/plugins/acl/lang/en/intro.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-====== Access Control List Management ======
-
-On this page you can add and remove permissions for the current
-page and all the [[doku>wiki:namespaces|namespaces]] it is in.
-You should read the [[doku>wiki:acl|official documentation on ACL]]
-to fully understand how access control works.
-
-The page displays all permissions that are significant for the
-current page. Permissions regarding other pages are not shown -- to
-edit them [[this>doku.php?do=index|browse]] to the according page
-first, then change to the ACL Administration.
-
diff --git a/lib/plugins/acl/lang/en/lang.php b/lib/plugins/acl/lang/en/lang.php
index 8f52e7bb6..918451305 100644
--- a/lib/plugins/acl/lang/en/lang.php
+++ b/lib/plugins/acl/lang/en/lang.php
@@ -15,10 +15,29 @@ $lang['acl_perms'] = 'Permissions for';
$lang['page'] = 'Page';
$lang['namespace'] = 'Namespace';
+$lang['p_user_id'] = 'User <b class="acluser">%s</b> currently has the following permissions on page <b class="aclpage">%s</b>: <i>%s</i>.';
+$lang['p_user_ns'] = 'User <b class="acluser">%s</b> currently has the following permissions in namespace <b class="aclns">%s</b>: <i>%s</i>.';
+$lang['p_group_id'] = 'Members of group <b class="aclgroup">%s</b> currently have the following permissions on page <b class="aclpage">%s</b>: <i>%s</i>.';
+$lang['p_group_ns'] = 'Members of group <b class="aclgroup">%s</b> currently have the following permissions in namespace <b class="aclns">%s</b>: <i>%s</i>.';
+
+$lang['p_choose_id'] = 'Please <b>enter a user or group</b> in the form above to view or edit the permissions set for the page <b class="aclpage">%s</b>.';
+$lang['p_choose_ns'] = 'Please <b>enter a user or group</b> in the form above to view or edit the permissions set for the namespace <b class="aclns">%s</b>.';
+
+
+$lang['p_inherited'] = 'Note: Those permissions were not set explicitly but were inherited from other groups or higher namespaces.';
+$lang['p_isadmin'] = 'Note: The selected group or user has always full permissions because it is configured as superuser.';
+
+$lang['current'] = 'Current ACL Rules';
+$lang['where'] = 'Page/Namespace';
+$lang['who'] = 'User/Group';
+$lang['perm'] = 'Permissions';
+
+$lang['acl_perm0'] = 'None';
$lang['acl_perm1'] = 'Read';
$lang['acl_perm2'] = 'Edit';
$lang['acl_perm4'] = 'Create';
$lang['acl_perm8'] = 'Upload';
$lang['acl_perm16'] = 'Delete';
$lang['acl_new'] = 'Add new Entry';
+$lang['acl_mod'] = 'Modify Entry';
//Setup VIM: ex: et ts=2 enc=utf-8 :
diff --git a/lib/plugins/acl/lang/eo/intro.txt b/lib/plugins/acl/lang/eo/intro.txt
deleted file mode 100644
index dbe7f0efd..000000000
--- a/lib/plugins/acl/lang/eo/intro.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-====== Administrejo de Listo por Kontrolo de Aliro ======
-
-En tiu cxi pagxo vi povas aldoni kaj forigi aliro-rajtojn al la aktuala pagxo kaj al cxiuj [[doku>wiki:eo:namespaces|nomspacoj]] en kiuj gxi estas.
-Vi devus legi la [[doku>wiki:eo:acl|oficialan dokumentajxon pri LKA]] por tute kompreni kiel la kontrolado de aliro funkcias.
-
-La pagxo montras cxiujn permesojn, kiuj estas gravaj por la aktuala pagxo. Permesoj pri aliaj pagxoj ne estas montrataj -- por redakti ilin, unue [[this>doku.php?do=index|krozu]] al la koncernanta pagxo kaj tiam aliru la Administrejon de LKA. \ No newline at end of file
diff --git a/lib/plugins/acl/lang/eo/lang.php b/lib/plugins/acl/lang/eo/lang.php
index 3f61fda21..c3589387a 100644
--- a/lib/plugins/acl/lang/eo/lang.php
+++ b/lib/plugins/acl/lang/eo/lang.php
@@ -3,18 +3,4 @@
* Esperantolanguage file
*
* @author Felipe Castro <fefcas@uol.com.br>
- * @author Felipe Castro <fefcas@gmail.com>
- * @author Felipe Castro <fefcas (cxe) gmail (punkto) com>
*/
-$lang['admin_acl'] = 'Administrejo de Listo por Kontrolo de Aliro';
-$lang['acl_group'] = 'Grupo';
-$lang['acl_user'] = 'Uzulo';
-$lang['acl_perms'] = 'Permesoj por';
-$lang['page'] = 'Paĝo';
-$lang['namespace'] = 'Nomspaco';
-$lang['acl_perm1'] = 'Legi';
-$lang['acl_perm2'] = 'Modifi';
-$lang['acl_perm4'] = 'Krei';
-$lang['acl_perm8'] = 'Alŝuti';
-$lang['acl_perm16'] = 'Forigi';
-$lang['acl_new'] = 'Aldoni novan eron';
diff --git a/lib/plugins/acl/lang/es/intro.txt b/lib/plugins/acl/lang/es/intro.txt
deleted file mode 100644
index da0af642b..000000000
--- a/lib/plugins/acl/lang/es/intro.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-====== Administración de la lista de control de acceso ======
-
-En esta página tu puedes agregar y quitar permisos para la página
-actual y todos los [[doku>wiki:namespaces|espacios de nombres]] en los
-que está. Tu deberías leer la [[doku>wiki:acl|documentación oficial
-sobre ACL]] para comprender completamente cómo funcionan el control de acceso.
-
-La página muestra todos los permisos que son significativos para
-la página actual. Los permisos relativos a otras páginas no se muestran --
-para editarlos, primero [[this>doku.php?do=index|navega]] a la página correspondiente y
-luego vé a la administración de ACL.
diff --git a/lib/plugins/acl/lang/et/intro.txt b/lib/plugins/acl/lang/et/intro.txt
deleted file mode 100644
index a70b0944e..000000000
--- a/lib/plugins/acl/lang/et/intro.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-====== Ligipääsukontrolli nimekirja haldamine ======
-
-Sellel lehel saad lisada ja eemaldada käesolevale lehele ja
-selle kõigile [[doku>wiki:namespaces|alajaotustele]] mõeldud õigusi.
-Aga kõigepealt peaksid Sa ikka läbi lugema [[doku>wiki:acl|ACL-i puudutava ametliku info]],
-et pihta saada kuidas ligipääsu kontrollimine toimib.
-
-See leht näitab kõiki õigusi, mis on käesoleva lehe jaoks määrava tähtsusega.
-Teisi lehti puudutavaid õigusi siin ei näe -- selleks et neid toimetada
-[[this>doku.php?do=index|otsi kõigepealt üles]] vastav leht ja siis asu ACL adminstreerimise kallale.
-
diff --git a/lib/plugins/acl/lang/eu/intro.txt b/lib/plugins/acl/lang/eu/intro.txt
deleted file mode 100644
index 704d67220..000000000
--- a/lib/plugins/acl/lang/eu/intro.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-====== ACL Kudeaketa ======
-
-Tresna honekin atal honi, eta baita bertako [[doku>wiki:namespaces|namespace]] guztiei, baimenak gehitu edo ezabatu diezazkiozu. Ezer aldatu aurretik [[doku>wiki:acl|ACLei buruzko dokumentazio ofiziala]] irakurri beharko zenuke hau dena guztiz ulertzeko.
-
-Jarraian atal honetarako ezarriak dauden baimenak azaltzen dira. Beste atalei dagozkien baimenak ez dira azaltzen -- [[this>doku.php?do=index|hauek]] aldatzeko orri bakoitza kudeatu beharko duzu.
diff --git a/lib/plugins/acl/lang/fi/intro.txt b/lib/plugins/acl/lang/fi/intro.txt
deleted file mode 100644
index e3584a32b..000000000
--- a/lib/plugins/acl/lang/fi/intro.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-====== Käyttöoikeuksien hallinta ======
-
-Tällä sivulla voit lisätä ja poistaa oikeuksia nykyiselle sivulle ja
-[[doku>wiki:namespaces|nimiavaruuksille]]. Lue
-[[doku>wiki:acl|käyttöoikeuksien (ACL) virallinen dokumentaatio]]
-ymmärtääksesi kuinka käyttöoikeuksien hallinta toimii.
-
-Näkyvillä on kaikki käyttöoikeudet, jotka koskevat tätä sivua. Muiden
-sivujen käyttöoikeudet eivät ole näkyvillä -- muokataksesi niitä
-[[this>doku.php?do=index|selaa]] ensin ko. sivulle ja valitse sen
-jälkeen käyttöoikeuksien hallinta.
diff --git a/lib/plugins/acl/lang/fr/intro.txt b/lib/plugins/acl/lang/fr/intro.txt
deleted file mode 100644
index 74a0ad579..000000000
--- a/lib/plugins/acl/lang/fr/intro.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-====== Gestion de la liste des contrôles d'accès [ACL] ======
-
-Sur cette page vous pouvez ajouter ou enlever les permissions pour la page
-courante et toutes les [[doku>wiki:namespaces|catégories]] dont elle fait
-partie. Vous devriez lire la [[doku>wiki:acl|documentation officielle sur
-les ACL]] pour mieux comprendre comment les contrôles d'accès fonctionnent.
-
-Cette page affiche toutes les permissions significatives pour la page
-courante. Les permissions concernant les autres pages ne sont pas affichées
--- pour modifier ces dernières, [[this>doku.php?do=index|fureter]] jusqu'à
-la page en question puis retourner à l'outil administratif de gestion des
-contrôles d'accès [ACL].
diff --git a/lib/plugins/acl/lang/fr/lang.php b/lib/plugins/acl/lang/fr/lang.php
index 91c95c0be..0369166de 100644
--- a/lib/plugins/acl/lang/fr/lang.php
+++ b/lib/plugins/acl/lang/fr/lang.php
@@ -3,24 +3,26 @@
* french language file
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
- * @author Sébastien Bauer <sebastien.bauer@advalvas.be>
- * @author Antoine Fixary <antoine.fixary@freesbee.fr>
- * @author cumulus <pta-n56@myamail.com>
- * @author Gwenn Gueguen <contact@demisel.net>
- * @author Guy Brand <gb@isis.u-strasbg.fr>
- * @author Fabien Chabreuil <fabien@integralpersonality.com>
- * @author Stéphane Chamberland <stephane.chamberland@ec.gc.ca>
- * @author Delassaux Julien <julien@delassaux.fr>
+ * @author Sébastien Bauer <sebastien.bauer@advalvas.be>
+ * @author Antoine Fixary <antoine.fixary@freesbee.fr>
+ * @author cumulus <pta-n56@myamail.com>
+ * @author Gwenn Gueguen <contact@demisel.net>
+ * @author Guy Brand <gb@isis.u-strasbg.fr>
+ * @author Fabien Chabreuil <fabien@integralpersonality.com>
+ * @author Stéphane Chamberland <stephane.chamberland@ec.gc.ca>
*/
-$lang['admin_acl'] = 'Gestion de la liste des contrôles d\'accès';
-$lang['acl_group'] = 'Groupe';
-$lang['acl_user'] = 'Utilisateur';
-$lang['acl_perms'] = 'Permission pour';
-$lang['page'] = 'Page';
-$lang['namespace'] = 'Catégorie';
-$lang['acl_perm1'] = 'Lecture';
-$lang['acl_perm2'] = 'Écriture';
-$lang['acl_perm4'] = 'Création';
-$lang['acl_perm8'] = 'Télécharger';
-$lang['acl_perm16'] = 'Effacer';
-$lang['acl_new'] = 'Ajouter une nouvelle entrée';
+
+$lang['admin_acl'] = 'Gestion de la liste des contrôles d\'accès';
+$lang['acl_group'] = 'Groupe';
+$lang['acl_user'] = 'Utilisateur';
+$lang['acl_perms'] = 'Permission pour';
+$lang['page'] = 'Page';
+$lang['namespace'] = 'Catégorie';
+
+$lang['acl_perm1'] = 'Lecture';
+$lang['acl_perm2'] = 'Écriture';
+$lang['acl_perm4'] = 'Création';
+$lang['acl_perm8'] = 'Télécharger';
+$lang['acl_perm16'] = 'Effacer';
+$lang['acl_new'] = 'Ajouter une nouvelle entrée';
+//Setup VIM: ex: et ts=2 enc=utf-8 :
diff --git a/lib/plugins/acl/lang/gl/intro.txt b/lib/plugins/acl/lang/gl/intro.txt
deleted file mode 100644
index 56f3f853d..000000000
--- a/lib/plugins/acl/lang/gl/intro.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-====== Xestión da Lista de Control de Acceso (ACL) ======
-
-Nesta páxina podes engadir e eliminar permisos para a páxina actual e todos os [[doku>wiki:namespaces|nomes de espazo]] nos que está. Podes ler a [[doku>wiki:acl|documentación oficial verbo da ACL]]para afondar no coñecemento do funcionamento do control de acceso.
-
-A páxina amosa todos os permisos significativos para a páxina actual. Non se amosan os permisos correspondentes a outras páxinas -- para editar estes [[this>doku.php?do=index|accede]] primeiro á páxina correspondente, e logo vai á Administración da ACL. \ No newline at end of file
diff --git a/lib/plugins/acl/lang/he/intro.txt b/lib/plugins/acl/lang/he/intro.txt
deleted file mode 100644
index 90f0b72ab..000000000
--- a/lib/plugins/acl/lang/he/intro.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-====== ניהול רשימת בקרת גישות (ACL) ======
-
-בדף זה ניתן להוסיף ולהסיר הרשאות לדף הנוכחי ולכל
-[[doku>wiki:namespaces|מרחבי השמות]] בהם הוא נמצא.
-עליך לקרוא את [[doku>wiki:acl|התיעוד הרשמי על ACL]]
-כדי להבין באופן מלא כיצד בקרת גישות עובדת.
-
-הדף מציג את כל ההרשאות בעלות המשמעות לדף הנוכחי.
- הרשאות הנוגעות לדפים אחרים אינן מוצגות -- כדי לערוך אותן יש ראשית
- [[this>doku.php?do=index|לדפדף]] אל הדף המתאים
- ואז לעבור אל ניהול ה-ACL.
-
diff --git a/lib/plugins/acl/lang/id/intro.txt b/lib/plugins/acl/lang/id/intro.txt
deleted file mode 100644
index d986e1da2..000000000
--- a/lib/plugins/acl/lang/id/intro.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-====== Manajemen Kontrol Akses ======
-
-Pada halaman ini Anda dapat menambah dan menghapus hak akses untuk sebuah halaman
-atau semua halaman pada sebuah [[doku>wiki:namespaces|namespaces]].
-Untuk lebih memahami bagaiman kontrol akses bekerja, silahkan membaca
-[[doku>wiki:acl|Dokumentasi resmi unuk ACL]]
-
-Halaman ini menampilkan hak akses yang signifikan untuk halaman ini saja.
-Hak akses untuk halaman lain tidak ditampilkan. Untuk mengubahnya
-[[this>doku.php?do=index|browse]] ke halaman tersebut dan ubah administrasi
-ACL-nya.
-
diff --git a/lib/plugins/acl/lang/id/lang.php b/lib/plugins/acl/lang/id/lang.php
index 39ea30c22..1068d04f6 100644
--- a/lib/plugins/acl/lang/id/lang.php
+++ b/lib/plugins/acl/lang/id/lang.php
@@ -3,18 +3,20 @@
* Indonesian language file
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
- * @author mubaidillah <mubaidillah@gmail.com>
- * @author Irwan Butar Butar <irwansah.putra@gmail.com>
+ * @author mubaidillah <mubaidillah@gmail.com>
*/
-$lang['admin_acl'] = 'Manajemen Daftar Pengendali Akses';
-$lang['acl_group'] = 'Grup';
-$lang['acl_user'] = 'User';
-$lang['acl_perms'] = 'Ijin untuk';
-$lang['page'] = 'Halaman';
-$lang['namespace'] = 'Namespace';
-$lang['acl_perm1'] = 'Baca';
-$lang['acl_perm2'] = 'Ubah';
-$lang['acl_perm4'] = 'Buat';
-$lang['acl_perm8'] = 'Upload';
-$lang['acl_perm16'] = 'Hapus';
-$lang['acl_new'] = 'Tambah Entri baru';
+
+$lang['admin_acl'] = 'Manajemen Daftar Pengendali Akses';
+
+$lang['acl_group'] = 'Grup';
+$lang['acl_user'] = 'User';
+$lang['acl_perms'] = 'Ijin untuk';
+$lang['page'] = 'Halaman';
+$lang['namespace'] = 'Namespace';
+
+$lang['acl_perm1'] = 'Baca';
+$lang['acl_perm2'] = 'Ubah';
+$lang['acl_perm4'] = 'Buat';
+$lang['acl_perm8'] = 'Upload';
+$lang['acl_perm16'] = 'Hapus';
+$lang['acl_new'] = 'Tambah Entry baru';
diff --git a/lib/plugins/acl/lang/it/intro.txt b/lib/plugins/acl/lang/it/intro.txt
deleted file mode 100644
index ee12d9316..000000000
--- a/lib/plugins/acl/lang/it/intro.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-====== Gestione Lista Controllo Accessi (ACL) ======
-
-In questa pagina puoi aggiungere o rimuovere permessi per la pagina corrente
-e per tutte le [[doku>wiki:namespaces|categorie]] di cui fa parte.
-Dovresti leggere la [[doku>wiki:acl|documentazione ufficiale su ACL]]
-per comprendere appieno come funziona il controllo degli accessi.
-
-Questa pagina mostra tutti i permessi che sono significativi per
-la pagina corrente. I permessi riguardanti le altre pagine non sono
-visualizzati -- per modificare questi ultimi devi prima [[this>doku.php?do=index|navigare]]
-fino alla pagina desiderata per poi spostarti nella pagina di Gestione ACL.
-
diff --git a/lib/plugins/acl/lang/ja/intro.txt b/lib/plugins/acl/lang/ja/intro.txt
deleted file mode 100644
index 9aaa1372b..000000000
--- a/lib/plugins/acl/lang/ja/intro.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-====== アクセスコントロール ======
-
-
-現在の文書と文書の[[doku>wiki:namespaces|名前空間]] に属するページに対しての権限を設定することができます。アクセスコントロールについては[[doku>wiki:acl|official documentation on ACL]] に詳しく書かれているので参考にして下さい。
-
-このページには、現在の文書に対する権限のみが表示されています。他の文書に対しての権限を変更するには、まず [[this>doku.php?do=index|browse]] から希望の文書を表示させて、管理者メニューにアクセスしてください。
-
diff --git a/lib/plugins/acl/lang/ko/intro.txt b/lib/plugins/acl/lang/ko/intro.txt
deleted file mode 100644
index f3e703265..000000000
--- a/lib/plugins/acl/lang/ko/intro.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-====== 접근 제어 목록 관리 ======
-
-이 페이지에서 현재 페이지와 페이지가 포함된 [[doku>wiki:ko:namespaces|네임스페이스]]에 대한 권한을 추가하거나 삭제할 수 있습니다.
-접근 제어가 동작하는 방법을 확실하게 이해하려면 먼저 [[doku>wiki:ko:acl|ACL공식 문서(번역)]]나 [[doku>wiki:acl|ACL공식 문서(영문)]]을 읽어보기 바랍니다.
-
-이 페이지는 현재 페이지에 의미있는 모든 권한을 보여줍니다.
-다른 페이지들에 대한 권한은 보여주지 않습니다. -- 다른 페이지들을 수정하고 싶다면 먼저 해당 페이지로 [[this>doku.php?do=index|이동]]한 후, ACL 관리로 변경합니다.
-
diff --git a/lib/plugins/acl/lang/lt/intro.txt b/lib/plugins/acl/lang/lt/intro.txt
deleted file mode 100644
index 2552497e4..000000000
--- a/lib/plugins/acl/lang/lt/intro.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-====== Priėjimo Kontrolės Sąrašų (PKS) valdymas ======
-
-Šiame puslapyje jūs galite pridėti ir išimti priėjimo leidimus esamam puslapiui ir visiems [[doku>wiki:namespaces|puslapiams]], kurie yra jame.
-Prieš ką nors darydami turėtumėte paskaityti [[doku>wiki:acl|oficialią PKS dokumentaciją]]. Tai leis jums suprasti, kaip šie sąrašai veikia.
-
-Šiame puslapyje matote visus priėjimo leidimus, kurie priklauso esamam puslapiui. Čia nerasite kitų puslapių priėjimo leidimų. Norėdami redaguoti kito puslapio leidimus, turite jį [[this>doku.php?do=index|susirasti]], tada išsirinkti PKS Administraciją.
diff --git a/lib/plugins/acl/lang/lv/intro.txt b/lib/plugins/acl/lang/lv/intro.txt
deleted file mode 100644
index 377251e99..000000000
--- a/lib/plugins/acl/lang/lv/intro.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-====== Piekļuves tiesību vadība ======
-
-Šajā lapā var pievienot un dzēst tiesības uz patreizējo lapu un [[doku>wiki:namespaces|nodaļu]] kurā tā atrodas.
-Lai saprastu, kā tās darbojas, Tev jāizlasa [[doku>wiki:acl|oficiālā dokumentācija par piekļuves tiesībām (ACL)]].
-
-Lapa parāda visas tiesības, kas attiecas patreizējo lapu. Tiesības uz citām lapā nav parādītas. Lai mainītu tās, vispirms to [[this>doku.php?do=index|sameklē]] un tad pārej uz piekļuves tiesību vadību.
-
-
diff --git a/lib/plugins/acl/lang/nl/intro.txt b/lib/plugins/acl/lang/nl/intro.txt
deleted file mode 100644
index c094b370b..000000000
--- a/lib/plugins/acl/lang/nl/intro.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-====== Toegangsrechten ======
-
-Op deze pagina is het mogelijk permissies toe te voegen en te verwijderen voor de huidige
-pagina en alle [[doku>wiki:namespaces|namespaces]] waar deze in staat.
-Het is aan te raden eerst de [[doku>wiki:acl|officiële documentatie]] te lezen,
-om te begrijpen hoe toegangsrechten werken.
-
-Hieronder staan alle permissies die van belang zijn voor de huidige pagina.
-Permissies van andere pagina's worden niet getoond -- om deze te wijzigen:
-ga eerst naar de [[this>doku.php?do=index|betreffende pagina]] en kies dan
-via Beheer de Toegangsrechten.
diff --git a/lib/plugins/acl/lang/no/intro.txt b/lib/plugins/acl/lang/no/intro.txt
deleted file mode 100644
index b5f744e71..000000000
--- a/lib/plugins/acl/lang/no/intro.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-====== Administrasjon av lister for adgangskontroll (ACL) ======
-
-På denne siden kan du legge til og fjerne rettigheter for den nåværende
-siden og alle [[doku>wiki:namespaces|navnerom]] den befinner seg på.
-Du burde lese den [[doku>wiki:acl|offisielle dokumentasjonen for ACL]] for
-å forstå hvordan tilgangskontroll fungerer.
-
-Siden viser alle rettigheter som er av betydning for den nåværende siden.
-Rettigheter som gjelder andre sider blir ikke vist her -- men for å
-redigere dem, [[this>doku.php?do=index|gå til siden]] det gjelder, og
-skift til ACL Administrasjon.
diff --git a/lib/plugins/acl/lang/pl/intro.txt b/lib/plugins/acl/lang/pl/intro.txt
deleted file mode 100644
index a6986aafc..000000000
--- a/lib/plugins/acl/lang/pl/intro.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-====== Zarządzanie uprawnieniami ======
-
-Tutaj możesz zmieniać uprawnienia do aktualnej strony i wszystkich
-[[doku>wiki:namespaces|katalogów]], w który ona się znajduje.
-Aby dowiedzieć się więcej na temat uprawnień, przeczytaj
-[[doku>wiki:acl|oficjalną dokumentację mechanizmu uprawnień]].
-
-Poniżej znajdują się uprawnienia dla aktualnej strony.
-Uprawnienia dotyczące innych stron zostały pominięte, aby je zmienić najpierw
-[[this>doku.php?do=index|wybierz]] inną stronę a potem przejdź do zarządzania
-uprawnieniami.
-
diff --git a/lib/plugins/acl/lang/pt-br/intro.txt b/lib/plugins/acl/lang/pt-br/intro.txt
deleted file mode 100644
index 209fded46..000000000
--- a/lib/plugins/acl/lang/pt-br/intro.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-====== Gerenciamento da Lista de Controle de Acesso (ACL) ======
-
-Nessa página você pode adicionar e remover permissões para a página atual e todos os [[doku>wiki:namespaces|namespaces]] onde ela se encontra. Para compreender melhor o funcionamento das ACLs, você pode consultar a [[doku>wiki:acl|documentação oficial]].
-
-Aqui você encontra todas as permissões que são significantes para a página atual. Permissões relativas às outras páginas não são mostradas - para editá-las, navegue até a página desejada e entre novamente a administração das ACLs. \ No newline at end of file
diff --git a/lib/plugins/acl/lang/pt-br/lang.php b/lib/plugins/acl/lang/pt-br/lang.php
index 496deed9c..b9e54615b 100644
--- a/lib/plugins/acl/lang/pt-br/lang.php
+++ b/lib/plugins/acl/lang/pt-br/lang.php
@@ -3,19 +3,20 @@
* Brazilian Portuguese language file
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
- * @author Luis Fernando Enciso <lfenciso@certto.com.br>
- * @author Alauton/Loug
- * @author Frederico Gonçalves Guimarães <frederico@teia.bio.br>
+ * @author Luis Fernando Enciso <lfenciso@certto.com.br>
+ * @author Alauton/Loug
*/
-$lang['admin_acl'] = 'Administração da Lista de Controles de Acesso (ACL)';
-$lang['acl_group'] = 'Grupo';
-$lang['acl_user'] = 'Usuário';
-$lang['acl_perms'] = 'Permissões para';
-$lang['page'] = 'Página';
-$lang['namespace'] = 'Prefixo';
-$lang['acl_perm1'] = 'Ler';
-$lang['acl_perm2'] = 'Editar';
-$lang['acl_perm4'] = 'Criar';
-$lang['acl_perm8'] = 'Upload';
-$lang['acl_perm16'] = 'Deletar';
-$lang['acl_new'] = 'Adicionar nova entrada';
+
+$lang['admin_acl'] = 'Administrar a Lista de Controles de Acesso';
+$lang['acl_group'] = 'Grupo';
+$lang['acl_user'] = 'Usuário';
+$lang['acl_perms'] = 'Permissões para';
+$lang['page'] = 'Página';
+$lang['namespace'] = 'Prefixo';
+
+$lang['acl_perm1'] = 'Ler';
+$lang['acl_perm2'] = 'Editar';
+$lang['acl_perm4'] = 'Criar';
+$lang['acl_perm8'] = 'Upload';
+$lang['acl_perm16'] = 'Deletar';
+$lang['acl_new'] = 'Adicionar nova entrada';
diff --git a/lib/plugins/acl/lang/pt/intro.txt b/lib/plugins/acl/lang/pt/intro.txt
deleted file mode 100644
index ebb3ce8e1..000000000
--- a/lib/plugins/acl/lang/pt/intro.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-====== Gestão de Access Control List (ACL) ======
-
-Aqui pode adicionar, remover ou modificar as permissões que têm significado em relação ao documento actual e a todos os grupos (//namespaces//) aos quais o documento pertence. As permissões de outros documentos não são mostradas. Para gerir as permissões de outros documentos precisa primeiro de [[this>doku.php?do=index | "navegar"]] até ao documento em questão e só depois de clicar no botão [Gerir] é que as poderá editar.
-
-**Nota**: para melhor entender e saber como funciona as ACLs no DokuWiki deve ler a [[doku>wiki:acl | documentação oficial sobre ACL]], que existe no site oficial do DokuWiki.
-
-----
diff --git a/lib/plugins/acl/lang/ru/intro.txt b/lib/plugins/acl/lang/ru/intro.txt
deleted file mode 100644
index ba04e33be..000000000
--- a/lib/plugins/acl/lang/ru/intro.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-====== Управление списками контроля доступа ======
-
-Здесь Вы можете разрешить или запретить доступ к текущей странице и ко всем [[doku>wiki:namespaces|пространствам имен]], в которых она находится. Необходимо прочитать [[doku>wiki:acl|официальную документацию по ACL]] для полного понимания того, как применяются списки контроля доступа.
-
-Ниже отображены все права доступа, относящиеся к текущей странице. Права доступа для других страниц не показаны -- для того, чтобы редактировать их, [[this>doku.php?do=index|перейдите]] на соответствующую страницу и выберите "Управление списками контроля доступа".
-
diff --git a/lib/plugins/acl/lang/ru/lang.php b/lib/plugins/acl/lang/ru/lang.php
index 7cca48d10..e598eba36 100644
--- a/lib/plugins/acl/lang/ru/lang.php
+++ b/lib/plugins/acl/lang/ru/lang.php
@@ -3,18 +3,21 @@
* Russian language file
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
- * @author Denis Simakov <akinoame1@gmail.com>
- * @author Andrew Pleshakov <beotiger@mail.ru>
+ * @author Denis Simakov <akinoame1@gmail.com>
*/
-$lang['admin_acl'] = 'Управление списками контроля доступа';
-$lang['acl_group'] = 'Группа';
-$lang['acl_user'] = 'Пользователь';
-$lang['acl_perms'] = 'Права доступа для';
-$lang['page'] = 'Страница';
-$lang['namespace'] = 'Пространство имен';
-$lang['acl_perm1'] = 'Чтение';
-$lang['acl_perm2'] = 'Правка';
-$lang['acl_perm4'] = 'Создание';
-$lang['acl_perm8'] = 'Загрузка файлов';
-$lang['acl_perm16'] = 'Удаление';
-$lang['acl_new'] = 'Добавить новую запись';
+
+$lang['admin_acl'] = 'Управление списками контроля доступа';
+$lang['acl_group'] = 'Группа';
+$lang['acl_user'] = 'Пользователь';
+$lang['acl_perms'] = 'Права доступа для';
+$lang['page'] = 'Страница';
+$lang['namespace'] = 'Пространство имен';
+
+$lang['acl_perm1'] = 'Чтение';
+$lang['acl_perm2'] = 'Правка';
+$lang['acl_perm4'] = 'Создание';
+$lang['acl_perm8'] = 'Загрузка файлов';
+$lang['acl_perm16'] = 'Удаление';
+$lang['acl_new'] = 'Добавить новую запись';
+
+//Setup VIM: ex: et ts=2 enc=utf-8 :
diff --git a/lib/plugins/acl/lang/sk/intro.txt b/lib/plugins/acl/lang/sk/intro.txt
deleted file mode 100644
index 0e81835d7..000000000
--- a/lib/plugins/acl/lang/sk/intro.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-====== Správa prístupových práv (ACL) ======
-
-Na tejto stránke môžete pridať a odobrať oprávnenia pre aktuálnu stránku a všetky [[doku>wiki:namespaces|menné priestory]] v nej. Môžete si prečítať [[doku>wiki:acl|oficiálnu dokumentáciu k ACL]] pre plné porozumenie tomu, ako kontrola prístupu pracuje.
-
-Stránka ukazuje všetky oprávnenia, ktoré sa vzťahujú na aktuálnu stránku. Oprávnenia týkajúce sa iných stránok nie sú zobrazené -- pre ich zmenu [[this>doku.php?do=index|nalistujte]] príslušnú stránku a potom sa prepnite do Administrácie ACL.
-
-
diff --git a/lib/plugins/acl/lang/sr/intro.txt b/lib/plugins/acl/lang/sr/intro.txt
deleted file mode 100644
index 488fa0cf8..000000000
--- a/lib/plugins/acl/lang/sr/intro.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-====== Управљање листом контроле приступа ======
-
-На овој страници можете да додате или избришете дозволе за тренутну страницу и све [[doku>wiki:namespaces|именске просторе]] у којима је она. Требало би да прочитате [[doku>wiki:acl|официјелну документациу о листама контроле приступа]] да бисте у потпуности схватили како оне раде.
-
-Страница приказује све дозволе које су значајне за тренутну страницу. Дозволе
-за друге странице нису приказане -- да би их изменили, прво
-[[this>doku.php?do=index|идите]] до одговарајуће странице, а тек онда пређите
-на администрацију.
-
-
diff --git a/lib/plugins/acl/lang/sv/intro.txt b/lib/plugins/acl/lang/sv/intro.txt
deleted file mode 100644
index 428d14da6..000000000
--- a/lib/plugins/acl/lang/sv/intro.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-====== Hantera behörighetslistan (ACL) ======
-
-//ACL betyder "Access Control List" och är en grundläggande term som man
-behöver känna till för att hänga med i den engelska dokumentationen.//
-
-På den här sidan kan man lägga till och ta bort behörigheter för den aktuella
-sidan och alla [[doku>wiki:namespaces|namnrymder]] den ingår i.
-Man bör läsa den [[doku>wiki:acl|officiella dokumentationen om ACL]]
-för att fullt ut förstår hur behörigheter fungerar.
-
-Den här sidan visar alla behörigheter som är meningsfulla för den aktuella
-sidan. Behörigheter för andra sidor visas inte -- för att ändra deras
-behörigheter, [[this>doku.php?do=index|gå till sidan]] och välj därefter
-att hantera behörighetslistan.
-
diff --git a/lib/plugins/acl/lang/tr/intro.txt b/lib/plugins/acl/lang/tr/intro.txt
deleted file mode 100644
index 6897255e8..000000000
--- a/lib/plugins/acl/lang/tr/intro.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-====== Erişim Kontrol Listesi(ACL) Yönetimi ======
-
-Bu sayfada bu sayfa ve içindeki tüm
-[[doku>wiki:namespaces|isim alanları]] için yetkiler ekleyebilirsin.
-[[doku>wiki:acl|EKL(ACL) resmi dokümantasyonu]]'nu okuyarak EKL'nin
-nasıl işlediğini tam olarak anlayabilirsin (İngilizce).
-
-Sayfada bu sayfa ile ilgili tüm yetkiler sıralanmaktadır. Başka
-sayfalarla ilgili yetkiler gösterilmemiştir, onları değiştirmek için
-önce o sayfaya [[this>doku.php?do=index|git]], sonra EKL yönetimine
-geçiş yap.
-
diff --git a/lib/plugins/acl/lang/uk/intro.txt b/lib/plugins/acl/lang/uk/intro.txt
deleted file mode 100644
index 5db79cc3b..000000000
--- a/lib/plugins/acl/lang/uk/intro.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-====== Керування списками контролю доступа ======
-
-На цій сторінці ви можете дозволити та заборонити доступ до поточної сторінки
-або до [[doku>wiki:namespaces|просторів імен]], в яких вона знаходиться.
-Необхідно прочитати [[doku>wiki:acl|офіційну документацію]], щоб мати уяву
-що таки списки контролю доступу (ACL), та як їх використовувати.
-
-На сторінці показані всі права доступу для поточної сторінки. Права доступу для
-інших сторінок не вказані. Щоб їх редашувати [[this>doku.php?do=index|перейдіть]]
-до відповідної сторінки, а потім переключіться на керування ACL.
-
diff --git a/lib/plugins/acl/lang/vi/intro.txt b/lib/plugins/acl/lang/vi/intro.txt
deleted file mode 100644
index 4111acadf..000000000
--- a/lib/plugins/acl/lang/vi/intro.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-====== Quản lý phép truy nhập {Access Control List (ACL)} ======
-
-Trên trang này, bạn có thể thêm và xoá phép truy nhập cho trang đương thời
-và những [[doku>wiki:namespaces|không gian tên]] thuộc về trang.
-Bạn nên đọc [[doku>wiki:acl|tài liệu chính thức về ACL]]
-để hiểu kỷ về việc kiểm soát truy nhập {access control}.
-
-Sau đây là những phép truy nhập đáng kể cho trang đương thời.
-Phép truy nhập cho những trang khác không hiện lên đây --
-có thể biên soạn bằng cách [[this>doku.php?do=index|đến]]
-trước vào phần tính chất của trang,
-rồi sang phần Quản lý phép truy nhập.
-
diff --git a/lib/plugins/acl/lang/zh-tw/intro.txt b/lib/plugins/acl/lang/zh-tw/intro.txt
deleted file mode 100644
index 1875dea0a..000000000
--- a/lib/plugins/acl/lang/zh-tw/intro.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-====== 設定權限控制清單(ACL) ======
-
-在此可對目前頁面以及該頁所屬的 [[doku>wiki:zh_TW_namespaces|namespaces]] 來作新增或移除權限,\\
-另外,可查閱 [[doku>wiki:acl|官網有關 ACL 的說明]] 以徹底了解權限控制的運作方式。
-
-這裡只顯示所有有關本頁面的權限設定,而不包括不相關的其他頁面權限設定。\\
-– 也就是說,若要修改其他頁面的話,\\
-請先看 [[this>doku.php?do=index|整體 wiki 目錄架構這邊]] ,然後來修改它們的 ACL 權限管理設定。
-
diff --git a/lib/plugins/acl/lang/zh/intro.txt b/lib/plugins/acl/lang/zh/intro.txt
deleted file mode 100644
index 78ce9d8cc..000000000
--- a/lib/plugins/acl/lang/zh/intro.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-====== 访问控制列表(ACL)管理器 ======
-
-本页中您能够添加或移除当前页面或其在所有 [[doku>wiki:namespaces|命名空间]] 中的相关访问权限。
-您应该先阅读 [[doku>wiki:acl|ACL 的官方文档]] 以理解访问控制是如何实现的。
-
-本页显示了针对当前页面的所有访问权限。针对其他页面的权限并没有显示 -- 要编辑其他页面的访问权限,请先 [[this>doku.php?do=index|浏览]] 相关页面,然后再更改 ACL 权限控制。
-
diff --git a/lib/plugins/acl/script.js b/lib/plugins/acl/script.js
new file mode 100644
index 000000000..228b1e5c4
--- /dev/null
+++ b/lib/plugins/acl/script.js
@@ -0,0 +1,159 @@
+acl = {
+ init: function(){
+ this.ctl = $('acl_manager');
+ if(!this.ctl) return;
+
+ var sel = $('acl__user').getElementsByTagName('select')[0];
+
+ addEvent(sel,'change',acl.userselhandler);
+ addEvent($('acl__tree'),'click',acl.treehandler);
+ addEvent($('acl__user').getElementsByTagName('input')[1],'click',acl.loadinfo);
+ addEvent($('acl__user').getElementsByTagName('input')[1],'keypress',acl.loadinfo);
+ },
+
+
+ /**
+ * Handle user dropdown
+ */
+ userselhandler: function(e){
+ // make entry field visible/invisible
+ if(this.value == '__g__' || this.value == '__u__'){
+ $('acl__user').getElementsByTagName('input')[0].style.display = ''; //acl_w
+ $('acl__user').getElementsByTagName('input')[1].style.display = ''; //submit
+ }else{
+ $('acl__user').getElementsByTagName('input')[0].style.display = 'none';
+ $('acl__user').getElementsByTagName('input')[1].style.display = 'none';
+ }
+
+ acl.loadinfo();
+ },
+
+ /**
+ * Load the current permission info and edit form
+ *
+ * @param frm - Form element with needed data
+ */
+ loadinfo: function(){
+ // get form
+ var frm = $('acl__detail').getElementsByTagName('form')[0];
+
+ // prepare an AJAX call
+ var ajax = new sack(DOKU_BASE + 'lib/plugins/acl/ajax.php');
+ ajax.AjaxFailedAlert = '';
+ ajax.encodeURIString = false;
+ if(ajax.failed) return true;
+
+ // prepare data
+ var data = Array();
+ data[0] = ajax.encVar('ns',frm.elements['ns'].value);
+ data[1] = ajax.encVar('id',frm.elements['id'].value);
+ data[2] = ajax.encVar('acl_t',frm.elements['acl_t'].value);
+ data[3] = ajax.encVar('acl_w',frm.elements['acl_w'].value);
+ data[4] = ajax.encVar('ajax','info');
+
+ ajax.elementObj = $('acl__info');
+
+ ajax.runAJAX(data.join('&'));
+ return false;
+ },
+
+ /**
+ * parse URL attributes into a associative array
+ *
+ * @todo put into global script lib?
+ */
+ parseatt: function(str){
+ if(str[0] == '?') str = str.substr(1);
+ var attributes = {};
+ var all = str.split('&');
+ for(var i=0; i<all.length; i++){
+ var att = all[i].split('=');
+ attributes[att[0]] = decodeURIComponent(att[1]);
+ }
+ return attributes;
+ },
+
+ /**
+ * htmlspecialchars equivalent
+ *
+ * @todo put in gloabl scripts lib?
+ */
+ hsc: function(str) {
+ str = str.replace(/&/g,"&amp;");
+ str = str.replace(/\"/g,"&quot;");
+ str = str.replace(/\'/g,"&#039;");
+ str = str.replace(/</g,"&lt;");
+ str = str.replace(/>/g,"&gt;");
+ return str;
+ },
+
+
+ /**
+ * Open or close a subtree using AJAX
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+ treetoggle: function(clicky){
+ var listitem = clicky.parentNode.parentNode;
+
+ // if already open, close by removing the sublist
+ var sublists = listitem.getElementsByTagName('ul');
+ if(sublists.length){
+ listitem.removeChild(sublists[0]);
+ clicky.src = DOKU_BASE+'lib/images/plus.gif';
+ clicky.alt = '+';
+ return false;
+ }
+
+ // get the enclosed link (is always the first one)
+ var link = listitem.getElementsByTagName('a')[0];
+
+ // prepare an AJAX call to fetch the subtree
+ var ajax = new sack(DOKU_BASE + 'lib/plugins/acl/ajax.php');
+ ajax.AjaxFailedAlert = '';
+ ajax.encodeURIString = false;
+ if(ajax.failed) return true;
+
+ //prepare the new ul
+ var ul = document.createElement('ul');
+ listitem.appendChild(ul);
+ ajax.elementObj = ul;
+ ajax.runAJAX(link.search.substr(1)+'&ajax=tree');
+ clicky.src = DOKU_BASE+'lib/images/minus.gif';
+ return false;
+ },
+
+
+ treehandler: function(e){
+ if(e.target.href){ // is it a link?
+ // remove highlighting
+ var obj = getElementsByClass('cur',$('acl__tree'),'a')[0];
+ if(obj) obj.className = obj.className.replace(/ cur/,'');
+
+ // add new highlighting
+ e.target.className += ' cur';
+
+ // set new page to detail form
+ var frm = $('acl__detail').getElementsByTagName('form')[0];
+ if(e.target.className.search(/wikilink1/) > -1){
+ frm.elements['ns'].value = '';
+ frm.elements['id'].value = acl.hsc(acl.parseatt(e.target.search)['id']);
+ }else if(e.target.className.search(/idx_dir/) > -1){
+ frm.elements['ns'].value = acl.hsc(acl.parseatt(e.target.search)['ns']);
+ frm.elements['id'].value = '';
+ }
+
+ acl.loadinfo();
+ }else if(e.target.src){ // is it an image?
+console.log('its an image');
+ acl.treetoggle(e.target);
+ }
+
+ e.stopPropagation();
+ e.preventDefault();
+ return false;
+ }
+
+};
+
+addInitEvent(acl.init);
diff --git a/lib/plugins/acl/style.css b/lib/plugins/acl/style.css
index b9972718b..32b91dd8c 100644
--- a/lib/plugins/acl/style.css
+++ b/lib/plugins/acl/style.css
@@ -1,9 +1,96 @@
-#acl__manager label {
+
+div#acl_manager div#acl__tree {
+ font-size: 90%;
+ width: 25%;
+ height: 300px;
+ float: left;
+ overflow: auto;
+ border: 1px solid __border__;
+ text-align: left;
+}
+
+div#acl_manager div#acl__tree a.cur {
+ background-color: __highlight__;
+ font-weight: bold;
+}
+
+div#acl_manager div#acl__tree ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+}
+
+div#acl_manager div#acl__tree li {
+ padding-left: 1em;
+}
+
+div#acl_manager div#acl__tree ul img {
+ margin-right: 0.25em;
+}
+
+div#acl_manager div#acl__detail {
+ width: 73%;
+ height: 300px;
+ float: left;
+ overflow: auto;
+ padding-left: 1em;
+}
+
+div#acl_manager div#acl__detail fieldset {
+ width: 90%;
+}
+
+div#acl_manager div#acl__detail div#acl__user {
+ border: 1px solid __border__;
+ padding: 0.5em;
+ margin-bottom: 0.6em;
+}
+
+div#acl_manager table.inline {
+ width: 100%;
+ margin: 0;
+}
+
+div#acl_manager .aclgroup {
+ background: transparent url(pix/group.png) 0px 1px no-repeat;
+ padding: 1px 0px 1px 18px;
+}
+
+div#acl_manager .acluser {
+ background: transparent url(pix/user.png) 0px 1px no-repeat;
+ padding: 1px 0px 1px 18px;
+}
+
+div#acl_manager .aclpage {
+ background: transparent url(pix/page.png) 0px 1px no-repeat;
+ padding: 1px 0px 1px 18px;
+}
+
+div#acl_manager .aclns {
+ background: transparent url(pix/ns.png) 0px 1px no-repeat;
+ padding: 1px 0px 1px 18px;
+}
+
+div#acl_manager label.disabled {
+ color: __text_neu__!important;
+}
+
+#acl_manager label {
text-align: left;
font-weight: normal;
display: inline;
}
-#acl__manager table {
+
+#acl_manager table {
margin-left: 10%;
width: 80%;
}
+
+#acl_manager table tr {
+ background-color: inherit;
+}
+
+#acl_manager table tr:hover {
+ background-color: __background_alt__;
+}
+