Ticket #65: lostpassword.patch
| File lostpassword.patch, 6.9 kB (added by mauser, 5 months ago) |
|---|
-
plugins/Login/lang/en.php
old new 14 14 15 15 'Login_MailTopicPasswordRecovery' => 'Password recovery', 16 16 'Login_MailBodyPasswordRecovery' => "Hi %1s,\n\nYour new password is: %2s\n\nYou can login now at: %3s", 17 'Login_PasswordSent' => 'Password has been just sent. Check your e-mail.' 17 'Login_PasswordSent' => 'Password has been just sent. Check your e-mail.', 18 'Login_ContactAdmin' => 'Please contact with site administrator.' 18 19 ); -
plugins/Login/Controller.php
old new 107 107 108 108 // if user exists 109 109 if( $user != null ) 110 { 110 { 111 $view = new Piwik_View('Login/templates/passwordsent.tpl'); 112 111 113 $login = $user['login']; 112 114 $email = $user['email']; 113 115 … … 116 118 Piwik_UsersManager_API::updateUser($login, $randomPassword); 117 119 118 120 // send email with new password 119 $mail = new Piwik_Mail(); 120 $mail->addTo($email, $login); 121 $mail->setSubject(Piwik_Translate('Login_MailTopicPasswordRecovery')); 122 $mail->setBodyText(sprintf(Piwik_Translate('Login_MailBodyPasswordRecovery'), 123 $login, $randomPassword, Piwik_Url::getCurrentUrlWithoutQueryString())); 124 $mail->send(); 125 126 $view = new Piwik_View('Login/templates/passwordsent.tpl'); 121 try 122 { 123 $mail = new Piwik_Mail(); 124 $mail->addTo($email, $login); 125 $mail->setSubject(Piwik_Translate('Login_MailTopicPasswordRecovery')); 126 $mail->setBodyText(sprintf(Piwik_Translate('Login_MailBodyPasswordRecovery'), 127 $login, $randomPassword, Piwik_Url::getCurrentUrlWithoutQueryString())); 128 $mail->send(); 129 } 130 catch(Exception $e) 131 { 132 $view->ErrorString = $e->getMessage(); 133 } 134 127 135 $view->linkTitle = Piwik::getRandomTitle(); 128 136 $view->urlToRedirect = $urlToRedirect; 129 137 echo $view->render(); -
plugins/Login/templates/lostpassword.tpl
old new 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> 3 <head> 4 <title>Piwik › Lost password</title> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 7 {literal} 8 <script type="text/javascript"> 9 function focusit() { 10 document.getElementById('form_login').focus(); 11 } 12 window.onload = focusit; 13 </script> 14 {/literal} 15 <link rel="stylesheet" href="plugins/Login/templates/login.css"> 16 </head> 1 {include file="Login/templates/header.tpl"} 17 2 18 <body class="login">19 <!-- shamelessly taken from wordpress 2.5 - thank you guys!!! -->20 21 <div id="logo">22 <a href="http://piwik.org" title="{$linkTitle}"><span class="h1">Piwik <span class="description"># open source web analytics</span></span></a>23 </div>24 25 3 <div id="login"> 26 4 27 5 {if $form_data.errors} -
plugins/Login/templates/login.tpl
old new 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> 3 <head> 4 <title>Piwik › Login</title> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 7 {literal} 8 <script type="text/javascript"> 9 function focusit() { 10 document.getElementById('form_login').focus(); 11 } 12 window.onload = focusit; 13 </script> 14 {/literal} 15 <link rel="stylesheet" href="plugins/Login/templates/login.css"> 16 </head> 1 {include file="Login/templates/header.tpl"} 17 2 18 <body class="login">19 <!-- shamelessly taken from wordpress 2.5 - thank you guys!!! -->20 21 <div id="logo">22 <a href="http://piwik.org" title="{$linkTitle}"><span class="h1">Piwik <span class="description"># open source web analytics</span></span></a>23 </div>24 25 3 <div id="login"> 26 4 27 5 {if $form_data.errors} -
plugins/Login/templates/header.tpl
old new 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> 3 <head> 4 <title>Piwik › Lost password</title> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 7 {literal} 8 <script type="text/javascript"> 9 function focusit() { 10 document.getElementById('form_login').focus(); 11 } 12 window.onload = focusit; 13 </script> 14 {/literal} 15 <link rel="stylesheet" href="plugins/Login/templates/login.css"> 16 </head> 17 18 <body class="login"> 19 <!-- shamelessly taken from wordpress 2.5 - thank you guys!!! --> 20 21 <div id="logo"> 22 <a href="http://piwik.org" title="{$linkTitle}"><span class="h1">Piwik <span class="description"># open source web analytics</span></span></a> 23 </div> -
plugins/Login/templates/passwordsent.tpl
old new 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> 3 <head> 4 <title>Piwik › Lost password</title> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <link rel="stylesheet" href="plugins/Login/templates/login.css"> 7 </head> 1 {include file="Login/templates/header.tpl"} 8 2 9 <body class="login">10 <!-- shamelessly taken from wordpress 2.5 - thank you guys!!! -->11 12 <div id="logo">13 <a href="http://piwik.org" title="{$linkTitle}"><span class="h1">Piwik <span class="description"># open source web analytics</span></span></a>14 </div>15 16 3 <div id="login"> 4 5 {if $ErrorString} 6 <div id="login_error"><strong>{'General_Error'|translate}</strong>: {$ErrorString}<br /> 7 {'Login_ContactAdmin'|translate} 8 </div> 9 {else} 10 <p class="message"> 11 {'Login_PasswordSent'|translate} 12 </p> 13 {/if} 17 14 18 <p class="message">19 {'Login_PasswordSent'|translate}20 </p>21 22 15 <p id="nav"> 23 16 <a href="?module=Login&form_url={$urlToRedirect}" title="{'Login_LogIn'|translate}">{'Login_LogIn'|translate}</a> 24 17 </p>
