コード例 #1
0
 public function execute() {
     $this->accountSettings = new Gpf_File_Settings(Gpf_Db_Account::DEFAULT_ACCOUNT_ID);
     $this->globalSettings = new Gpf_File_Settings();
     $this->globalSettings->getAll();
            
     $this->changeToGlobalSetting(Pap_Settings::PARAM_NAME_USER_ID);
     $this->changeToGlobalSetting(Pap_Settings::PARAM_NAME_BANNER_ID);
     $this->changeToGlobalSetting(Pap_Settings::PARAM_NAME_CAMPAIGN_ID);
     $this->changeToGlobalSetting(Pap_Settings::PARAM_NAME_ROTATOR_ID);
     $this->changeToGlobalSetting(Pap_Settings::PARAM_NAME_EXTRA_DATA);
     $this->changeToGlobalSetting(Pap_Settings::PARAM_NAME_EXTRA_DATA . '1');
     $this->changeToGlobalSetting(Pap_Settings::PARAM_NAME_EXTRA_DATA . '2');
     $this->changeToGlobalSetting(Pap_Settings::PARAM_NAME_DESTINATION_URL);
     $this->changeToGlobalSetting(Pap_Settings::DEBUG_TYPES);
     $this->changeToGlobalSetting(Pap_Settings::DELETE_COOKIE);
     $this->changeToGlobalSetting(Pap_Settings::P3P_POLICY_COMPACT);
     $this->changeToGlobalSetting(Pap_Settings::URL_TO_P3P);
     $this->changeToGlobalSetting(Pap_Settings::OVERWRITE_COOKIE);
     $this->changeToGlobalSetting(Pap_Settings::COOKIE_DOMAIN);
     $this->changeToGlobalSetting(Pap_Settings::IMPRESSIONS_TABLE_INPUT);
     $this->changeToGlobalSetting(Pap_Settings::IMPRESSIONS_TABLE_PROCESS);
     $this->changeToGlobalSetting(Pap_Settings::VISITS_TABLE_INPUT);
     $this->changeToGlobalSetting(Pap_Settings::VISITS_TABLE_PROCESS);
     $this->changeToGlobalSetting(Pap_Features_PayoutFieldsEncryption_Config::ENCRYPT_KEY);
     $this->changeToGlobalSetting(Pap_Features_PayoutFieldsEncryption_Config::ENCRYPT_IV);
 }
コード例 #2
0
 protected function execute(Gpf_Rpc_Params $params)
 {
     $form = new Gpf_Rpc_Form($params);
     if (!$form->getFieldValue(self::LICENSE_AGREE_NAME)) {
         $form->setFieldError(self::LICENSE_AGREE_NAME, $this->_('You have to agree license.'));
         $form->setErrorMessage($this->_('You have to agree license.'));
         return $form;
     }
     try {
         $setting = new Gpf_File_Settings();
         $settingsArray = $setting->getAll();
         if (is_array($settingsArray) && empty($settingsArray)) {
             $this->addDBDefaultSettings($setting);
         }
         $setting->saveAll();
         @chmod($setting->getSettingFileName(), 0777);
     } catch (Exception $e) {
         $form->setErrorMessage($this->_('Could not create settings file. Reason: %s', $e->getMessage()));
         return $form;
     }
     try {
         $info = $this->licenseManager->getLicense(trim($form->getFieldValue(self::LICENSE_ID_NAME)));
         if (!$info->isApplicationCodeValid()) {
             $form->setErrorMessage($this->_('Invalid license.'));
             return $form;
         }
     } catch (Exception $e) {
         $form->setErrorMessage($this->_('Could not validate license. Reason: %s', $e->getMessage()));
         return $form;
     }
     $this->setNextStep($form);
     return $form;
 }
コード例 #3
0
 private function writeFileData()
 {
     $accountId = Gpf_Session::getAuthUser()->getAccountId();
     $settings = new Gpf_File_Settings($accountId);
     foreach ($settings->getAll() as $name => $value) {
         $this->file->writeArray(array($name, $value));
     }
 }
コード例 #4
0
	public function execute() {
		$accountSettings = new Gpf_File_Settings(Gpf_Db_Account::DEFAULT_ACCOUNT_ID);
		$globalSettings = new Gpf_File_Settings();
		$globalSettings->getAll();

		$settingName = Gpf_Settings_Gpf::BENCHMARK_ACTIVE;
		if ($accountSettings->hasSetting($settingName)) {
			$globalSettings->setSetting($settingName, $accountSettings->getSetting($settingName));
			$accountSettings->removeSetting($settingName);
		}		
	}
コード例 #5
0
 private function writeFtpInfo($hostname, $directory, $username, $password)
 {
     $settingFile = new Gpf_File_Settings();
     try {
         $settingFile->getAll();
     } catch (Exception $e) {
     }
     $settingFile->setSetting(Gpf_Settings_Gpf::FTP_USERNAME, $username, false);
     $settingFile->setSetting(Gpf_Settings_Gpf::FTP_PASSWORD, $password, false);
     $settingFile->setSetting(Gpf_Settings_Gpf::FTP_HOSTNAME, $hostname, false);
     $settingFile->setSetting(Gpf_Settings_Gpf::FTP_DIRECTORY, $directory, false);
     $settingFile->saveAll();
 }
コード例 #6
0
 private function writeDbInfo()
 {
     $settingFile = new Gpf_File_Settings();
     try {
         $settingFile->getAll();
     } catch (Exception $e) {
     }
     $settingFile->setSetting(Gpf_Settings_Gpf::DB_HOSTNAME, $this->hostname, false);
     $settingFile->setSetting(Gpf_Settings_Gpf::DB_USERNAME, $this->username, false);
     $settingFile->setSetting(Gpf_Settings_Gpf::DB_PASSWORD, $this->password, false);
     $settingFile->setSetting(Gpf_Settings_Gpf::DB_DATABASE, $this->dbname, false);
     $settingFile->saveAll();
 }