From 7d1b112db94213a3082bd9516f1967a265bec729 Mon Sep 17 00:00:00 2001 From: drigato Date: Tue, 21 Apr 2015 11:26:48 -0400 Subject: [PATCH] Stopped redirecting to /login if no valid session --- .../controllers/IndexController.php | 9 +++++- .../controllers/plugins/Acl_plugin.php | 11 ++++--- .../css/colorpicker/embeddable-player.css | 0 airtime_mvc/public/css/landing-page.css | 32 +++++++++++++++++++ 4 files changed, 47 insertions(+), 5 deletions(-) delete mode 100644 airtime_mvc/public/css/colorpicker/embeddable-player.css create mode 100644 airtime_mvc/public/css/landing-page.css diff --git a/airtime_mvc/application/controllers/IndexController.php b/airtime_mvc/application/controllers/IndexController.php index 232623bc9..ff1837b72 100644 --- a/airtime_mvc/application/controllers/IndexController.php +++ b/airtime_mvc/application/controllers/IndexController.php @@ -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() diff --git a/airtime_mvc/application/controllers/plugins/Acl_plugin.php b/airtime_mvc/application/controllers/plugins/Acl_plugin.php index 9eef38fdb..3249bd4a2 100644 --- a/airtime_mvc/application/controllers/plugins/Acl_plugin.php +++ b/airtime_mvc/application/controllers/plugins/Acl_plugin.php @@ -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()); } } } diff --git a/airtime_mvc/public/css/colorpicker/embeddable-player.css b/airtime_mvc/public/css/colorpicker/embeddable-player.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/airtime_mvc/public/css/landing-page.css b/airtime_mvc/public/css/landing-page.css new file mode 100644 index 000000000..099e62eb7 --- /dev/null +++ b/airtime_mvc/public/css/landing-page.css @@ -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; + } +}*/ +