Commit cf6ccf04 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #4063 Using a pattern in password is broken

parent ea910d0f
......@@ -500,6 +500,22 @@ class user extends simplePlugin
$skip[] = 'uid';
}
parent::adapt_from_template($attrs, $skip);
if (isset($this->attrs['userPassword'])) {
list($hash,$password) = explode('|', $this->attrs['userPassword'][0], 2);
if (preg_match ('/^{[^}]+}/', $hash)) {
$tmp = passwordMethod::get_method($hash);
if (is_object($tmp)) {
$hash = $tmp->generate_hash($password);
}
}
$this->userPassword = array(
'',
$password,
$password,
$hash,
$this->attributesAccess['userPassword']->isLocked()
);
}
}
function callHook($cmd, $addAttrs = array(), &$returnOutput = array(), &$returnCode = NULL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment