/** * @return bool */ protected function LoadXML() { if (@file_exists(INI_DIR . '/settings/' . self::FILE_NAME)) { $return = file_get_contents(INI_DIR . '/settings/' . self::FILE_NAME); if (false !== $return) { $xmlDocument = new XmlDocument(); if ($xmlDocument->LoadFromString($return)) { return $this->initFromXmlRoot($xmlDocument->XmlRoot); } } return false; } return true; }
/** * @return bool */ protected function LoadXML() { if (@file_exists(INI_DIR . '/settings/filters.xml')) { $return = file_get_contents(INI_DIR . '/settings/filters.xml'); if (false !== $return) { $xmlDocument = new XmlDocument(); if ($xmlDocument->LoadFromString($return)) { return $this->initFromXmlRoot($xmlDocument->XmlRoot, $this->_main); } } return false; } return true; }
/** * @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)); } }