Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-06-19 20:26:41 +0400
committermatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-06-19 20:26:41 +0400
commitf83ce1db1ebc4dd7f4e6a3a862f089b9592b1bc0 (patch)
treeeca81d5a203d3e3ba239e9763eff2fc75fa62c87 /plugins/Login
parentbc11aee34bca776fab6c9a13c94a92d9c6aac4c6 (diff)
fixes #815 password reset should be reset only when email was successfully sent
Diffstat (limited to 'plugins/Login')
-rw-r--r--plugins/Login/Controller.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/Login/Controller.php b/plugins/Login/Controller.php
index b2af23d871..5c9a2e7516 100644
--- a/plugins/Login/Controller.php
+++ b/plugins/Login/Controller.php
@@ -156,16 +156,6 @@ class Piwik_Login_Controller extends Piwik_Controller
$login = $user['login'];
$email = $user['email'];
$randomPassword = Piwik_Common::getRandomString(8);
-
- if($isSuperUser)
- {
- $user['password'] = md5($randomPassword);
- Zend_Registry::get('config')->superuser = $user;
- }
- else
- {
- Piwik_UsersManager_API::updateUser($login, $randomPassword);
- }
// send email with new password
try
@@ -192,6 +182,16 @@ class Piwik_Login_Controller extends Piwik_Controller
$fromEmailAddress = str_replace('{DOMAIN}', $piwikHost, $fromEmailAddress);
$mail->setFrom($fromEmailAddress, $fromEmailName);
@$mail->send();
+
+ if($isSuperUser)
+ {
+ $user['password'] = md5($randomPassword);
+ Zend_Registry::get('config')->superuser = $user;
+ }
+ else
+ {
+ Piwik_UsersManager_API::updateUser($login, $randomPassword);
+ }
}
catch(Exception $e)
{