Merge branch 'saas-dev' into saas-showbuilder
This commit is contained in:
commit
133db1c6a6
11 changed files with 118 additions and 78 deletions
|
@ -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.
|
||||
|
@ -132,12 +130,12 @@ class LoginController extends Zend_Controller_Action
|
|||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/login/password-restore.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$stationLocale = Application_Model_Preference::GetDefaultLocale();
|
||||
|
||||
|
||||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
|
||||
|
||||
//uses separate layout without a navigation.
|
||||
|
@ -146,17 +144,18 @@ class LoginController extends Zend_Controller_Action
|
|||
$form = new Application_Form_PasswordRestore();
|
||||
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost() && $form->isValid($request->getPost())) {
|
||||
$query = CcSubjsQuery::create();
|
||||
if (empty($form->username->getValue())) {
|
||||
$query->filterByDbEmail($form->email->getValue());
|
||||
} else if (empty($form->email->getValue())) {
|
||||
$query->filterByDbLogin($form->username->getValue());
|
||||
} else {
|
||||
$query->filterByDbEmail($form->email->getValue())
|
||||
->filterByDbLogin($form->username->getValue());
|
||||
}
|
||||
$user = $query->findOne();
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
$query = CcSubjsQuery::create();
|
||||
if (empty($form->username->getValue())) {
|
||||
$query->filterByDbEmail($form->email->getValue());
|
||||
} else if (empty($form->email->getValue())) {
|
||||
$query->filterByDbLogin($form->username->getValue());
|
||||
} else {
|
||||
$query->filterByDbEmail($form->email->getValue())
|
||||
->filterByDbLogin($form->username->getValue());
|
||||
}
|
||||
$user = $query->findOne();
|
||||
|
||||
if (!empty($user)) {
|
||||
$auth = new Application_Model_Auth();
|
||||
|
@ -168,11 +167,12 @@ 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(_("There was a problem sending the recovery email.")));
|
||||
$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->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>.")));
|
||||
} else { //Form is not valid
|
||||
$form->email->addError($this->view->translate(_("There was a problem with the username or email address you entered.")));
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class Application_Form_PasswordChange extends Zend_Form
|
|||
));
|
||||
|
||||
$this->addElement('submit', 'submit', array(
|
||||
'label' => _('Get new password'),
|
||||
'label' => _('Save'),
|
||||
'ignore' => true,
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||
'decorators' => array(
|
||||
|
|
|
@ -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,\nThe %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,36 +1,54 @@
|
|||
<form enctype="application/x-www-form-urlencoded" method="post" action="">
|
||||
<dl class="zend_form">
|
||||
<dt id="username-label">
|
||||
<dt id="email-label">
|
||||
<label for="email" class="required">
|
||||
<?php echo $this->element->getElement('email')->getLabel() ?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="email-element">
|
||||
<?php echo $this->element->getElement('email') ?>
|
||||
</dd>
|
||||
<?php if ($this->element->getElement('email')->hasErrors()): ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach ($this->element->getElement('email')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
</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() ?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="email-element">
|
||||
<?php echo $this->element->getElement('email') ?>
|
||||
</dd>
|
||||
<?php if ($this->element->getElement('email')->hasErrors()): ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach ($this->element->getElement('email')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<dt id="submit-label"> </dt>
|
||||
<dd id="submit-element">
|
||||
<?php echo $this->element->getElement('submit') ?>
|
||||
</dd>
|
||||
|
||||
<dd id="cancel-element">
|
||||
|
||||
<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>
|
||||
|
||||
<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') ?>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
|
@ -1,9 +1,16 @@
|
|||
<div class="login_box">
|
||||
<div class="logobox"> </div>
|
||||
<h2><?php echo _("Email sent") ?></h2>
|
||||
<h2><?php echo _("Email Sent!") ?></h2>
|
||||
|
||||
<div id="login" class="login-content clearfix">
|
||||
<p class="light"><?php echo _("An email has been sent") ?></p>
|
||||
<p><a class="link" href="<?php echo $this->baseUrl('login'); ?>"><?php echo _("Back to login screen") ?></a></p>
|
||||
<p class="light"><?php echo _("A password reset link has been sent to your email address. Please check your email and follow the instructions inside to reset your password. If you don't see the email, please check your spam folder!") ?></p>
|
||||
<br>
|
||||
<dl class="zend-form">
|
||||
<dd id="cancel-element">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -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;
|
||||
|
@ -1089,7 +1102,7 @@ input[type="checkbox"] {
|
|||
margin:0;
|
||||
padding:8px 0 16px 0;
|
||||
font-size:12px;
|
||||
color:#717171;
|
||||
color: #919191;
|
||||
text-align:left;
|
||||
}
|
||||
.logobox {
|
||||
|
@ -1214,13 +1227,17 @@ 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 {
|
||||
text-decoration:underline;
|
||||
}
|
||||
}
|
||||
.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…
Add table
Add a link
Reference in a new issue