Lines Matching +full:select +full:- +full:user +full:- +full:groups -(+path:inc +path:lang) -(+path:lib +path:plugins +path:lang) -(+path:lib +path:tpl +path:dokuwiki +path:lang)

41         return $this->getLang('admin_acl');
53 * handle user request
71 if ($INPUT->str('ns') == '*') {
72 $this->ns = '*';
74 $this->ns = cleanID($INPUT->str('ns'));
77 if ($INPUT->str('current_ns')) {
78 $this->current_item = ['id' => cleanID($INPUT->str('current_ns')), 'type' => 'd'];
79 } elseif ($INPUT->str('current_id')) {
80 $this->current_item = ['id' => cleanID($INPUT->str('current_id')), 'type' => 'f'];
81 } elseif ($this->ns) {
82 $this->current_item = ['id' => $this->ns, 'type' => 'd'];
84 $this->current_item = ['id' => $ID, 'type' => 'f'];
87 // user or group choosen?
88 $who = trim($INPUT->str('acl_w'));
89 if ($INPUT->str('acl_t') == '__g__' && $who) {
90 $this->who = '@' . ltrim($auth->cleanGroup($who), '@');
91 } elseif ($INPUT->str('acl_t') == '__u__' && $who) {
92 $this->who = ltrim($who, '@');
93 if ($this->who != '%USER%' && $this->who != '%GROUP%') { #keep wildcard as is
94 $this->who = $auth->cleanUser($this->who);
97 $INPUT->str('acl_t') &&
98 $INPUT->str('acl_t') != '__u__' &&
99 $INPUT->str('acl_t') != '__g__'
101 $this->who = $INPUT->str('acl_t');
103 $this->who = $who;
107 if ($INPUT->has('cmd') && checkSecurityToken()) {
108 $cmd = $INPUT->extract('cmd')->str('cmd');
111 if ($this->ns) {
112 if ($this->ns == '*') {
115 $scope = $this->ns . ':*';
121 if ($cmd == 'save' && $scope && $this->who && $INPUT->has('acl')) {
123 $this->deleteACL($scope, $this->who);
124 $this->addOrUpdateACL($scope, $this->who, $INPUT->int('acl'));
125 } elseif ($cmd == 'del' && $scope && $this->who) {
127 $this->deleteACL($scope, $this->who);
129 $acl = $INPUT->arr('acl');
132 foreach ($INPUT->arr('del') as $where => $names) {
147 // re-add all rules
152 $who = '@' . ltrim($auth->cleanGroup($who), '@');
154 } elseif ($who != '%USER%' && $who != '%GROUP%') { #keep wildcard as is
155 $who = $auth->cleanUser($who);
170 $this->initAclConfig();
185 echo '<h1>' . $this->getLang('admin_acl') . '</h1>';
189 $this->makeExplorer();
193 $this->printDetail();
198 echo '<h2>' . $this->getLang('current') . '</h2>';
200 $this->printAclTable();
205 echo '<div class="content">' . $this->getLang('p_include') . '</div>';
219 if ($this->ns) $opts['ns'] = $this->ns;
220 if ($this->who) $opts['acl_w'] = $this->who;
227 * Display a tree menu to select a page or namespace
237 $ns = $this->ns;
246 $data = $this->makeTree($ns);
290 if ($data[$i - 1]['id'] == $data[$i]['id'] && $data[$i - 1]['type'] == $data[$i]['type']) {
306 if ($a['id'] == '') return -1;
314 // until a non-equal component is found
321 if ($b_ids === [] && $b['type'] == 'f' && (count($a_ids) || $a['type'] == 'd')) return -1;
330 return -1;
336 if ($a_ids === []) return ($a['type'] == 'd') ? -1 : 1;
337 if ($b_ids === []) return ($b['type'] == 'd') ? 1 : -1;
351 echo '<form action="' . wl() . '" method="post" accept-charset="utf-8"><div class="no">';
354 echo $this->getLang('acl_perms') . ' ';
355 $inl = $this->makeSelect();
358 ($inl) ? '' : hsc(ltrim($this->who, '@'))
360 echo '<button type="submit">' . $this->getLang('btn_select') . '</button>';
364 $this->printInfo();
367 echo '<input type="hidden" name="ns" value="' . hsc($this->ns) . '" />';
384 if ($this->who) {
385 $current = $this->getExactPermisson();
388 $this->printExplanation($current);
390 $this->printAclEditor($current);
393 if ($this->ns) {
394 printf($this->getLang('p_choose_ns'), hsc($this->ns));
396 printf($this->getLang('p_choose_id'), hsc($ID));
400 echo $this->locale_xhtml('help');
415 echo '<legend>' . $this->getLang('acl_new') . '</legend>';
417 echo '<legend>' . $this->getLang('acl_mod') . '</legend>';
420 echo $this->makeCheckboxes($current, empty($this->ns), 'acl');
442 $who = $this->who;
443 $ns = $this->ns;
458 $user = '';
459 $groups = [ltrim($who, '@')];
461 $user = $who;
462 $info = $auth->getUserData($user);
464 $groups = [];
466 $groups = $info['grps'];
471 $perm = auth_aclcheck($check, $user, $groups);
477 if ($perm >= AUTH_DELETE) $names[] = $this->getLang('acl_perm16');
478 if ($perm >= AUTH_UPLOAD) $names[] = $this->getLang('acl_perm8');
479 if ($perm >= AUTH_CREATE) $names[] = $this->getLang('acl_perm4');
481 if ($perm >= AUTH_EDIT) $names[] = $this->getLang('acl_perm2');
482 if ($perm >= AUTH_READ) $names[] = $this->getLang('acl_perm1');
485 $names[] = $this->getLang('acl_perm0');
490 if ($user) {
492 printf($this->getLang('p_user_ns'), hsc($who), hsc($ns), implode(', ', $names));
494 printf($this->getLang('p_user_id'), hsc($who), hsc($ID), implode(', ', $names));
497 printf($this->getLang('p_group_ns'), hsc(ltrim($who, '@')), hsc($ns), implode(', ', $names));
499 printf($this->getLang('p_group_id'), hsc(ltrim($who, '@')), hsc($ID), implode(', ', $names));
505 echo '<p>' . $this->getLang('p_isadmin') . '</p>';
507 echo '<p>' . $this->getLang('p_inherited') . '</p>';
515 * User function for html_buildlist()
531 if (($item['type'] == $this->current_item['type'] && $item['id'] == $this->current_item['id'])) {
548 wl('', $this->getLinkOptions(['ns' => $item['id'], 'sectok' => getSecurityToken()])) .
554 wl('', $this->getLinkOptions(['id' => $item['id'], 'ns' => '', 'sectok' => getSecurityToken()])) .
587 // get special users and groups
588 $this->specials[] = '@ALL';
589 $this->specials[] = '@' . $conf['defaultgroup'];
591 $this->specials = array_merge(
592 $this->specials,
599 $this->specials = array_filter($this->specials);
600 $this->specials = array_unique($this->specials);
601 Sort::sort($this->specials);
608 //0 is pagename, 1 is user, 2 is acl
613 // store non-special users and groups for later selection dialog
615 if (in_array($ug, $this->specials)) continue;
626 $this->acl = $acl_config;
627 $this->usersgroups = $usersgroups;
640 echo '<form action="' . wl() . '" method="post" accept-charset="utf-8"><div class="no">';
641 if ($this->ns) {
642 echo '<input type="hidden" name="ns" value="' . hsc($this->ns) . '" />';
646 echo '<input type="hidden" name="acl_w" value="' . hsc($this->who) . '" />';
653 echo '<th>' . $this->getLang('where') . '</th>';
654 echo '<th>' . $this->getLang('who') . '</th>';
655 echo '<th>' . $this->getLang('perm') . '<sup><a id="fnt__1" class="fn_top" href="#fn__1">1)</a></sup></th>';
658 foreach ($this->acl as $where => $set) {
680 echo $this->makeCheckboxes($perm, $ispage, 'acl[' . $where . '][' . $who . ']');
701 * Returns the permission which were set for exactly the given user/group
709 if ($this->ns) {
710 if ($this->ns == '*') {
713 $check = $this->ns . ':*';
719 if (isset($this->acl[$check][$this->who])) {
720 return $this->acl[$check][$this->who];
727 * adds new acl-entry to conf/acl.auth.php
735 // first make sure we won't end up with 2 lines matching this user and scope. See issue #1115
736 $this->deleteACL($acl_scope, $acl_user);
750 * remove acl-entry from conf/acl.auth.php
759 $acl_pattern = '^' . preg_quote($acl_scope, '/') . '[ \t]+' . $acl_user . '[ \t]+[0-8].*$';
801 $ret .= $this->getLang('acl_perm' . $perm);
808 * Print a user/group selector (reusing already used users and groups)
819 $this->who &&
820 !in_array($this->who, $this->usersgroups) &&
821 !in_array($this->who, $this->specials)
823 if ($this->who[0] == '@') {
832 echo '<select name="acl_t" class="edit">';
833 echo ' <option value="__g__" class="aclgroup"' . $gsel . '>' . $this->getLang('acl_group') . '</option>';
834 echo ' <option value="__u__" class="acluser"' . $usel . '>' . $this->getLang('acl_user') . '</option>';
835 if (!empty($this->specials)) {
837 foreach ($this->specials as $ug) {
838 if ($ug == $this->who) {
853 if (!empty($this->usersgroups)) {
855 foreach ($this->usersgroups as $ug) {
856 if ($ug == $this->who) {
871 echo '</select>';