public function init() { parent::init(); // Test si un id de value est passé en paramètre if ($id = $this->getRequest()->getParam('option_value_id')) { // Créé et charge l'objet $this->_current_option_value = new Application_Model_Option_Value(); $this->_current_option_value->find($id); // Récupère le layout de l'option_value en cours if ($this->_current_option_value->getLayoutId()) { $this->_layout_id = $this->_current_option_value->getLayoutId(); } } $excluded = '/(' . join(')|(', array('front_mobile_home_view', 'application_device_check', 'customer_mobile_account', 'customer_mobile_account_autoconnect', 'push_mobile_list', 'push_mobile_count', 'application_mobile_customization_colors', 'application_mobile_previewer_infos', 'front_mobile_gmaps_view', 'mcommerce_mobile_cart_view')) . ')/'; if (!$this->_current_option_value and !preg_match($excluded, $this->getFullActionName('_'))) { $this->_redirect('/'); return $this; } else { if ($this->getFullActionName('_') == 'front_mobile_home_view') { $this->_layout_id = $this->getApplication()->getLayoutId(); } else { $this->_layout_id = 1; //$this->_current_option_value->getLayout()->getCode(); } } Core_View_Mobile_Default::setCurrentOption($this->_current_option_value); $this->log(); return $this; }
public function init() { parent::init(); if (!$this->getSession()->isLoggedIn('admin') and !preg_match('/(login)|(forgotpassword)|(change)|(map)|(signuppost)|(check)/', $this->getRequest()->getActionName()) and !$this->getRequest()->isInstalling()) { $this->_forward('login', 'account', 'admin'); return $this; } }
public function init() { parent::init(); $allowed = array("backoffice_index_index", "backoffice_account_login_index", "backoffice_account_login_post", "backoffice_account_login_forgottenpassword"); if (!$this->getSession(Core_Model_Session::TYPE_BACKOFFICE)->isLoggedIn() and !in_array($this->getFullActionName("_"), $allowed) and !$this->getRequest()->isInstalling() and !$this->getRequest()->isXmlHttpRequest() and !preg_match("/(_template)/", $this->getFullActionName("_"))) { $this->forward('login', 'account', 'backoffice'); return $this; } }
public function init() { parent::init(); if (!preg_match("/admin_api_account_autologin/", $this->getFullActionName("_"))) { $username = $this->getRequest()->getServer("PHP_AUTH_USER"); $password = $this->getRequest()->getServer("PHP_AUTH_PW"); $user = new Api_Model_User(); $user->find($username, "username"); if (!$user->getId() or !$user->authenticate($password)) { $this->_forward("notauthorized"); } } return $this; }
public function init() { parent::init(); $this->_admin = $this->getSession()->getAdmin(); if (!$this->getSession()->isLoggedIn() and !preg_match('/(login)|(forgotpassword)|(change)|(map)|(signuppost)|(check)/', $this->getRequest()->getActionName()) and !$this->getRequest()->isInstalling()) { $this->_forward('login', 'account', 'admin'); return $this; } if (!$this->_canAccessCurrentPage()) { $this->_forward("forbidden"); return; } $this->getSession()->editing_app_id = null; }
public function init() { parent::init(); $this->_layout_id = 1; // Test si un id de value est passé en paramètre $id = $this->getRequest()->getParam('option_value_id'); if (!$id) { $id = $this->getRequest()->getParam('value_id'); } if (!$id) { try { $data = Zend_Json::decode($this->getRequest()->getRawBody()); if ($data && !empty($data['value_id'])) { $id = $data['value_id']; } } catch (Zend_Json_Exception $e) { $id = null; } catch (Exception $e) { $id = null; } } if ($id) { // Créé et charge l'objet $this->_current_option_value = new Application_Model_Option_Value(); if ($id != "homepage") { $this->_current_option_value->find($id); // Récupère le layout de l'option_value en cours if ($this->_current_option_value->getLayoutId()) { $this->_layout_id = $this->_current_option_value->getLayoutId(); } } else { $this->_current_option_value->setIsHomepage(true); } } // $excluded = '/('.join(')|(', // array( // 'front_mobile_home_view', // 'front_mobile_home_template', // 'application_device_check', // 'customer_mobile_account', // 'customer_mobile_account_autoconnect', // 'push_mobile_list', // 'push_mobile_count', // 'application_mobile_customization_colors', // 'application_mobile_previewer_infos', // 'front_mobile_gmaps_view', // 'mcommerce_mobile_cart_view', // 'findall', // 'find', // 'backgroundimage' // ) // ).')/'; // // Zend_Debug::dump($excluded);die; // // if(!$this->_current_option_value AND !preg_match($excluded, $this->getFullActionName('_'))) { // $this->_redirect('/'); // return $this; // } // else if ($this->getFullActionName('_') == 'front_mobile_home_view') { $this->_layout_id = $this->getApplication()->getLayoutId(); } Core_View_Mobile_Default::setCurrentOption($this->_current_option_value); $this->_log(); return $this; }
public function init() { return parent::init(); }