Ejemplo n.º 1
0
 public function main()
 {
     $session = $this->container->session;
     if ($session->isStorageWorking()) {
         $this->setRedirect('index.php?view=main');
         return;
     }
     parent::main();
 }
Ejemplo n.º 2
0
 public function main()
 {
     $session = ASession::getInstance();
     if ($session->isStorageWorking()) {
         $this->setRedirect('index.php?view=main');
         return;
     }
     parent::main();
 }
Ejemplo n.º 3
0
 public function main()
 {
     /** @var AngieModelMauticConfiguration $config */
     $config = AModel::getAnInstance('Configuration', 'AngieModel', array(), $this->container);
     // These values are stored inside the session, after the setup step
     $old_url = $config->get('old_live_site');
     $new_url = $config->get('live_site');
     // If we are restoring to the same URL we don't need to replace any data
     if ($old_url == $new_url) {
         $this->setRedirect('index.php?view=finalise');
         return;
     }
     parent::main();
 }
 /**
  * @param int $order_id
  * @param AController $that
  */
 private function _load_releax_order_data($order_id, $that)
 {
     //data already loaded, return
     if ($this->r_data) {
         return null;
     }
     //load realex data
     $that->loadModel('extension/default_realex');
     $this->r_data = $that->model_extension_default_realex->getRealexOrder($order_id);
     if (!empty($this->r_data)) {
         $this->r_data['total_captured'] = $that->model_extension_default_realex->getTotalCaptured($this->r_data['realex_order_id']);
         $this->r_data['total_formatted'] = $that->currency->format($this->r_data['total'], $this->r_data['currency_code'], 1);
         $this->r_data['total_captured_formatted'] = $that->currency->format($this->r_data['total_captured'], $this->r_data['currency_code'], 1);
     }
 }
Ejemplo n.º 5
0
 public function main()
 {
     /** @var AngieModelWordpressConfiguration $config */
     $config = AModel::getAnInstance('Configuration', 'AngieModel', array(), $this->container);
     // These values are stored inside the session, after the setup step
     $old_url = $config->get('oldurl');
     $new_url = $config->get('homeurl');
     // If we are restoring to the same URL we don't need to replace any data
     if ($old_url == $new_url) {
         $this->setRedirect('index.php?view=finalise');
         return;
     }
     if ($this->input->getBool('force', false)) {
         $session = $this->container->session;
         $session->set('dataReplacements', null);
     }
     parent::main();
 }
Ejemplo n.º 6
0
 public function __construct($registry, $instance_id, $controller, $parent_controller = '')
 {
     parent::__construct($registry, $instance_id, $controller, $parent_controller);
     $this->attribute_manager = new AAttribute_Manager();
     $this->loadLanguage('catalog/attribute');
 }
Ejemplo n.º 7
0
 public function __construct($registry, $instance_id, $controller, $parent_controller = '')
 {
     parent::__construct($registry, $instance_id, $controller, $parent_controller);
     //load available groups for settings
     $this->groups = $this->config->groups;
 }
Ejemplo n.º 8
0
 /**
  * The main code of the Dispatcher. It spawns the necessary controller and
  * runs it.
  *
  * @return  null
  *
  * @throws  Exception
  */
 public function dispatch()
 {
     if (!$this->onBeforeDispatch()) {
         // For json, don't use normal 403 page, but a json encoded message
         if ($this->input->get('format', '') == 'json') {
             echo json_encode(array('code' => '403', 'error' => $this->getError()));
             exit;
         }
         throw new Exception(AText::_('ANGI_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
     }
     // Get and execute the controller
     $defaultApp = $this->container->application->getName();
     $option = $this->input->getCmd('option', $defaultApp);
     $view = $this->input->getCmd('view', $this->defaultView);
     $task = $this->input->getCmd('task', 'default');
     if (empty($task)) {
         $task = $this->getTask($view);
     }
     $this->input->set('view', $view);
     $this->input->set('task', $task);
     $config = $this->config;
     $config['input'] = $this->input;
     $controller = AController::getTmpInstance($option, $view, $config, $this->container);
     $status = $controller->execute($task);
     if ($status === false) {
         throw new Exception(AText::_('ANGI_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
     }
     if (!$this->onAfterDispatch()) {
         throw new Exception(AText::_('ANGI_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
     }
     // Issue the redirect only if we're not in JSON format
     if ($this->input->getCmd('format', '') != 'json') {
         $controller->redirect();
     }
 }
Ejemplo n.º 9
0
 public function accessRules()
 {
     parent::accessRules();
     return array(array('allow', 'actions' => array('index', 'detail', 'add', 'edit', 'delete'), 'roles' => array('admin', 'manager')), array('allow', 'actions' => array('index', 'detail', 'add', 'edit', 'delete'), 'roles' => array('storeadmin', 'storemanager')), array('deny', 'users' => array('*')));
 }
Ejemplo n.º 10
0
 public function __construct($registry, $instance_id, $controller, $parent_controller = '')
 {
     parent::__construct($registry, $instance_id, $controller, $parent_controller);
     $this->rest = new ARest();
 }
Ejemplo n.º 11
0
 public function someOptionalArgumentsAction($arg1, $arg2 = 'optionalValue')
 {
     self::$optionalValue = $arg2;
     self::$nonOptionalValue = $arg1;
     return new ModelAndView('main');
 }
Ejemplo n.º 12
0
 function __construct($config = ['autoescape' => false, 'cache' => 'cache'])
 {
     parent::__construct($config);
 }
Ejemplo n.º 13
0
 public function accessRules()
 {
     parent::accessRules();
     return array(array('allow', 'actions' => array('index', 'checkCode', 'listStore', 'administrator', 'detail', 'add', 'addAjax', 'edit', 'status', 'delete'), 'roles' => array('admin', 'manager')), array('allow', 'actions' => array('index', 'checkCode', 'detail', 'add', 'edit', 'delete', 'status'), 'roles' => array('storeadmin', 'storemanager')), array('deny', 'users' => array('*')));
 }
Ejemplo n.º 14
0
 function beforeAction($action)
 {
     $this->cate = Cate::model()->findByPk($this->get('cid'));
     return parent::beforeAction($action);
 }
Ejemplo n.º 15
0
 public function __construct($id, $module = null)
 {
     parent::__construct($id, $module);
     $this->menu = array();
 }