Clean up and bugfixes for password reset (SAAS-1009)
This commit is contained in:
parent
ea86675d07
commit
ea2a6b3f68
|
@ -9,6 +9,7 @@ define('COMPANY_NAME' , 'Sourcefabric');
|
|||
define('COMPANY_SUFFIX' , 'z.ú.');
|
||||
define('COMPANY_SITE' , 'Sourcefabric.org');
|
||||
define('COMPANY_SITE_URL' , 'http://sourcefabric.org/');
|
||||
define('SUPPORT_EMAIL_ADDRESS', "help@sourcefabric.org");
|
||||
|
||||
define('HELP_URL' , 'http://help.sourcefabric.org/');
|
||||
define('FAQ_URL' , 'https://sourcefabricberlin.zendesk.com/hc/en-us/sections/200994309-Airtime-FAQ');
|
||||
|
|
|
@ -38,11 +38,9 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/login/login.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$form = new Application_Form_Login();
|
||||
|
||||
$message = _("Please enter your user name and password");
|
||||
$message = _("Please enter your username and password.");
|
||||
|
||||
if ($request->isPost()) {
|
||||
// if the post contains recaptcha field, which means form had recaptcha field.
|
||||
|
@ -146,7 +144,8 @@ class LoginController extends Zend_Controller_Action
|
|||
$form = new Application_Form_PasswordRestore();
|
||||
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost() && $form->isValid($request->getPost())) {
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
$query = CcSubjsQuery::create();
|
||||
if (empty($form->username->getValue())) {
|
||||
$query->filterByDbEmail($form->email->getValue());
|
||||
|
@ -171,7 +170,8 @@ class LoginController extends Zend_Controller_Action
|
|||
$form->email->addError($this->view->translate(_("There was a problem sending the recovery email.")));
|
||||
}
|
||||
} else {
|
||||
$form->email->addError($this->view->translate(_("We couldn't find the email you entered - you can also try <a href='".WHMCS_PASSWORD_RESET_URL."'>here</a>.")));
|
||||
$form->email->addError($this->view->translate(sprintf(_pro("We couldn't find the email you entered - you can also try <a href=\"%s\">here</a>."), WHMCS_PASSWORD_RESET_URL)));
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
|
|
|
@ -33,7 +33,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
));
|
||||
|
||||
$this->addElement('submit', 'submit', array(
|
||||
'label' => _('Restore password'),
|
||||
'label' => _('Reset password'),
|
||||
'ignore' => true,
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||
'decorators' => array(
|
||||
|
@ -41,12 +41,14 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
)
|
||||
));
|
||||
|
||||
/*
|
||||
$cancel = new Zend_Form_Element_Button("cancel");
|
||||
$cancel->class = 'ui-button ui-widget ui-state-default ui-button-text-only center';
|
||||
$cancel->setLabel(_("Return to login"))
|
||||
$cancel->setLabel(_("Back"))
|
||||
->setIgnore(True)
|
||||
->setAttrib('onclick', 'redirectToLogin();')
|
||||
->setAttrib('onclick', 'window.location = ' . Zend_Controller_Front::getInstance()->getBaseUrl('login'))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($cancel);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,10 +30,12 @@ class Application_Model_Auth
|
|||
$e_link_port = $_SERVER['SERVER_PORT'];
|
||||
$e_link_path = $view->url(array('user_id' => $user->getDbId(), 'token' => $token), 'password-change');
|
||||
|
||||
$message = sprintf(_("Hi %s, \n\nClick this link to reset your password: "), $user->getDbLogin());
|
||||
$message = sprintf(_("Hi %s, \n\nPlease click this link to reset your password: "), $user->getDbLogin());
|
||||
$message .= "{$e_link_protocol}://{$e_link_base}:{$e_link_port}{$e_link_path}";
|
||||
$message .= sprintf(_pro("\n\nIf you have any problems, please contact our support team: %s"), SUPPORT_EMAIL_ADDRESS);
|
||||
$message .= sprintf(_pro("\n\nThank you, The %s Team"), SAAS_PRODUCT_BRANDING_NAME);
|
||||
|
||||
$str = sprintf(_('%s Password Reset'), PRODUCT_NAME);
|
||||
$str = sprintf(_('%s Password Reset'), SAAS_PRODUCT_BRANDING_NAME);
|
||||
return Application_Model_Email::send($str, $message, $user->getDbEmail());
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class Application_Model_Email
|
|||
*/
|
||||
public static function send($subject, $message, $to) {
|
||||
|
||||
$headers = 'From: Airtime <noreply@account.sourcefabric.com>';
|
||||
$headers = sprintf('From: %s <noreply@account.sourcefabric.com>', SAAS_PRODUCT_BRANDING_NAME);
|
||||
return mail($to, $subject, $message, $headers);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,26 @@
|
|||
<fieldset>
|
||||
<legend>Station Owners</legend>
|
||||
<p>
|
||||
<?php echo(sprintf(_pro("If you are the primary owner of this station, <a href=\"%s\">please reset your password here</a>."), WHMCS_PASSWORD_RESET_URL)); ?>
|
||||
</p>
|
||||
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>DJs, Program Managers, and Others</legend>
|
||||
<form enctype="application/x-www-form-urlencoded" method="post" action="">
|
||||
<dl class="zend_form">
|
||||
|
||||
<p>Please enter both your username and email address.</p>
|
||||
<dt id="username-label">
|
||||
<label for="username" class="required">
|
||||
<?php echo $this->element->getElement('username')->getLabel() ?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="username-element">
|
||||
<?php echo $this->element->getElement('username') ?>
|
||||
</dd>
|
||||
</dt>
|
||||
|
||||
<dt id="email-label">
|
||||
<label for="email" class="required">
|
||||
<?php echo $this->element->getElement('email')->getLabel() ?>
|
||||
|
@ -17,20 +37,18 @@
|
|||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<label for="username" class="required">
|
||||
<?php echo $this->element->getElement('username')->getLabel() ?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="username-element">
|
||||
<?php echo $this->element->getElement('username') ?>
|
||||
</dd>
|
||||
|
||||
<dt id="submit-label"> </dt>
|
||||
<dd id="submit-element">
|
||||
<?php echo $this->element->getElement('submit') ?>
|
||||
</dd>
|
||||
|
||||
<dd id="cancel-element">
|
||||
<?php echo $this->element->getElement('cancel') ?>
|
||||
|
||||
<a href="<?php echo($this->baseUrl('login')); ?>">
|
||||
<button name="cancel" type="button" class="ui-button ui-widget ui-state-default ui-button-text-only center"><?php echo(_("Back")); ?></button>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
<div class="login_box">
|
||||
<div class="logobox"> </div>
|
||||
<h2><?php echo _("Reset password") ?></h2>
|
||||
<h2><?php echo _("Password Reset") ?></h2>
|
||||
|
||||
<div id="login" class="login-content clearfix">
|
||||
<p class="light">
|
||||
<?php echo _("Enter your account e-mail address or your username (or both, if you have multiple accounts
|
||||
using the same email address), and we'll send you a link to reset your password.")?>
|
||||
</p>
|
||||
<?php echo $this->form; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -21,6 +21,19 @@ html, body {
|
|||
text-align:center;
|
||||
}
|
||||
|
||||
#login-page fieldset
|
||||
{
|
||||
padding: 10px;
|
||||
border: 1px solid #555;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#login-page legend {
|
||||
font-weight: bold;
|
||||
color: #919191;
|
||||
}
|
||||
|
||||
|
||||
h2 {
|
||||
color: #000000;
|
||||
font-size: 2.1em;
|
||||
|
@ -1070,7 +1083,7 @@ input[type="checkbox"] {
|
|||
margin:0;
|
||||
padding:8px 0 16px 0;
|
||||
font-size:12px;
|
||||
color:#717171;
|
||||
color: #919191;
|
||||
text-align:left;
|
||||
}
|
||||
.logobox {
|
||||
|
@ -1195,14 +1208,18 @@ input[type="checkbox"] {
|
|||
.login-content .text-right, .text-right {
|
||||
text-align:right;
|
||||
}
|
||||
.login-content .link {
|
||||
.login-content a {
|
||||
color:#FF5D1A;
|
||||
text-decoration:none;
|
||||
}
|
||||
.login-content .link:hover {
|
||||
.login-content a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
.login-content .errors a {
|
||||
color: #ff1c13;
|
||||
}
|
||||
|
||||
/*---//////////////////// END LOGIN ////////////////////---*/
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
function redirectToLogin(){
|
||||
window.location = baseUrl+"Login"
|
||||
}
|
Loading…
Reference in New Issue