Password reset on user_save() issue I used user_save to update the field. 
However, whenever I run this function and I log out and try to log back the password doesn't work anymore.I think it cause a change in the password. can anyone help me to get the actual password back?

$existingUser1 = user_load($uid1);
$existingUser1-&gt;field_group_id[LANGUAGE_NONE][0]['value'] = $g_id;
user_save((object) array('uid' =&gt; $existingUser1-&gt;uid), (array) $existingUser1);
You probably want this:

$existingUser1 = user_load($uid1);
$existingUser1-&gt;field_group_id[LANGUAGE_NONE][0]['value'] = $g_id;
user_save($existingUser1);


You just need to call user_save() on the user object to save the values after you have changed any fields.