Stopped redirecting to /login if no valid session

This commit is contained in:
drigato 2015-04-21 11:26:48 -04:00
parent de8edf982a
commit 7d1b112db9
4 changed files with 47 additions and 5 deletions

View File

@ -10,7 +10,14 @@ class IndexController extends Zend_Controller_Action
public function indexAction()
{
$this->_forward('index', 'showbuilder');
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headLink()->appendStylesheet($baseUrl.'css/landing-page.css?'.$CC_CONFIG['airtime_version']);
$this->_helper->layout->setLayout('login');
$this->view->stationLogo = Application_Model_Preference::GetStationLogo();
$this->view->stationName = Application_Model_Preference::GetStationName();
$this->view->stationDescription = Application_Model_Preference::GetStationDescription();
}
public function mainAction()

View File

@ -139,12 +139,15 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
}
else //Non-REST, regular Airtime web app requests
{
//Redirect you to the login screen since you have no session.
if ($controller !== 'login') {
// Redirect user to the landing page if they are trying to
// access a resource that requires a valid session.
// Skip the redirection if they are already on the landing page
// or the login page.
if ($controller !== 'index' && $controller !== 'login') {
if ($request->isXmlHttpRequest()) {
$url = 'http://'.$request->getHttpHost().'/login';
$url = 'http://'.$request->getHttpHost().'/';
$json = Zend_Json::encode(array('auth' => false, 'url' => $url));
// Prepare response
@ -157,7 +160,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit();
} else {
$r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
$r->gotoSimpleAndExit('index', 'login', $request->getModuleName());
$r->gotoSimpleAndExit('index', 'index', $request->getModuleName());
}
}
}

View File

@ -0,0 +1,32 @@
.landing-page-content {
margin: 0 auto;
width: 100%;
color: #fff;
padding-top: 60px;
/*position: relative;*/
}
.station-info {
/*position: absolute;*/
}
/*@media (min-width: 640px) {
.station-info {
float:left;
margin-right: 20px;
width: 200px;
}
.player {
overflow: hidden;
}
}
@media (max-width: 640px) {
.station-info {
float: none;
margin-right: 0px;
width: auto;
}
}*/