summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGina Haeussge <gina@foosel.net>2010-06-26 13:29:02 +0200
committerGina Haeussge <gina@foosel.net>2010-06-26 13:29:02 +0200
commita992042bb4cc85fc90ec35a868ed14b3a3bfd7b7 (patch)
tree9f88ca6ecf0131b4f77a795951030b3bcdd9ed39
parent681a59b23795166231cfebc0da4d0d219d528795 (diff)
parent345b1674b60537d4a68bce48f7cc106b771051c7 (diff)
downloadrpg-a992042bb4cc85fc90ec35a868ed14b3a3bfd7b7.tar.gz
rpg-a992042bb4cc85fc90ec35a868ed14b3a3bfd7b7.tar.bz2
Merge branch 'master' of github.com:splitbrain/dokuwiki
-rw-r--r--inc/auth.php4
-rw-r--r--inc/init.php19
-rw-r--r--lib/plugins/acl/admin.php7
3 files changed, 25 insertions, 5 deletions
diff --git a/inc/auth.php b/inc/auth.php
index 70514316c..6a4108a7c 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -107,7 +107,6 @@ function auth_setup(){
//support user wildcard
if(isset($_SERVER['REMOTE_USER'])){
$AUTH_ACL = str_replace('%USER%',$_SERVER['REMOTE_USER'],$AUTH_ACL);
- $AUTH_ACL = str_replace('@USER@',$_SERVER['REMOTE_USER'],$AUTH_ACL); //legacy
}
}
}
@@ -569,6 +568,9 @@ function auth_nameencode($name,$skip_group=false){
$cache =& $cache_authname;
$name = (string) $name;
+ // never encode wildcard FS#1955
+ if($name == '%USER%') return $name;
+
if (!isset($cache[$name][$skip_group])) {
if($skip_group && $name{0} =='@'){
$cache[$name][$skip_group] = '@'.preg_replace('/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/e',
diff --git a/inc/init.php b/inc/init.php
index 20263f95a..9a3eaf9c9 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -304,8 +304,7 @@ function init_paths(){
function init_files(){
global $conf;
- $files = array( $conf['indexdir'].'/page.idx',
- $conf['indexdir'].'/title.idx');
+ $files = array($conf['indexdir'].'/page.idx');
foreach($files as $file){
if(!@file_exists($file)){
@@ -318,6 +317,22 @@ function init_files(){
}
}
}
+
+ # create title index (needs to have same length as page.idx)
+ $file = $conf['indexdir'].'/title.idx';
+ if(!@file_exists($file)){
+ $pages = file($conf['indexdir'].'/page.idx');
+ $pages = count($pages);
+ $fh = @fopen($file,'a');
+ if($fh){
+ for($i=0; $i<$pages; $i++){
+ fwrite($fh,"\n");
+ }
+ fclose($fh);
+ }else{
+ nice_die("$file is not writable. Check your permissions settings!");
+ }
+ }
}
/**
diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php
index 1f666660c..673ffbc96 100644
--- a/lib/plugins/acl/admin.php
+++ b/lib/plugins/acl/admin.php
@@ -96,7 +96,10 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
if($_REQUEST['acl_t'] == '__g__' && $who){
$this->who = '@'.ltrim($auth->cleanGroup($who),'@');
}elseif($_REQUEST['acl_t'] == '__u__' && $who){
- $this->who = ltrim($auth->cleanUser($who),'@');
+ $this->who = ltrim($who,'@');
+ if($this->who != '%USER%'){ #keep wildcard as is
+ $this->who = $auth->cleanUser($this->who);
+ }
}elseif($_REQUEST['acl_t'] &&
$_REQUEST['acl_t'] != '__u__' &&
$_REQUEST['acl_t'] != '__g__'){
@@ -150,7 +153,7 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
if ($who!='@ALL') {
$who = '@'.ltrim($auth->cleanGroup($who),'@');
}
- } else {
+ } elseif ($who != '%USER%'){ #keep wildcard as is
$who = $auth->cleanUser($who);
}
$who = auth_nameencode($who,true);