# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: Joomla root # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. --- components/com_comprofiler/comprofiler.php +++ components/com_comprofiler/comprofiler.php @@ -897,21 +897,24 @@ return; } - $cbNotification = new cbNotification(); - $res = $cbNotification->sendFromSystem($user_id,$subject,$message); + $_PLUGINS->trigger( 'onNewPassword', array($user_id,$newpass)); - if ($res) { - $_PLUGINS->trigger( 'onNewPassword', array($user_id,$newpass)); + $user = CBuser::getUserDataInstance( (int) $user_id ); + $user->password = $newpass; - $user = CBuser::getUserDataInstance( (int) $user_id ); - $user->password = $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 ) ) ); + if ( ! $user->storePassword() ) { + cbRedirect( cbSef("index.php?option=$option&task=lostPassword".($Itemid ? "&Itemid=". (int) $Itemid : ""), false ), $user->getError(), 'error' ); + return; } else { - cbRedirect( cbSef("index.php?option=$option&task=done".($Itemid ? "&Itemid=". (int) $Itemid : ""), false ),_UE_NEWPASS_FAILED ); + $cbNotification = new cbNotification(); + $res = $cbNotification->sendFromSystem($user_id,$subject,$message); + + if ( ! $res ) { + cbRedirect( cbSef("index.php?option=$option&task=done".($Itemid ? "&Itemid=". (int) $Itemid : ""), false ),_UE_NEWPASS_FAILED ); + return; + } } + cbRedirect( cbSef("index.php?option=$option&task=done".($Itemid ? "&Itemid=". (int) $Itemid : ""), false ), sprintf( _UE_NEWPASS_SENT, htmlspecialchars( $confirmEmail ) ) ); } else { cbRedirect( cbSef("index.php?option=$option&task=done".($Itemid ? "&Itemid=". (int) $Itemid : ""), false ), _UE_NEWPASS_FAILED ); }