예제 #1
0
 /**
  * @param	string	$dataFolderPath
  */
 function WebMail_Settings($dataFolderPath, $webFolderPath)
 {
     $this->_path =& $dataFolderPath;
     $this->_webpath =& $webFolderPath;
     $this->UseDsn = false;
     $this->AllowUsersChangeAccountsDef = false;
     $this->AllowContacts = true;
     $this->AllowCalendar = true;
     $this->Imap4DeleteLikePop3 = true;
     $this->AllowLanguageOnLogin = true;
     $this->UseCaptcha = true;
     $this->EnableWmServer = false;
     $this->WmServerHost = '127.0.0.1';
     $this->WmAllowManageXMailAccounts = false;
     $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->AllowInsertImage = true;
     $this->AllowBodySize = false;
     $this->MaxBodySize = 600;
     $this->MaxSubjectSize = 255;
     $this->AllowRegistration = false;
     $this->AllowPasswordReset = false;
     $this->EnableEventsLogging = false;
     $this->LoggingSpecialUsers = false;
     $this->LogLevel = WM_LOG_LEVEL_DEBUG;
     $this->UseMultipleDomainsSelection = false;
     $this->GlobalAddressBook = WM_GLOBAL_ADDRESS_BOOK_DOMAIN;
     $this->EnableMobileSync = false;
     $this->MobileSyncUrl = 'http://your.host.com:8080/funambol/ds';
     $this->MobileSyncContactDataBase = 'card';
     $this->MobileSyncCalendarDataBase = 'cal';
     $this->FlagsLangSelect = false;
     $this->ViewMode = WM_NEW_VIEW_MODE_CENTRAL_LIST_PANE;
     $this->SaveInSent = WM_SAVE_IN_SENT_ALWAYS;
     $this->isLoad = false;
     $this->_langIsInclude = false;
     $xmlDocument = new XmlDocument();
     if ($xmlDocument->LoadFromFile($this->_path . '/settings/settings.xml')) {
         $this->isLoad = true;
         $this->_loadFromXML($xmlDocument->XmlRoot);
         /* custom class */
         ap_Custom::StaticUseMethod('wm_ChangeSettingsAfterLoad', array(&$this));
     }
 }
예제 #2
0
 function _initSettings()
 {
     $_path = $this->GetCfg('adminpanel_data_path');
     $_xml = new XmlDocument();
     if ($_path === false || !@file_exists($_path . '/settings/' . AP_XML_CFG_FILE)) {
         $this->_ge(ap_Utils::TakePhrase('AP_LANG_FILE_ERROR_OCCURRED'));
         exit;
     }
     if ($_xml->LoadFromFile($_path . '/settings/' . AP_XML_CFG_FILE)) {
         $_advanced_options =& $_xml->XmlRoot->GetChildNodeByTagName('advancedoptions');
         if ($_advanced_options) {
             $this->_cfg['advancedoptions'] = (bool) $_advanced_options->Value;
         }
         $_license_node =& $_xml->XmlRoot->GetChildNodeByTagName('licensekey');
         if ($_license_node) {
             $this->_cfg[AP_TEST_P] = trim(ap_Utils::DecodeSpecialXmlChars($_license_node->Value));
         }
         $_plugins =& $_xml->XmlRoot->GetChildNodeByTagName('plugins');
         if ($_plugins) {
             $this->_cfg['plugins'] = array();
             if (!$_plugins->Children) {
                 $_plugins->Children = array();
             }
             foreach ($_plugins->Children as $_node) {
                 if ($_node->TagName == 'plugin') {
                     $_ipath = CAdminPanel::RootPath() . '/plugins/' . trim($_node->Value) . '/index.php';
                     if (@file_exists($_ipath)) {
                         $this->_cfg['plugins'][] = trim(ap_Utils::DecodeSpecialXmlChars($_node->Value));
                     }
                 }
             }
             if (@file_exists(CAdminPanel::RootPath() . '/plugins/common/index.php')) {
                 $this->_cfg['plugins'][] = 'common';
             }
         }
         $_login_node =& $_xml->XmlRoot->GetChildNodeByTagName('login');
         if ($_login_node && $_login_node->Children && is_array($_login_node->Children)) {
             foreach ($_login_node->Children as $_node) {
                 $this->_cfg['login'][trim($_node->TagName)] = trim(ap_Utils::DecodeSpecialXmlChars($_node->Value));
             }
         }
         $_resp = $this->ValidateCfg($this->_cfg);
         if ($_resp !== true) {
             $this->_ge($_resp);
         }
     }
 }
예제 #3
0
파일: plugin.php 프로젝트: JDevelopers/Mail
 /**
  * @param	string	$_licenseKey
  * @return	bool
  */
 function _saveLicenseKeyData($_licenseKey)
 {
     $_ap =& $this->GetAp();
     $_path = $_ap->GetCfg('adminpanel_data_path');
     $_xml = new XmlDocument();
     if ($_path !== false && $_xml->LoadFromFile($_path . '/settings/' . AP_XML_CFG_FILE)) {
         $_license_node =& $_xml->XmlRoot->GetChildNodeByTagName('licensekey');
         if ($_license_node) {
             $_license_node->Value = ap_Utils::EncodeSpecialXmlChars($_licenseKey);
         } else {
             $_plugins = new XmlDomNode('licensekey', ap_Utils::EncodeSpecialXmlChars($_licenseKey));
             $_xml->XmlRoot->AppendChild($_plugins);
         }
         if ($_xml->SaveToFile($_path . '/settings/' . AP_XML_CFG_FILE)) {
             return true;
         }
     } else {
         $_ap->GlobalError(ap_Utils::TakePhrase('CM_FILE_ERROR_OCCURRED'));
     }
     return false;
 }