Changing a user password programmatically - Joomla! Forum - community, help and support
this changes password in database:
.. user cannot log in.
this:
gives me server 500 error.
anyone know how achieve this?
the site runs joomla 1.5.26
code: select all
$query="update jos_users set password='".md5('$pass')."' username='".$user."' ";
$db->setquery( $query );
$db->query();
.. user cannot log in.
this:
code: select all
$userobj = jfactory::getuser($this->getidbyusername($user));
$password = array('password' => $pass, 'password2' => $pass);
$userobj->bind($password));
$userobj->save();
gives me server 500 error.
anyone know how achieve this?
the site runs joomla 1.5.26
ok, here's how it:
find $userid of user account want access , user object getuser.
bind $userobj password array defined above.
save $userobj.
simpler donald trump!
code: select all
$userobj = jfactory::getuser($userid);
$password = array('password' => $pass, 'password2' => $pass);
$userobj->bind($password));
$userobj->save();
find $userid of user account want access , user object getuser.
bind $userobj password array defined above.
save $userobj.
simpler donald trump!
Comments
Post a Comment