LSsession / LSprofiles : fix bug resolving user's LSprofiles
authorBenjamin Renard <brenard@easter-eggs.com>
Wed, 5 Nov 2014 14:26:09 +0000 (15:26 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Wed, 5 Nov 2014 14:26:09 +0000 (15:26 +0100)
public_html/includes/class/class.LSsession.php

index 8d30882..d581f57 100644 (file)
@@ -1492,7 +1492,17 @@ class LSsession {
                     $LSsearch = new LSsearch($LSobject,'LSsession :: loadLSprofiles',$params,true);
                     $LSsearch -> run(false);
                     
-                    self :: $LSprofiles[$profile] = $LSsearch -> listObjectsDn();
+                    $DNs = $LSsearch -> listObjectsDn();
+                    if (!is_array(self :: $LSprofiles[$profile])) {
+                      self :: $LSprofiles[$profile]=$DNs;
+                    }
+                    else {
+                      foreach($DNs as $dn) {
+                        if (!in_array($dn,self :: $LSprofiles[$profile])) {
+                          self :: $LSprofiles[$profile][] = $dn;
+                        }
+                      }
+                    }
                   }
                 }
               }