public function executesetcountry($eventData)
 {
     $userCfg = new UserSettings(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserId());
     $userCfg->setKey('desktop-country', $eventData['country']);
     $domainSettings = new DomainSettings(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess());
     if (User::isAdminUser(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserName(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDomainId())) {
         $domainSettings->EditKey('desktop-country', $eventData['country']);
     }
     $this->status = $this->localeCatalog->getStr('countryset_status');
     $this->setChanged();
     $this->notifyObservers('status');
     $this->notifyObservers('javascript');
 }
Example #2
0
 /**
  * @access private
  */
 function Settings($param = true)
 {
     if (!is_null($param)) {
         die('can\'t call Settings class.');
     }
     $this->UseDsn = false;
     $this->WmServerHost = '127.0.0.1';
     $this->AllowUsersChangeAccountsDef = false;
     $this->WmAllowManageXMailAccounts = false;
     $this->AllowContacts = true;
     $this->AllowCalendar = true;
     $this->UseCaptcha = true;
     $this->Cal_DefaultTimeFormat = 1;
     $this->Cal_DefaultTimeZone = 38;
     $this->Cal_DefaultDateFormat = 1;
     $this->Cal_ShowWeekends = true;
     $this->Cal_WorkdayStarts = 9;
     $this->Cal_WorkdayEnds = 18;
     $this->Cal_ShowWorkDay = 1;
     $this->Cal_WeekStartsOn = 0;
     $this->Cal_DefaultTab = 2;
     $this->Cal_DefaultCountry = 'US';
     $this->Cal_AllTimeZones = false;
     $this->Cal_AllowReminders = false;
     $this->Cal_AutoAddInvitation = 0;
     $this->Imap4DeleteLikePop3 = true;
     $this->AllowLanguageOnLogin = true;
     $this->AllowInsertImage = true;
     $this->AllowBodySize = false;
     $this->MaxBodySize = 600;
     $this->MaxSubjectSize = 255;
     $this->AllowRegistration = false;
     $this->AllowPasswordReset = false;
     $this->GlobalAddressBook = GLOBAL_ADDRESS_BOOK_OFF;
     $this->EnableMobileSync = false;
     $this->MobileSyncUrl = '';
     $this->MobileSyncContactDataBase = 'card';
     $this->MobileSyncCalendarDataBase = 'cal';
     $this->FlagsLangSelect = false;
     $this->ViewMode = 1;
     $this->SaveInSent = 0;
     $this->isLoad = false;
     $this->_langIsInclude = false;
     $this->Dev = null;
     $settingsCacher = new SettingsCacher();
     $settingsRaw = $settingsCacher->Load();
     if (false === $settingsRaw) {
         $settingsRaw = $settingsCacher->LoadRoot();
         if ($settingsRaw == false) {
             setGlobalError($settingsCacher->GetError());
         } else {
             $settingsCacher->Save($settingsRaw);
         }
     } else {
         if (is_array($settingsRaw)) {
             $this->_loadFromArray($settingsRaw);
             $this->isLoad = true;
         }
     }
     if (is_string($settingsRaw)) {
         $xmlDocument = new XmlDocument();
         if ($xmlDocument->LoadFromString($settingsRaw)) {
             $this->_loadFromXML($xmlDocument->XmlRoot);
             $this->isLoad = true;
         }
     }
     if ($this->isLoad) {
         if (!@function_exists('imagecreatefrompng')) {
             $this->UseCaptcha = false;
         }
         $xmlDomainSettings =& DomainSettings::CreateInstance();
         $xmlDomainSettings->UpdateSettingsByDomain($this);
         /* custom class */
         wm_Custom::StaticUseMethod('ChangeSettingsAfterLoad', array(&$this));
     }
 }
Example #3
0
 public function getCountry()
 {
     $domain_settings = new DomainSettings($this->dataAccess);
     $key = $domain_settings->getKey('desktop-country');
     return strlen($key) ? $key : $this->container->getCountry();
 }