From: hickert Date: Fri, 26 Jan 2007 06:07:22 +0000 (+0000) Subject: Several winstation fixes from 2.5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a294d528e3ec69961da5bf920ca71133a6b71022;p=gosa.git Several winstation fixes from 2.5 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5629 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 7adac6abc..17a371c19 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -819,7 +819,7 @@ class systems extends plugin if($this->DivListSystem->$checkBox){ if($this->DivListSystem->SubSearch){ if($oc['CLASS'] != ""){ - $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))"; + $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))"; $new_res = get_list($filter, $sys_categories , $base,$sys_attrs, GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT); /* Remove all objects that are not in the expected sub department */ @@ -832,7 +832,7 @@ class systems extends plugin }else{ /* User filter? */ if($oc['CLASS'] != ""){ - $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))"; + $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))"; $res = array_merge($res,get_list($filter,$sys_categories,$oc['TREE'].$base, $sys_attrs, GL_NONE | GL_SIZELIMIT)); } } diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index fd57c3a64..4eb61c7c6 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -55,7 +55,7 @@ class wingeneric extends plugin $this->base= dn2base($ui->dn); $this->cn= ""; } else { - $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn); + $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_winstations_ou())."/", "", $this->dn); } /* Save dn for later references */ diff --git a/plugins/admin/systems/tabs_winstation.inc b/plugins/admin/systems/tabs_winstation.inc index 73cd77f4d..2b884c1d8 100644 --- a/plugins/admin/systems/tabs_winstation.inc +++ b/plugins/admin/systems/tabs_winstation.inc @@ -22,7 +22,7 @@ class wintabs extends tabs /* Check for new 'dn', in order to propagate the 'dn' to all plugins */ $baseobject= $this->by_object['wingeneric']; - $this->dn= "uid=$baseobject->cn,ou=winstations,ou=systems,".$baseobject->base; + $this->dn= "uid=$baseobject->cn,".get_winstations_ou().$baseobject->base; $baseobject->dn= $this->dn; foreach ($this->by_object as $key => $obj){ diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index c0042797a..115302643 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -751,16 +751,25 @@ class userManagement extends plugin $SortTemp = array(); $List = array(); foreach($ListTemp as $Key => $Entry){ - // Generate caption for rows - if (isset($Entry["sn"]) && isset($Entry["givenName"])){ - $display= $Entry["sn"][0].", ".$Entry["givenName"][0]." [".$Entry["uid"][0]."]"; - } else { - $display= "[".$Entry["uid"][0]."]"; - } - $display = strtolower($display); - $List[$display] = $Entry; - $SortTemp[$display] = $display; + /* Skip entries that are not located under the people ou (normaly 'ou=people,') + * Else winstations will be listed too, if you use the subtree flag. + */ + if(!preg_match("/".normalizePreg(get_people_ou())."/i",$Entry['dn'])){ + continue; + }else{ + + // Generate caption for rows + if (isset($Entry["sn"]) && isset($Entry["givenName"])){ + $display= $Entry["sn"][0].", ".$Entry["givenName"][0]." [".$Entry["uid"][0]."]"; + } else { + $display= "[".$Entry["uid"][0]."]"; + } + + $display = strtolower($display); + $List[$display] = $Entry; + $SortTemp[$display] = $display; + } } sort($SortTemp); reset($SortTemp);