function _acquia_agent_hash_password_crypt in Acquia Connector 7.2
Same name and namespace in other branches
- 6.2 acquia_agent/acquia_agent.pages.inc \_acquia_agent_hash_password_crypt()
- 7.3 acquia_agent/acquia_agent.pages.inc \_acquia_agent_hash_password_crypt()
Hash a password according to Drupal's password_crypt and settings from remote.
1 call to _acquia_agent_hash_password_crypt()
- acquia_agent_automatic_setup_form_validate in acquia_agent/
acquia_agent.pages.inc
File
- acquia_agent/
acquia_agent.pages.inc, line 11 - Acquia Agent configuration page.
Code
function _acquia_agent_hash_password_crypt($algorithm, $pass, $setting, $extra_md5 = FALSE) {
// Server may state that password needs to be hashed with MD5 first.
if ($extra_md5) {
$pass = md5($pass);
}
// Include core's password.inc because it has _password_crypt().
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
$hash = _password_crypt($algorithm, $pass, $setting);
// Match the hash stored on the server which has prefix character 'U' if
// password was first hashed with MD5.
if ($extra_md5) {
$hash = 'U' . $hash;
}
return $hash;
}