summaryrefslogtreecommitdiff
path: root/lib/plugins/acl
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-11-08 23:15:08 +0100
committerAndreas Gohr <andi@splitbrain.org>2012-11-08 23:15:08 +0100
commit04924b7a9d090c0814cfff3e6706263e4d5a46e8 (patch)
treed83fc6b5683fbc9c639bfd1832f96dca2f3c8646 /lib/plugins/acl
parent1ea7a6bada66fc9b7a45f61b4892e4ea23196d89 (diff)
parenta731ed1d6736ca405b3559adfd9500affcc59412 (diff)
downloadrpg-04924b7a9d090c0814cfff3e6706263e4d5a46e8.tar.gz
rpg-04924b7a9d090c0814cfff3e6706263e4d5a46e8.tar.bz2
Merge branch 'master' into proxyconnect
* master: (169 commits) added PCRE UTF-8 checks to do=check FS#2636 avoid multiple paralell update checks fix regression bug in HTTPClient FS#2621 changed PAGEUTILS_ID_HIDEPAGE to has BEFORE/AFTER TarLib code cleanup TarLib: fixed appending in non-dynamic mode fixed third method of adding files in TarLib fix lone zero block in TarLib created archives fix use of constructor in TarLib Slovak language update Korean language update Latvian language update added event PAGEUTILS_ID_HIDEPAGE added test for isHiddenPage() removed redundant variables in tpl_include_page() (because of 3ff8773b) added cut off points for mobile devices as parameters to style.ini Corrected typo: ruke -> rule Persian language update Spanish language update russian language update ...
Diffstat (limited to 'lib/plugins/acl')
-rw-r--r--lib/plugins/acl/admin.php56
-rw-r--r--lib/plugins/acl/ajax.php11
-rw-r--r--lib/plugins/acl/lang/es/lang.php2
-rw-r--r--lib/plugins/acl/lang/eu/lang.php1
-rw-r--r--lib/plugins/acl/lang/fa/lang.php1
-rw-r--r--lib/plugins/acl/lang/fr/lang.php1
-rw-r--r--lib/plugins/acl/lang/it/lang.php1
-rw-r--r--lib/plugins/acl/lang/kk/lang.php4
-rw-r--r--lib/plugins/acl/lang/ko/help.txt2
-rw-r--r--lib/plugins/acl/lang/ko/lang.php2
-rw-r--r--lib/plugins/acl/lang/nl/lang.php1
-rw-r--r--lib/plugins/acl/lang/zh-tw/help.txt5
-rw-r--r--lib/plugins/acl/lang/zh-tw/lang.php15
-rw-r--r--lib/plugins/acl/plugin.info.txt3
-rw-r--r--lib/plugins/acl/style.css12
15 files changed, 74 insertions, 43 deletions
diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php
index a0d2e430e..1197892f2 100644
--- a/lib/plugins/acl/admin.php
+++ b/lib/plugins/acl/admin.php
@@ -56,22 +56,23 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
global $ID;
global $auth;
global $config_cascade;
+ global $INPUT;
// fresh 1:1 copy without replacements
$AUTH_ACL = file($config_cascade['acl']['default']);
// namespace given?
- if($_REQUEST['ns'] == '*'){
+ if($INPUT->str('ns') == '*'){
$this->ns = '*';
}else{
- $this->ns = cleanID($_REQUEST['ns']);
+ $this->ns = cleanID($INPUT->str('ns'));
}
- if ($_REQUEST['current_ns']) {
- $this->current_item = array('id' => cleanID($_REQUEST['current_ns']), 'type' => 'd');
- } elseif ($_REQUEST['current_id']) {
- $this->current_item = array('id' => cleanID($_REQUEST['current_id']), 'type' => 'f');
+ if ($INPUT->str('current_ns')) {
+ $this->current_item = array('id' => cleanID($INPUT->str('current_ns')), 'type' => 'd');
+ } elseif ($INPUT->str('current_id')) {
+ $this->current_item = array('id' => cleanID($INPUT->str('current_id')), 'type' => 'f');
} elseif ($this->ns) {
$this->current_item = array('id' => $this->ns, 'type' => 'd');
} else {
@@ -79,24 +80,25 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
}
// user or group choosen?
- $who = trim($_REQUEST['acl_w']);
- if($_REQUEST['acl_t'] == '__g__' && $who){
+ $who = trim($INPUT->str('acl_w'));
+ if($INPUT->str('acl_t') == '__g__' && $who){
$this->who = '@'.ltrim($auth->cleanGroup($who),'@');
- }elseif($_REQUEST['acl_t'] == '__u__' && $who){
+ }elseif($INPUT->str('acl_t') == '__u__' && $who){
$this->who = ltrim($who,'@');
if($this->who != '%USER%' && $this->who != '%GROUP%'){ #keep wildcard as is
$this->who = $auth->cleanUser($this->who);
}
- }elseif($_REQUEST['acl_t'] &&
- $_REQUEST['acl_t'] != '__u__' &&
- $_REQUEST['acl_t'] != '__g__'){
- $this->who = $_REQUEST['acl_t'];
+ }elseif($INPUT->str('acl_t') &&
+ $INPUT->str('acl_t') != '__u__' &&
+ $INPUT->str('acl_t') != '__g__'){
+ $this->who = $INPUT->str('acl_t');
}elseif($who){
$this->who = $who;
}
// handle modifications
- if(isset($_REQUEST['cmd']) && checkSecurityToken()){
+ if($INPUT->has('cmd') && checkSecurityToken()){
+ $cmd = $INPUT->extract('cmd')->str('cmd');
// scope for modifications
if($this->ns){
@@ -109,19 +111,21 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
$scope = $ID;
}
- if(isset($_REQUEST['cmd']['save']) && $scope && $this->who && isset($_REQUEST['acl'])){
+ if($cmd == 'save' && $scope && $this->who && $INPUT->has('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){
+ $this->_acl_add($scope, $this->who, $INPUT->int('acl'));
+ }elseif($cmd == 'del' && $scope && $this->who){
// handle single deletions
$this->_acl_del($scope, $this->who);
- }elseif(isset($_REQUEST['cmd']['update'])){
+ }elseif($cmd == 'update'){
+ $acl = $INPUT->arr('acl');
+
// handle update of the whole file
- foreach((array) $_REQUEST['del'] as $where => $names){
+ foreach($INPUT->arr('del') as $where => $names){
// remove all rules marked for deletion
foreach($names as $who)
- unset($_REQUEST['acl'][$where][$who]);
+ unset($acl[$where][$who]);
}
// prepare lines
$lines = array();
@@ -134,7 +138,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
}
}
// re-add all rules
- foreach((array) $_REQUEST['acl'] as $where => $opt){
+ foreach($acl as $where => $opt){
foreach($opt as $who => $perm){
if ($who[0]=='@') {
if ($who!='@ALL') {
@@ -191,7 +195,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
echo '</div>'.NL;
echo '<div class="footnotes"><div class="fn">'.NL;
- echo '<sup><a id="fn__1" class="fn_bot" name="fn__1" href="#fnt__1">1)</a></sup>'.NL;
+ echo '<sup><a id="fn__1" class="fn_bot" href="#fnt__1">1)</a></sup>'.NL;
echo $this->getLang('p_include');
echo '</div></div>';
@@ -602,7 +606,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
echo '<tr>';
echo '<th>'.$this->getLang('where').'</th>';
echo '<th>'.$this->getLang('who').'</th>';
- echo '<th>'.$this->getLang('perm').'<sup><a id="fnt__1" class="fn_top" name="fnt__1" href="#fn__1">1)</a></sup></th>';
+ echo '<th>'.$this->getLang('perm').'<sup><a id="fnt__1" class="fn_top" href="#fn__1">1)</a></sup></th>';
echo '<th>'.$lang['btn_delete'].'</th>';
echo '</tr>';
foreach($this->acl as $where => $set){
@@ -630,7 +634,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
echo $this->_html_checkboxes($perm,$ispage,'acl['.$where.']['.$who.']');
echo '</td>';
- echo '<td align="center">';
+ echo '<td class="check">';
echo '<input type="checkbox" name="del['.hsc($where).'][]" value="'.hsc($who).'" />';
echo '</td>';
echo '</tr>';
@@ -638,7 +642,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
}
echo '<tr>';
- echo '<th align="right" colspan="4">';
+ echo '<th class="action" colspan="4">';
echo '<input type="submit" value="'.$lang['btn_update'].'" name="cmd[update]" class="button" />';
echo '</th>';
echo '</tr>';
@@ -746,7 +750,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
}
//build code
- $ret .= '<label for="pbox'.$label.'" title="'.$this->getLang('acl_perm'.$perm).'"'.$class.'>';
+ $ret .= '<label for="pbox'.$label.'"'.$class.'>';
$ret .= '<input '.buildAttributes($atts).' />&#160;';
$ret .= $this->getLang('acl_perm'.$perm);
$ret .= '</label>'.NL;
diff --git a/lib/plugins/acl/ajax.php b/lib/plugins/acl/ajax.php
index 3a5d89c08..10e18af97 100644
--- a/lib/plugins/acl/ajax.php
+++ b/lib/plugins/acl/ajax.php
@@ -11,6 +11,10 @@ require_once(DOKU_INC.'inc/init.php');
//close session
session_write_close();
+global $conf;
+global $ID;
+global $INPUT;
+
//fix for Opera XMLHttpRequests
$postData = http_get_raw_post_data();
if(!count($_POST) && !empty($postData)){
@@ -22,20 +26,19 @@ if(!checkSecurityToken()) die('CRSF Attack');
$ID = getID();
+/** @var $acl admin_plugin_acl */
$acl = plugin_load('admin','acl');
$acl->handle();
-$ajax = $_REQUEST['ajax'];
+$ajax = $INPUT->str('ajax');
header('Content-Type: text/html; charset=utf-8');
if($ajax == 'info'){
$acl->_html_info();
}elseif($ajax == 'tree'){
- global $conf;
- global $ID;
$dir = $conf['datadir'];
- $ns = $_REQUEST['ns'];
+ $ns = $INPUT->str('ns');
if($ns == '*'){
$ns ='';
}
diff --git a/lib/plugins/acl/lang/es/lang.php b/lib/plugins/acl/lang/es/lang.php
index ee50a7530..b60033e0f 100644
--- a/lib/plugins/acl/lang/es/lang.php
+++ b/lib/plugins/acl/lang/es/lang.php
@@ -22,6 +22,8 @@
* @author emezeta <emezeta@infoprimo.com>
* @author Oscar Ciudad <oscar@jacho.net>
* @author Ruben Figols <ruben.figols@gmail.com>
+ * @author Gerardo Zamudio <gerardo@gerardozamudio.net>
+ * @author Mercè López mercelz@gmail.com
*/
$lang['admin_acl'] = 'Administración de lista de control de acceso';
$lang['acl_group'] = 'Grupo';
diff --git a/lib/plugins/acl/lang/eu/lang.php b/lib/plugins/acl/lang/eu/lang.php
index 99e70ad00..b9285ff36 100644
--- a/lib/plugins/acl/lang/eu/lang.php
+++ b/lib/plugins/acl/lang/eu/lang.php
@@ -3,6 +3,7 @@
* Basque language file
*
* @author Inko Illarramendi <inko.i.a@gmail.com>
+ * @author Zigor Astarbe <astarbe@gmail.com>
*/
$lang['admin_acl'] = 'Atzipen Kontrol Listaren Kudeaketa';
$lang['acl_group'] = 'Taldea';
diff --git a/lib/plugins/acl/lang/fa/lang.php b/lib/plugins/acl/lang/fa/lang.php
index 8b7d72f51..7fe0f2c43 100644
--- a/lib/plugins/acl/lang/fa/lang.php
+++ b/lib/plugins/acl/lang/fa/lang.php
@@ -8,6 +8,7 @@
* @author Omid Mottaghi <omidmr@gmail.com>
* @author Mohammad Reza Shoaei <shoaei@gmail.com>
* @author Milad DZand <M.DastanZand@gmail.com>
+ * @author AmirH Hassaneini <mytechmix@gmail.com>
*/
$lang['admin_acl'] = 'مدیریت کنترل دسترسی‌ها';
$lang['acl_group'] = 'گروه';
diff --git a/lib/plugins/acl/lang/fr/lang.php b/lib/plugins/acl/lang/fr/lang.php
index 7db8ae4ac..b1b3188be 100644
--- a/lib/plugins/acl/lang/fr/lang.php
+++ b/lib/plugins/acl/lang/fr/lang.php
@@ -23,6 +23,7 @@
* @author schplurtz@laposte.net
* @author skimpax@gmail.com
* @author Yannick Aure <yannick.aure@gmail.com>
+ * @author Olivier DUVAL <zorky00@gmail.com>
*/
$lang['admin_acl'] = 'Gestion de la liste des contrôles d\'accès (ACL)';
$lang['acl_group'] = 'Groupe';
diff --git a/lib/plugins/acl/lang/it/lang.php b/lib/plugins/acl/lang/it/lang.php
index a55a2c0f3..07e86697d 100644
--- a/lib/plugins/acl/lang/it/lang.php
+++ b/lib/plugins/acl/lang/it/lang.php
@@ -14,6 +14,7 @@
* @author Osman Tekin osman.tekin93@hotmail.it
* @author Jacopo Corbetta <jacopo.corbetta@gmail.com>
* @author Matteo Pasotti <matteo@xquiet.eu>
+ * @author snarchio@gmail.com
*/
$lang['admin_acl'] = 'Gestione Lista Controllo Accessi (ACL)';
$lang['acl_group'] = 'Gruppo';
diff --git a/lib/plugins/acl/lang/kk/lang.php b/lib/plugins/acl/lang/kk/lang.php
index dde5b9577..f21b93132 100644
--- a/lib/plugins/acl/lang/kk/lang.php
+++ b/lib/plugins/acl/lang/kk/lang.php
@@ -4,3 +4,7 @@
*
* @author Nurgozha Kaliaskarov astana08@gmail.com
*/
+$lang['acl_group'] = 'Группа';
+$lang['acl_user'] = 'Пайдаланушы';
+$lang['page'] = 'Бет';
+$lang['acl_perm1'] = 'Оқу';
diff --git a/lib/plugins/acl/lang/ko/help.txt b/lib/plugins/acl/lang/ko/help.txt
index 377636682..6a15b7a2e 100644
--- a/lib/plugins/acl/lang/ko/help.txt
+++ b/lib/plugins/acl/lang/ko/help.txt
@@ -1,4 +1,4 @@
-=== 도움말: ===
+=== 빠른 도움말: ===
현재 문서에서 위키 이름공간과 문서에 대한 접근 권한을 추가하거나 삭제할 수 있습니다.
diff --git a/lib/plugins/acl/lang/ko/lang.php b/lib/plugins/acl/lang/ko/lang.php
index c8e1ce5cc..5d2662ef8 100644
--- a/lib/plugins/acl/lang/ko/lang.php
+++ b/lib/plugins/acl/lang/ko/lang.php
@@ -41,4 +41,4 @@ $lang['acl_perm4'] = '만들기';
$lang['acl_perm8'] = '올리기';
$lang['acl_perm16'] = '삭제';
$lang['acl_new'] = '새 항목 추가';
-$lang['acl_mod'] = '선택 항목 변경';
+$lang['acl_mod'] = '선택 항목 수정';
diff --git a/lib/plugins/acl/lang/nl/lang.php b/lib/plugins/acl/lang/nl/lang.php
index cb0765505..567eb46dc 100644
--- a/lib/plugins/acl/lang/nl/lang.php
+++ b/lib/plugins/acl/lang/nl/lang.php
@@ -18,6 +18,7 @@
* @author Timon Van Overveldt <timonvo@gmail.com>
* @author Jeroen
* @author Ricardo Guijt <ricardoguijt@gmail.com>
+ * @author Gerrit <klapinklapin@gmail.com>
*/
$lang['admin_acl'] = 'Toegangsrechten';
$lang['acl_group'] = 'Groep';
diff --git a/lib/plugins/acl/lang/zh-tw/help.txt b/lib/plugins/acl/lang/zh-tw/help.txt
index bc1bddb00..d5d031059 100644
--- a/lib/plugins/acl/lang/zh-tw/help.txt
+++ b/lib/plugins/acl/lang/zh-tw/help.txt
@@ -1,12 +1,11 @@
=== 快速指南: ===
-你可以用這個頁面為維基中的命名空間或頁面增加或移除權限。
+你可以用這個頁面為維基中的分類空間或頁面增加或移除權限。
-左方面板顯示了所有命名空間和頁面。
+左方面板顯示了所有分類空間和頁面。
上方表格允許你觀看及修改選取的使用者或群組的權限。
下方表格顯示了目前所有的存取控制表 (ACL),你可以用它快速刪除或更改多項規則。
閱讀 [[doku>acl|official documentation on ACL]] 可以幫助你完整地了解 DokuWiki 存取控制的運作。
-
diff --git a/lib/plugins/acl/lang/zh-tw/lang.php b/lib/plugins/acl/lang/zh-tw/lang.php
index 085537864..ff115df18 100644
--- a/lib/plugins/acl/lang/zh-tw/lang.php
+++ b/lib/plugins/acl/lang/zh-tw/lang.php
@@ -11,25 +11,26 @@
* @author Cheng-Wei Chien <e.cwchien@gmail.com>
* @author Danny Lin <danny0838@pchome.com.tw>
* @author Shuo-Ting Jian <shoting@gmail.com>
+ * @author syaoranhinata@gmail.com
*/
$lang['admin_acl'] = '管理存取控制表 (ACL)';
$lang['acl_group'] = '群組';
$lang['acl_user'] = '使用者';
$lang['acl_perms'] = '設定權限於';
$lang['page'] = '頁面';
-$lang['namespace'] = '命名空間';
+$lang['namespace'] = '分類空間';
$lang['btn_select'] = '選擇';
$lang['p_user_id'] = '使用者 <b class="acluser">%s</b> 目前在頁面 <b class="aclpage">%s</b> 擁有以下權限:<i>%s</i>。';
-$lang['p_user_ns'] = '使用者 <b class=\"acluser\">%s</b> 目前在命名空間 <b class=\"aclns\">%s</b> 擁有以下權限:<i>%s</i>。';
+$lang['p_user_ns'] = '使用者 <b class=\"acluser\">%s</b> 目前在分類空間 <b class=\"aclns\">%s</b> 擁有以下權限:<i>%s</i>。';
$lang['p_group_id'] = '群組 <b class="aclgroup">%s</b> 的成員目前在頁面 <b class="aclpage">%s</b> 擁有以下權限:<i>%s</i>。';
-$lang['p_group_ns'] = '群組 <b class=\"aclgroup\">%s</b> 的成員目前在命名空間 <b class=\"aclns\">%s</b> 擁有以下權限:<i>%s</i>。';
+$lang['p_group_ns'] = '群組 <b class=\"aclgroup\">%s</b> 的成員目前在分類空間 <b class=\"aclns\">%s</b> 擁有以下權限:<i>%s</i>。';
$lang['p_choose_id'] = '請在上方表格<b>輸入使用者或群組</b>以檢視或編輯頁面 <b class="aclpage">%s</b> 的權限設定。';
-$lang['p_choose_ns'] = '請在上方表格<b>輸入使用者或群組</b>以檢視或編輯命名空間 <b class=\"aclns\">%s</b> 的權限設定。';
-$lang['p_inherited'] = '注意:這些權限並未明確指定,而是從群組或上層的命名空間繼承而來。';
+$lang['p_choose_ns'] = '請在上方表格<b>輸入使用者或群組</b>以檢視或編輯分類空間 <b class=\"aclns\">%s</b> 的權限設定。';
+$lang['p_inherited'] = '注意:這些權限並未明確指定,而是從群組或上層的分類空間繼承而來。';
$lang['p_isadmin'] = '注意:選取的群組或使用者擁有完整權限,因為它被設定為超級使用者。';
-$lang['p_include'] = '較高的權限亦包含了較低的權限。新增、上傳與刪除權限只能設定在命名空間,不能設定在頁面。';
+$lang['p_include'] = '較高的權限亦包含了較低的權限。新增、上傳與刪除權限只能設定在分類空間,不能設定在頁面。';
$lang['current'] = '目前的存取控制規則';
-$lang['where'] = '頁面/命名空間';
+$lang['where'] = '頁面/分類空間';
$lang['who'] = '使用者/群組';
$lang['perm'] = '權限';
$lang['acl_perm0'] = '無';
diff --git a/lib/plugins/acl/plugin.info.txt b/lib/plugins/acl/plugin.info.txt
index f108a2390..42babd71c 100644
--- a/lib/plugins/acl/plugin.info.txt
+++ b/lib/plugins/acl/plugin.info.txt
@@ -1,6 +1,7 @@
+base acl
author Andreas Gohr
email andi@splitbrain.org
-date 2011-04-16
+date 2012-09-06
name ACL Manager
desc Manage Page Access Control Lists
url http://dokuwiki.org/plugin:acl
diff --git a/lib/plugins/acl/style.css b/lib/plugins/acl/style.css
index 2eee4f41c..f4277c341 100644
--- a/lib/plugins/acl/style.css
+++ b/lib/plugins/acl/style.css
@@ -67,6 +67,14 @@ div#acl_manager table.inline {
margin: 0;
}
+#acl_manager table .check {
+ text-align: center;
+}
+
+#acl_manager table .action {
+ text-align: right;
+}
+
div#acl_manager .aclgroup {
background: transparent url(pix/group.png) 0px 1px no-repeat;
padding: 1px 0px 1px 18px;
@@ -74,6 +82,7 @@ div#acl_manager .aclgroup {
[dir=rtl] div#acl_manager .aclgroup {
background: transparent url(pix/group.png) right 1px no-repeat;
padding: 1px 18px 1px 0px;
+ display: inline-block; /* needed for IE7 */
}
div#acl_manager .acluser {
@@ -83,6 +92,7 @@ div#acl_manager .acluser {
[dir=rtl] div#acl_manager .acluser {
background: transparent url(pix/user.png) right 1px no-repeat;
padding: 1px 18px 1px 0px;
+ display: inline-block; /* needed for IE7 */
}
div#acl_manager .aclpage {
@@ -92,6 +102,7 @@ div#acl_manager .aclpage {
[dir=rtl] div#acl_manager .aclpage {
background: transparent url(pix/page.png) right 1px no-repeat;
padding: 1px 18px 1px 0px;
+ display: inline-block; /* needed for IE7 */
}
div#acl_manager .aclns {
@@ -101,6 +112,7 @@ div#acl_manager .aclns {
[dir=rtl] div#acl_manager .aclns {
background: transparent url(pix/ns.png) right 1px no-repeat;
padding: 1px 18px 1px 0px;
+ display: inline-block; /* needed for IE7 */
}
div#acl_manager label.disabled {