Merge pull request #80 from radiorabe/feature/reset-password-without-whmcs
Make password reset work for eveyone
This commit is contained in:
commit
44d3d46904
|
@ -156,7 +156,7 @@ class LoginController extends Zend_Controller_Action
|
|||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
$query = CcSubjsQuery::create();
|
||||
$username = $form->userName->getValue();
|
||||
$username = $form->username->getValue();
|
||||
$email = $form->email->getValue();
|
||||
|
||||
if (empty($username)) {
|
||||
|
@ -179,7 +179,18 @@ class LoginController extends Zend_Controller_Action
|
|||
$form->email->addError($this->view->translate(_("Email could not be sent. Check your mail server settings and ensure it has been configured properly.")));
|
||||
}
|
||||
} else {
|
||||
$form->email->addError($this->view->translate(sprintf(_pro("That username or email address could not be found. If you are the station owner, you should <a href=\"%s\">reset your here</a>."), WHMCS_PASSWORD_RESET_URL)));
|
||||
if (!LIBRETIME_ENABLE_WHMCS) {
|
||||
$form->email->addError($this->view->translate(_("That username or email address could not be found.")));
|
||||
} else {
|
||||
$form->email->addError(
|
||||
$this->view->translate(
|
||||
sprintf(
|
||||
_pro("That username or email address could not be found. If you are the station owner, you should <a href=\"%s\">reset your here</a>."),
|
||||
WHMCS_PASSWORD_RESET_URL
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
} else { //Form is not valid
|
||||
$form->email->addError($this->view->translate(_("There was a problem with the username or email address you entered.")));
|
||||
|
|
|
@ -41,7 +41,6 @@ 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(_("Back"))
|
||||
|
@ -49,6 +48,5 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
->setAttrib('onclick', 'window.location = ' . Zend_Controller_Front::getInstance()->getBaseUrl('login'))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($cancel);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,8 +32,8 @@ class Application_Model_Auth
|
|||
|
||||
$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_ADDRESS);
|
||||
$message .= sprintf(_pro("\n\nThank you,\nThe %s Team"), SAAS_PRODUCT_BRANDING_NAME);
|
||||
$message .= sprintf(_("\n\nIf you have any problems, please contact our support team: %s"), SUPPORT_ADDRESS);
|
||||
$message .= sprintf(_("\n\nThank you,\nThe %s Team"), SAAS_PRODUCT_BRANDING_NAME);
|
||||
|
||||
$str = sprintf(_('%s Password Reset'), SAAS_PRODUCT_BRANDING_NAME);
|
||||
return Application_Model_Email::send($str, $message, $user->getDbEmail());
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<?php if (LIBRETIME_ENABLE_WHMCS): ?>
|
||||
<fieldset>
|
||||
<legend>Station Owners</legend>
|
||||
<p>
|
||||
|
@ -5,8 +6,11 @@
|
|||
</p>
|
||||
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
<fieldset>
|
||||
<?php if (LIBRETIME_ENABLE_WHMCS): ?>
|
||||
<legend>DJs, Program Managers, and Others</legend>
|
||||
<?php endif; ?>
|
||||
<form enctype="application/x-www-form-urlencoded" method="post" action="">
|
||||
<dl class="zend_form">
|
||||
|
||||
|
|
Loading…
Reference in New Issue