You are here

function ldap_help_encodePassword in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_help/ldap_test_script/functions.inc \ldap_help_encodePassword()
  2. 7 ldap_help/ldap_test_script/functions.inc \ldap_help_encodePassword()

File

ldap_help/ldap_test_script/functions.inc, line 198

Code

function ldap_help_encodePassword($password) {
  $password = "\"" . $password . "\"";
  $encoded = "";
  for ($i = 0; $i < strlen($password); $i++) {
    $encoded .= "{$password[$i]}\0";
  }
  return $encoded;
}