Code

Added pulldown js
[gosa.git] / gosa-core / include / class_filterLDAP.inc
old mode 100755 (executable)
new mode 100644 (file)
index fae2978..f2cfd53
@@ -4,11 +4,12 @@ class filterLDAP {
 
   static function query($base, $scope, $filter, $attributes, $category, $objectStorage= "", $objectBase= "")
   {
-    global $config;
+    $config= session::global_get('config');
     $ldap= $config->get_ldap_link(TRUE);
+    $flag= ($scope == "sub")?GL_SUBSEARCH:0;
     $result= filterLDAP::get_list($base, $scope, $filter, $attributes,
                                   $category, $objectStorage, $objectBase,
-                                  GL_SUBSEARCH | GL_SIZELIMIT);
+                                  $flag | GL_SIZELIMIT);
     return $result;
   }
 
@@ -16,7 +17,8 @@ class filterLDAP {
   static function get_list($base, $scope, $filter, $attributes, $category,
                            $objectStorage= array(), $objectBase= "", $flags= GL_SUBSEARCH)
   {
-    global $config, $ui;
+    $config= session::global_get('config');
+    $ui= session::global_get('ui');
     $departments= array();
 
     /* Get LDAP link */
@@ -166,7 +168,8 @@ class filterLDAP {
 
   function get_list_old($filter, $category, $base= "", $attributes= array(), $flags= GL_SUBSEARCH)
   {
-    global $config, $ui;
+    $config= session::global_get('config');
+    $ui= session::global_get('ui');
   
     /* Get LDAP link */
     $ldap= $config->get_ldap_link($flags & GL_SIZELIMIT);
@@ -221,7 +224,6 @@ class filterLDAP {
         }
       }
     }
-  
     return ($result);
   }