Example #1
0
 public function savePage($page)
 {
     switch ($page) {
         case 2:
             if (!_xls_get_conf('LIGHTSPEED_CLOUD', 0) > 0) {
                 _xls_set_conf('LSKEY', strtolower(md5($this->LSKEY)));
             }
             _xls_set_conf('TIMEZONE', $this->TIMEZONE);
             Configuration::exportKeys($this->encryptionKey, $this->encryptionSalt);
             //Now that we have encryption keys written, save the account if we have it
             if (!empty($this->loginemail) && !empty($this->loginpassword)) {
                 $objCustomer = Customer::LoadByEmail($this->loginemail);
                 if (!$objCustomer instanceof Customer) {
                     $objCustomer = new Customer();
                     $objCustomer->first_name = "Admin";
                     $objCustomer->last_name = "User";
                     $objCustomer->record_type = 1;
                     $objCustomer->pricing_level = 1;
                     $objCustomer->preferred_language = "en";
                     $objCustomer->currency = "USD";
                     $objCustomer->email = $this->loginemail;
                     $objCustomer->mainphone = _xls_get_conf('STORE_PHONE');
                 }
                 $objCustomer->password = _xls_encrypt($this->loginpassword);
                 $objCustomer->allow_login = 2;
                 $objCustomer->save();
             }
             break;
         case 3:
             _xls_set_conf('STORE_NAME', $this->STORE_NAME);
             _xls_set_conf('EMAIL_FROM', $this->EMAIL_FROM);
             _xls_set_conf('STORE_ADDRESS1', $this->STORE_ADDRESS1);
             _xls_set_conf('STORE_ADDRESS2', $this->STORE_ADDRESS2);
             _xls_set_conf('STORE_CITY', $this->STORE_CITY);
             _xls_set_conf('STORE_STATE', $this->STORE_STATE);
             _xls_set_conf('STORE_COUNTRY', $this->STORE_COUNTRY);
             _xls_set_conf('STORE_ZIP', $this->STORE_ZIP);
             _xls_set_conf('STORE_HOURS', $this->STORE_HOURS);
             _xls_set_conf('STORE_PHONE', $this->STORE_PHONE);
             break;
         case 4:
             if (is_null($this->EMAIL_SMTP_SERVER)) {
                 $this->EMAIL_SMTP_SERVER = '';
             }
             if (is_null($this->EMAIL_SMTP_PORT)) {
                 $this->EMAIL_SMTP_PORT = '';
             }
             if (is_null($this->EMAIL_SMTP_USERNAME)) {
                 $this->EMAIL_SMTP_USERNAME = '';
             }
             if (is_null($this->EMAIL_SMTP_PASSWORD)) {
                 $this->EMAIL_SMTP_PASSWORD = '';
             }
             _xls_set_conf('EMAIL_SMTP_SERVER', $this->EMAIL_SMTP_SERVER);
             _xls_set_conf('EMAIL_SMTP_PORT', $this->EMAIL_SMTP_PORT);
             _xls_set_conf('EMAIL_SMTP_USERNAME', $this->EMAIL_SMTP_USERNAME);
             _xls_set_conf('EMAIL_SMTP_PASSWORD', _xls_encrypt($this->EMAIL_SMTP_PASSWORD));
             _xls_set_conf('EMAIL_SMTP_SECURITY_MODE', $this->EMAIL_SMTP_SECURITY_MODE);
             break;
     }
 }