From a90b97fb5511674137ca11986ec210bdd458d49f Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Wed, 14 Oct 2015 14:28:39 -0400 Subject: [PATCH] SAAS-1128: Logging in from www.airtime.pro doesn't trigger lang/timezone setup dialog --- airtime_mvc/application/configs/constants.php | 1 + .../application/controllers/ShowbuilderController.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/configs/constants.php b/airtime_mvc/application/configs/constants.php index dd421a9d9..7f6b585bb 100644 --- a/airtime_mvc/application/configs/constants.php +++ b/airtime_mvc/application/configs/constants.php @@ -4,6 +4,7 @@ define('PRODUCT_NAME' , 'Airtime'); define('PRODUCT_SITE_URL' , 'http://airtime.sourcefabric.org'); define('SAAS_PRODUCT_BRANDING_NAME', 'Airtime Pro'); +define('SAAS_LOGIN_REFERRER', 'https://www.airtime.pro/'); define('COMPANY_NAME' , 'Sourcefabric'); define('COMPANY_SUFFIX' , 'z.รบ.'); diff --git a/airtime_mvc/application/controllers/ShowbuilderController.php b/airtime_mvc/application/controllers/ShowbuilderController.php index 02db188e7..77f4cfa75 100644 --- a/airtime_mvc/application/controllers/ShowbuilderController.php +++ b/airtime_mvc/application/controllers/ShowbuilderController.php @@ -107,10 +107,11 @@ class ShowbuilderController extends Zend_Controller_Action $CC_CONFIG = Config::getConfig(); $baseUrl = Application_Common_OsPath::getBaseDir(); $setupComplete = Application_Model_Preference::getLangTimezoneSetupComplete(); - $previousPage = $request->getHeader('Referer'); + $previousPage = strtolower($request->getHeader('Referer')); $userService = new Application_Service_UserService(); $currentUser = $userService->getCurrentUser(); - $previousPageWasLoginScreen = strpos(strtolower($previousPage), 'login') !== false; + $previousPageWasLoginScreen = (strpos($previousPage, 'login') !== false) || + ($previousPage == SAAS_LOGIN_REFERRER); // If current user is Super Admin, and they came from the login page, // and they have not seen the setup popup before