I trying to get password value without a hash in hook_user_presave()
, and I can do that easy when create user, I just get it in $account
variable. But when I edit user, pass in $account
in hash to because $account
data getting from database. So how i can get plain password value?
Here is my hook:
function hook_user_presave(&$edit, $account, $category) {
if (isset($account->pass)) {
$edit['field_clean_pass']['und'][0]['value'] = $account->pass;
}
}
How about Masquerade module?
If admin needs to be logged in as any user this module is what you need.