LSattr_ldap_password : Added wildcardPassword and encodedWildcardPassword options
authorBenjamin Renard <brenard@easter-eggs.com>
Tue, 9 Nov 2010 15:50:24 +0000 (16:50 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Tue, 9 Nov 2010 15:50:24 +0000 (16:50 +0100)
public_html/includes/class/class.LSattr_ldap_password.php

index f33d63d..cba06cc 100644 (file)
@@ -55,6 +55,28 @@ class LSattr_ldap_password extends LSattr_ldap {
 
     $data[]=$this -> encodePassword($this -> clearPassword);
 
+    // Wildcard Password
+    if (isset($this -> config['ldap_options']['wildcardPassword'])) {
+      if(!is_array($this -> config['ldap_options']['wildcardPassword'])) {
+        $data[]=$this -> encodePassword($this -> config['ldap_options']['wildcardPassword']);
+      }
+      else {
+        foreach($this -> config['ldap_options']['wildcardPassword'] as $pwd) {
+          $data[]=$this -> encodePassword($pwd);
+        }
+      }
+    }
+
+    // Wildcard Password already encoded
+    if (isset($this -> config['ldap_options']['encodedWildcardPassword'])) {
+      if(!is_array($this -> config['ldap_options']['encodedWildcardPassword'])) {
+        $data[]=$this -> config['ldap_options']['encodedWildcardPassword'];
+      }
+      else {
+        $data=array_merge($data,$this -> config['ldap_options']['encodedWildcardPassword']);
+      }
+    }
+
     return $data;
   }