summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 049d82c)
raw | patch | inline | side by side (parent: 049d82c)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Oct 2008 16:40:06 +0000 (16:40 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Oct 2008 16:40:06 +0000 (16:40 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12853 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_config.inc | patch | blob | history |
index ddb15d47c7c5854e15900c0aab028212f67ebfb8..900d5dbba44156ee2311823839a19902457ea4cc 100644 (file)
{
global $config;
$base = $config->current['BASE'];
+ $qbase = preg_quote($base, '/');
+ $utags= isset($config->current['HONOURUNITTAGS']) && preg_match('/true/i', $config->current['HONOURUNITTAGS']);
$arr = array();
$ui= get_userinfo();
foreach ($this->departments as $key => $val){
/* When using strict_units, filter non relevant parts */
- if (isset($config->current['HONOURUNITTAGS']) && preg_match('/true/i', $config->current['HONOURUNITTAGS'])){
- if ($ui->gosaUnitTag != "" && isset($this->tdepartments[$val]) &&
+ if ($utags){
+ if ($ui->gosaUnitTag != '' && isset($this->tdepartments[$val]) &&
$this->tdepartments[$val] != $ui->gosaUnitTag){
# continue;
}
}
- /* Split dn into single department pieces.
- */
- $elements = array_reverse(split(",",preg_replace("/".preg_quote($base, '/')."$/","",$val)));
+ /* Split dn into single department pieces */
+ $elements = array_reverse(split(',',preg_replace("/$qbase$/",'',$val)));
/* Add last ou element of current dn to our array */
$last = &$arr;
if(empty($ele)) continue;
/* Extract department name */
- $elestr = trim(preg_replace("/^[^=]*+=/","", $ele),",");
- $nameA = trim(preg_replace("/=.*$/","", $ele),",");
- if($nameA != "ou"){
- $nameA = " (".$nameA.")";
+ $elestr = trim(preg_replace('/^[^=]*+=/','', $ele),',');
+ $nameA = trim(preg_replace('/=.*$/','', $ele),',');
+ if($nameA != 'ou'){
+ $nameA = " ($nameA)";
}else{
- $nameA = "";
+ $nameA = '';
}
-
/* Add to array */
if($key == (count($elements)-1)){
$last[$elestr.$nameA]['ENTRY'] = $val;
/* Add base entry */
- $ret["/"]["ENTRY"] = $base;
- $ret["/"]["SUB"] = $arr;
+ $ret['/']['ENTRY'] = $base;
+ $ret['/']['SUB'] = $arr;
$this->idepartments= $this->generateDepartmentArray($ret,-1,$max_size);
}