SAAS-155: Add possibility to show additional information on
login page (for demo site) - username and password are auto filled on demo site - added informative msg on demo site about username and password
This commit is contained in:
parent
63b2fa94de
commit
3a8ba36e0d
4 changed files with 22 additions and 6 deletions
|
@ -81,5 +81,9 @@ class Config {
|
||||||
|
|
||||||
$CC_CONFIG['soundcloud-connection-retries'] = $values['soundcloud']['connection_retries'];
|
$CC_CONFIG['soundcloud-connection-retries'] = $values['soundcloud']['connection_retries'];
|
||||||
$CC_CONFIG['soundcloud-connection-wait'] = $values['soundcloud']['time_between_retries'];
|
$CC_CONFIG['soundcloud-connection-wait'] = $values['soundcloud']['time_between_retries'];
|
||||||
|
|
||||||
|
if(isset($values['demo']['demo'])){
|
||||||
|
$CC_CONFIG['demo'] = $values['demo']['demo'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ class LoginController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
|
global $CC_CONFIG;
|
||||||
|
|
||||||
if(Zend_Auth::getInstance()->hasIdentity())
|
if(Zend_Auth::getInstance()->hasIdentity())
|
||||||
{
|
{
|
||||||
$this->_redirect('Nowplaying');
|
$this->_redirect('Nowplaying');
|
||||||
|
@ -80,11 +82,14 @@ class LoginController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->message = $message;
|
$this->view->message = $message;
|
||||||
$this->view->error = $error;
|
$this->view->error = $error;
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
$this->view->airtimeVersion = Application_Model_Preference::GetAirtimeVersion();
|
$this->view->airtimeVersion = Application_Model_Preference::GetAirtimeVersion();
|
||||||
$this->view->airtimeCopyright = AIRTIME_COPYRIGHT_DATE;
|
$this->view->airtimeCopyright = AIRTIME_COPYRIGHT_DATE;
|
||||||
|
if(isset($CC_CONFIG['demo'])){
|
||||||
|
$this->view->demo = $CC_CONFIG['demo'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logoutAction()
|
public function logoutAction()
|
||||||
|
|
|
@ -5,6 +5,8 @@ class Application_Form_Login extends Zend_Form
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
global $CC_CONFIG;
|
||||||
|
|
||||||
// Set the method for the display form to POST
|
// Set the method for the display form to POST
|
||||||
$this->setMethod('post');
|
$this->setMethod('post');
|
||||||
|
|
||||||
|
@ -13,17 +15,19 @@ class Application_Form_Login extends Zend_Form
|
||||||
'label' => 'Username:',
|
'label' => 'Username:',
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'',
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validators' => array(
|
'validators' => array(
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add password element
|
// Add password element
|
||||||
$this->addElement('password', 'password', array(
|
$this->addElement('password', 'password', array(
|
||||||
'label' => 'Password:',
|
'label' => 'Password:',
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'',
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validators' => array(
|
'validators' => array(
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
<div class="logobox"> </div>
|
<div class="logobox"> </div>
|
||||||
<h2>Login</h2>
|
<h2>Login</h2>
|
||||||
<div id="login" class="login-content clearfix">
|
<div id="login" class="login-content clearfix">
|
||||||
|
<?php if(isset($this->demo) && $this->demo == 1){?>
|
||||||
|
<p style="font-weight:bold">Welcome to the online Airtime demo! You can log in using the username 'admin' and the password 'admin'.</p>
|
||||||
|
<?php }?>
|
||||||
<p class="light" style='<?php echo $this->error?"color:#902d2d;font-size:11px;padding:2px 4px;background:#c6b4b4;margin-bottom:2px;border:1px solid #c83f3f;":""?>'><?php echo $this->message; ?></p>
|
<p class="light" style='<?php echo $this->error?"color:#902d2d;font-size:11px;padding:2px 4px;background:#c6b4b4;margin-bottom:2px;border:1px solid #c83f3f;":""?>'><?php echo $this->message; ?></p>
|
||||||
<?php echo $this->form; ?>
|
<?php echo $this->form; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue