LSldapObject :: Fixed validation test
authorBenjamin Renard <bn8@zionetrix.net>
Tue, 8 May 2012 14:45:23 +0000 (16:45 +0200)
committerBenjamin Renard <bn8@zionetrix.net>
Tue, 8 May 2012 14:45:23 +0000 (16:45 +0200)
public_html/includes/class/class.LSldapObject.php

index d5ee557..f0553fc 100644 (file)
@@ -466,13 +466,15 @@ class LSldapObject {
             if(isset($test['object_type'])) {
               $test_obj = new $test['object_type']();
               $sfilter=$test_obj->getObjectFilter();
-              $sfilter='(&'.$sfilter;
-              if($sfilter_user[0]=='(') {
-                $sfilter=$sfilter.$sfilter_user.')';
-              }
-              else {
-                $sfilter=$sfilter.'('.$sfilter_user.'))';
-              }
+             if ($sfilter_user) {
+                $sfilter='(&'.$sfilter;
+                if($sfilter_user[0]=='(') {
+                  $sfilter=$sfilter.$sfilter_user.')';
+                }
+                else {
+                  $sfilter=$sfilter.'('.$sfilter_user.'))';
+                }
+             }
             }
             else {
               $sfilter=$sfilter_user;