summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/auth.php4
-rw-r--r--inc/init.php19
2 files changed, 20 insertions, 3 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!");
+ }
+ }
}
/**