X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=index.php;h=17240acffdd52721e427600539cb6f852143d700;hb=b923ce87e422780c66bc65d048e130e29f72109f;hp=33e7e9c0ce72bf1ec157f4250e7319d99c6c1038;hpb=703a14ab8d76fbef5915e44fe7fc1952b7d65052;p=contagged diff --git a/index.php b/index.php index 33e7e9c..17240ac 100644 --- a/index.php +++ b/index.php @@ -25,7 +25,7 @@ $list = ''; if(count($result)==1 && $_REQUEST['search']){ //only one result on a search -> display page - header("Location: entry.php?dn=".$result[0]['dn']); + header("Location: entry.php?dn=".rawurlencode($result[0]['dn'])); exit; }elseif(count($result)){ $keys = array_keys($result); @@ -48,8 +48,9 @@ $smarty->assign('org',$_REQUEST['org']); //display templates if(!empty($_REQUEST['export'])){ - if ($conf['userlogreq'] == 1 && $user == ''){ - header("HTTP/1.1 401 ACCESS DENIED"); + if ($conf['userlogreq'] && $user == ''){ + header("HTTP/1.1 401 Access Denied"); + echo '

Access Denied

'; exit(); } @@ -93,6 +94,7 @@ */ function _makeldapfilter(){ global $FIELDS; + global $conf; //handle given filter @@ -142,9 +144,14 @@ $words=preg_split('/\s+/',$search); $filter=''; foreach($words as $word){ - $filter .= '(|(|('.$FIELDS['name'].'=*'.$word.'*)('. - $FIELDS['givenname'].'=*'.$word.'*))('. - $FIELDS['organization'].'=*'.$word.'*))'; + $wordfilter=''; + foreach($conf['searchfields'] as $field) { + $wordfilter .= '('.$field.'=*'.$word.'*)'; + } + for($i=0; $i