Code

Added sorting for ldap bases
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_printGeneric.inc
index 3d76f8bfcec556178c09d95fedb48cccce0da3e4..d2b3af58c071a1491980767fd8185679caab1daa 100644 (file)
@@ -122,12 +122,11 @@ class printgeneric extends plugin
       /* $this->members contains all members */
       $this->member[$type]=array();
 
-      if (isset($this->attrs[$attr]['count'])) {
-        unset($this->attrs[$attr]['count']);
-      }
-
       if(isset($this->attrs[$attr])){
-        foreach($this->attrs[$attr] as $mem){
+        $ldap->cd($this->config->current['BASE']) ;
+        for($i = 0 ;  $i < $this->attrs[$attr]['count']; $i++){
+        
+          $mem = $this->attrs[$attr][$i];
           if(preg_match("/Group/",$type)){
             $ldap->search("(&(objectClass=posixGroup)(cn=".$mem."))",array("cn","description"));
             if($ldap->count()){
@@ -767,7 +766,7 @@ class printgeneric extends plugin
    
     /* Get servername */
     $server = $_SERVER['SERVER_NAME'];
-    if(TESTS::is_ip($server)){  
+    if(tests::is_ip($server)){  
       $server_name = gethostbyaddr($server);
     }else{
       $server_name = gethostbyaddr(gethostbyname($server));