Révision be58a50c
Ajouté par Assos Assos il y a environ 7 ans
drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.functions.inc | ||
---|---|---|
47 | 47 |
return $status; |
48 | 48 |
} |
49 | 49 |
|
50 |
/** |
|
51 |
* Converts a password to the format that Active Directory supports (for the |
|
52 |
* purpose of changing or setting). Note that AD needs the field to be called |
|
53 |
* unicodePwd (as opposed to userPassword) |
|
54 |
* |
|
55 |
* @param string $password |
|
56 |
* The password that is being formatted for Active Directory unicodePwd field |
|
57 |
* @return string |
|
58 |
* $password surrounded with quotes and in UTF-16LE encoding |
|
59 |
*/ |
|
60 |
function ldap_servers_convert_password_for_active_directory_unicodePwd($password) { |
|
61 |
// This function can be called with $attributes['unicodePwd'] as an array. |
|
62 |
if (!is_array($password)) { |
|
63 |
return mb_convert_encoding("\"{$password}\"", "UTF-16LE"); |
|
64 |
} |
|
65 |
else { |
|
66 |
// Presumably there is no use case for there being more than one password in |
|
67 |
// the $attributes array, hence it will be at index 0 and we return in kind. |
|
68 |
return array(mb_convert_encoding("\"{$password[0]}\"", "UTF-16LE")); |
|
69 |
} |
|
70 |
} |
|
71 |
|
|
50 | 72 |
/** |
51 | 73 |
* |
52 | 74 |
* this attempts to find bad dns, but should only be used as warnings |
... | ... | |
226 | 248 |
if ($is_scalar) { |
227 | 249 |
$values = array($values); |
228 | 250 |
} |
251 |
if ($values === NULL) { |
|
252 |
return NULL; |
|
253 |
} |
|
229 | 254 |
|
230 | 255 |
foreach ($values as $key => $val) { |
231 | 256 |
// Escaping of filter meta characters |
Formats disponibles : Unified diff
Weekly update of contrib modules