Project

General

Profile

Bug #3196 » 3196-p4.patch

krileon, 30 January 2012 20:24

View differences:

/components/com_comprofiler/comprofiler.php
if ($res) {
$_PLUGINS->trigger( 'onNewPassword', array($user_id,$newpass));
$cbUser = CBuser::getInstance( (int) $user_id );
$user = $cbUser->getUserData();
$newpass = $user->hashAndSaltPassword( $newpass );
$sql = "UPDATE #__users SET password = " . $_CB_database->Quote( $newpass ) . " WHERE id = " . (int) $user_id;
$_CB_database->setQuery( $sql );
if (!$_CB_database->query()) {
die("SQL error" . $_CB_database->stderr(true));
$user = CBuser::getUserDataInstance( (int) $user_id );
$user->password = $user->hashAndSaltPassword( $newpass );
if (!$user->storePassword()) {
die("SQL error" . $user->getError());
}
cbRedirect( cbSef("index.php?option=$option&task=done".($Itemid ? "&Itemid=". (int) $Itemid : ""), false ), sprintf( _UE_NEWPASS_SENT, htmlspecialchars( $confirmEmail ) ) );
} else {
(4-4/6)