Example #1
0
 public function init()
 {
     Controller::initParams();
     // this method is called when the module is being created
     // you may place code here to customize the module or the application
     Yii::app()->setComponent('bootstrap', array('class' => 'ext.bootstrap.components.Bootstrap', 'responsiveCss' => true));
     Yii::setPathOfAlias('bootstrap', dirname(__FILE__) . DIRECTORY_SEPARATOR . '../../extensions/bootstrap');
     Yii::app()->bootstrap->init();
     // import the module-level models and components
     $this->setImport(array('admin.models.*', 'admin.components.*'));
     Yii::app()->setComponents(array('user' => array('class' => 'AdminUser', 'loginUrl' => Yii::app()->createAbsoluteUrl('admin/login'), 'allowAutoLogin' => true)), true);
     $this->layout = 'application.modules.admin.views.layouts.column1';
     if (Yii::app()->params['STORE_OFFLINE'] == '-1') {
         die('Admin Panel unavailable due to account suspension.');
     }
     if (isset($_POST['url']) && isset($_POST['password'])) {
         $model = new LoginForm();
         if ($model->loginLightspeed($_POST['user'], $_POST['password'])) {
             Yii::app()->getRequest()->redirect(Yii::app()->createUrl("/admin"));
         } else {
             die("You have an invalid password set in your eCommerce options. Cannot continue.");
         }
     }
     if (!Yii::app()->user->isGuest) {
         if (Yii::app()->user->shouldLogOut()) {
             Yii::app()->user->logout(false);
         }
     }
     _xls_set_conf('ADMIN_PANEL', date("Y-m-d H:i:s"));
     parent::init();
 }
 public function init()
 {
     Controller::initParams();
     if (Yii::app()->params['INSTALLED'] != '1') {
         die;
     }
 }
 public function init()
 {
     Controller::initParams();
     if (Yii::app()->params['INSTALLED'] != '1') {
         die;
     }
     //No soap when not installed (or partially installed)
     //do nothing since we don't need a PHP session created for SOAP transactions
 }
 /**
  * @return array action filters
  */
 public function init()
 {
     Controller::initParams();
 }
 public function init()
 {
     Controller::initParams();
     //do nothing so we don't create a cart
 }
 public function init()
 {
     Controller::initParams();
     //We avoid loading our init since it's not necessary for an XML feed
 }
 /**
  * Master function to call the other upgrade steps
  */
 public function actionUpgrade()
 {
     Controller::initParams();
     $this->online = _xls_number_only($_POST['online']);
     if (isset($_GET['debug'])) {
         Yii::log("InstallController on line " . $this->online, 'error', 'application.' . __CLASS__ . "." . __FUNCTION__);
     }
     if ($this->online == 1) {
         $retval = $this->actionConvertStart();
     }
     if ($this->online == 3) {
         $retval = $this->actionConvertAddressBook();
     }
     if ($this->online == 8) {
         $retval = $this->actionConvertModules();
     }
     if ($this->online >= 9 && $this->online <= 13) {
         $retval = $this->actionConvertGoogle();
     }
     if ($this->online == 14) {
         $retval = $this->actionConvertKeywordsToTags();
     }
     if ($this->online == 15) {
         $retval = $this->actionConvertFamilies();
     }
     if ($this->online == 16) {
         $retval = $this->actionConvertClasses();
     }
     if ($this->online == 18) {
         $retval = $this->actionConvertDestinationTables();
     }
     if ($this->online == 19) {
         $retval = $this->actionDropcartfields1();
     }
     if ($this->online == 20) {
         $retval = $this->actionDropcartfields2();
     }
     if ($this->online == 21) {
         $retval = $this->actionDropcartfields3();
     }
     if ($this->online == 25) {
         $retval = $this->actionConvertProductSEO();
     }
     if ($this->online == 26) {
         $retval = $this->actionDropcustomerfields();
     }
     if ($this->online == 27) {
         $retval = $this->actionDropProductFields();
     }
     if ($this->online == 28) {
         $retval = $this->actionCalculateInventory();
     }
     if ($this->online == 29) {
         $retval = $this->actionUpdateConfiguration();
     }
     if ($this->online == 2) {
         $result = $this->runMigration();
         if ($result == 50) {
             $this->online = 3;
         }
         $retval = array('result' => "success", 'makeline' => $this->online, 'tag' => 'Migrating Database', 'total' => 50);
     }
     if ($retval != null) {
         if (isset($_GET['debug'])) {
             if (isset($retval['tag'])) {
                 $retval['tag'] .= " online " . $this->online;
             } else {
                 $retval['tag'] = " online " . $this->online;
             }
         }
         echo json_encode($retval);
     }
 }