public function SystemLogging() { if (isset($_POST['btnClearLog']) || isset($_POST['btnUserActivityClearLog'])) { /* @var $oApiLoggerManager CApiLoggerManager */ $oApiLoggerManager = CApi::Manager('logger'); $bResult = false; if (isset($_POST['btnClearLog'])) { $bResult = $oApiLoggerManager->DeleteCurrentLog(); } else { $bResult = $oApiLoggerManager->DeleteCurrentUserActivityLog(); } if ($bResult) { $this->LastMessage = WM_INFO_LOGCLEARSUCCESSFUL; } else { $this->LastError = AP_LANG_ERROR; } } else { if ($this->isStandartSubmit()) { $this->oSettings->SetConf('Common/EnableLogging', CPost::GetCheckBox('ch_EnableDebugLogging')); $this->oSettings->SetConf('Common/EnableEventLogging', CPost::GetCheckBox('ch_EnableUserActivityLogging')); $this->oSettings->SetConf('Common/LoggingLevel', EnumConvert::FromPost(CPost::Get('selVerbosity', ''), 'ELogLevel')); $this->checkBolleanWithMessage($this->oSettings->SaveToXml()); } } }
protected function initUpdateDomainByPost(CDomain &$oDomain) { $oDomain->OverrideSettings = CPost::GetCheckBox('chOverrideSettings'); if (CPost::Has('txtIncomingMailHost') && CPost::Has('txtOutgoingMailHost') && CPost::Has('txtIncomingMailPort') && CPost::Has('txtOutgoingMailPort')) { $oDomain->IncomingMailServer = CPost::get('txtIncomingMailHost'); $oDomain->IncomingMailPort = CPost::get('txtIncomingMailPort'); $oDomain->IncomingMailUseSSL = CPost::GetCheckBox('chIncomingUseSSL'); $oDomain->OutgoingMailServer = CPost::get('txtOutgoingMailHost'); $oDomain->OutgoingMailPort = CPost::get('txtOutgoingMailPort'); $oDomain->OutgoingMailUseSSL = CPost::GetCheckBox('chOutgoingUseSSL'); } if (CPost::Has('radioAuthType')) { $oDomain->OutgoingMailAuth = EnumConvert::FromPost(CPost::get('radioAuthType'), 'ESMTPAuthType'); } if (CPost::Has('txtOutgoingMailLogin') && CPost::Has('txtOutgoingMailPassword')) { $oDomain->OutgoingMailLogin = CPost::get('txtOutgoingMailLogin'); if ((string) AP_DUMMYPASSWORD !== (string) CPost::get('txtOutgoingMailPassword')) { $oDomain->OutgoingMailPassword = CPost::get('txtOutgoingMailPassword', ''); } } if (CPost::Has('selIncomingMailProtocol')) { $oDomain->IncomingMailProtocol = EnumConvert::FromPost(CPost::get('selIncomingMailProtocol'), 'EMailProtocol'); } // if ($oDomain->OverrideSettings || $oDomain->IsDefaultDomain) // { // $oDomain->ExternalHostNameOfDAVServer = CPost::Get('txtExternalHostNameOfDAVServer', $oDomain->ExternalHostNameOfDAVServer); // $oDomain->ExternalHostNameOfLocalImap = CPost::Get('txtExternalHostNameOfLocalImap', $oDomain->ExternalHostNameOfLocalImap); // $oDomain->ExternalHostNameOfLocalSmtp = CPost::Get('txtExternalHostNameOfLocalSmtp', $oDomain->ExternalHostNameOfLocalSmtp); // } if ($oDomain->OverrideSettings) { // General $oDomain->Url = (string) CPost::get('txtWebDomain', $oDomain->Url); $oDomain->AllowUsersChangeEmailSettings = CPost::GetCheckBox('chAllowUsersAccessAccountsSettings'); $oDomain->AllowNewUsersRegister = !CPost::GetCheckBox('chAllowNewUsersRegister'); // Webmail $oDomain->AllowWebMail = CPost::GetCheckBox('chEnableWebmail'); $oDomain->MailsPerPage = CPost::get('selMessagesPerPage', $oDomain->MailsPerPage); $oDomain->AutoCheckMailInterval = CPost::get('selAutocheckMail', $oDomain->AutoCheckMailInterval); if (CPost::Has('radioLayout')) { $oDomain->Layout = EnumConvert::FromPost(CPost::get('radioLayout'), 'ELayout'); } // Address Book $oDomain->AllowContacts = CPost::GetCheckBox('chEnableAddressBook'); $oDomain->ContactsPerPage = CPost::get('selContactsPerPage', $oDomain->ContactsPerPage); } }
public function SystemDb() { if (CApi::getCsrfToken('p7admToken') === CPost::get('txtToken')) { if (CApi::GetConf('mailsuite', false)) { $this->oSettings->SetConf('Common/DBType', EDbType::MySQL); } else { $this->oSettings->SetConf('Common/DBType', EnumConvert::FromPost(CPost::get('radioSqlType'), 'EDbType')); } if (CPost::Has('txtSqlLogin')) { $this->oSettings->SetConf('Common/DBLogin', CPost::get('txtSqlLogin')); } if (CPost::Has('txtSqlPassword') && AP_DUMMYPASSWORD !== (string) CPost::get('txtSqlPassword')) { $this->oSettings->SetConf('Common/DBPassword', CPost::get('txtSqlPassword')); } if (CPost::Has('txtSqlName')) { $this->oSettings->SetConf('Common/DBName', CPost::get('txtSqlName')); } if (CPost::Has('txtSqlSrc')) { $this->oSettings->SetConf('Common/DBHost', CPost::get('txtSqlSrc')); } if (CPost::GetCheckBox('isTestConnection')) { CDbCreator::ClearStatic(); $aConnections =& CDbCreator::CreateConnector($this->oSettings); $oConnect = $aConnections[0]; if ($oConnect) { $this->LastError = AP_LANG_CONNECTUNSUCCESSFUL; try { if ($oConnect->Connect()) { $this->LastMessage = AP_LANG_CONNECTSUCCESSFUL; $this->LastError = ''; } } catch (CApiDbException $oException) { $this->LastError .= "\r\n" . $oException->getMessage() . ' (' . (int) $oException->getCode() . ')'; } } else { $this->LastError = AP_LANG_CONNECTUNSUCCESSFUL; } $this->oSettings->SaveToXml(); } else { $this->saveSettingsXmlWithMessage(); } } return ''; }
protected function initUpdateDomainByPost(CDomain &$oDomain) { $oDomain->OverrideSettings = 0 < $oDomain->IdTenant ? true : CPost::GetCheckBox('chOverrideSettings'); if ($oDomain->OverrideSettings) { // Regional settings and domain branding (moved from "webmail" module) $oDomain->SiteName = CPost::Get('txtSiteName', $oDomain->SiteName); $oDomain->AllowUsersChangeInterfaceSettings = CPost::GetCheckBox('chAllowUsersAccessInterfaveSettings'); $sSelSkin = CPost::Get('selSkin', ''); if (!empty($sSelSkin)) { $aSkins = $this->oModule->GetSkinList(); if (is_array($aSkins) && in_array($sSelSkin, $aSkins)) { $oDomain->DefaultSkin = $sSelSkin; } } $sSelLanguage = CPost::Get('selLanguage', ''); if (!empty($sSelLanguage)) { $aLangs = $this->oModule->GetLangsList(); if (is_array($aLangs) && in_array($sSelLanguage, $aLangs)) { $oDomain->DefaultLanguage = $sSelLanguage; } } $sSelTimeZone = CPost::Get('selTimeZone', null); if (null !== $sSelTimeZone) { $aTimeZones = $this->oModule->GetTimeZoneList(); if (is_array($aTimeZones) && isset($aTimeZones[(int) $sSelTimeZone])) { $oDomain->DefaultTimeZone = $sSelTimeZone; } } if (CPost::Has('radioTimeFormat')) { $oDomain->DefaultTimeFormat = EnumConvert::FromPost(CPost::Get('radioTimeFormat'), 'ETimeFormat'); } if (CPost::Has('selDateformat')) { $oDomain->DefaultDateFormat = CPost::Get('selDateformat'); } } }
</span> </td> <td class="wm_field_value"> <input type="radio" class="wm_checkbox override" name="radioTimeFormat" id="radioTimeFormat12" value="<?php echo EnumConvert::ToPost(ETimeFormat::F12, 'ETimeFormat'); ?> " <?php $this->Data->PrintCheckedValue('radioTimeFormat12'); ?> x-data-label="radioTimeFormat_label" /> <label id="radioTimeFormat12_label" for="radioTimeFormat12">1PM</label> <input type="radio" class="wm_checkbox override" name="radioTimeFormat" id="radioTimeFormat24" value="<?php echo EnumConvert::ToPost(ETimeFormat::F24, 'ETimeFormat'); ?> " <?php $this->Data->PrintCheckedValue('radioTimeFormat24'); ?> x-data-label="radioTimeFormat_label" /> <label id="radioTimeFormat24_label" for="radioTimeFormat24">13:00</label> </td> </tr> <tr> <td class="wm_field_title"> <span id="radioTimeFormat_label"> <?php echo CApi::I18N('ADMIN_PANEL/DOMAINS_GENERAL_DATEFORMAT'); ?> </span>
/** * @param string $sKey * @param string $sValue * * @return string */ protected function specBackConver($sKey, $sValue) { $mResult = $sValue; $sEnumName = $this->xmlPathToEnumName($sKey); if (null !== $sEnumName) { $mResult = EnumConvert::ToXml($sValue, $sEnumName); } return $mResult; }
?>" <?php $this->Data->PrintCheckedValue('radioAuthTypeAuthSpecified'); ?> /> <label id="radioAuthTypeAuthSpecified_label" for="radioAuthTypeAuthSpecified"><?php echo CApi::I18N('ADMIN_PANEL/DOMAINS_SMTP_AUTH_LOGIN'); ?></label> <input type="text" name="txtOutgoingMailLogin" id="txtOutgoingMailLogin" class="wm_input" value="<?php $this->Data->PrintInputValue('txtOutgoingMailLogin'); ?>" /> <span id="txtOutgoingMailPassword_label"> <?php echo CApi::I18N('ADMIN_PANEL/DOMAINS_SMTP_AUTH_PASS'); ?> </span> <input type="password" name="txtOutgoingMailPassword" id="txtOutgoingMailPassword" class="wm_input" value="<?php $this->Data->PrintInputValue('txtOutgoingMailPassword'); ?>" /> <br /><br /> <?php } ?> <input type="radio" class="wm_checkbox" name="radioAuthType" id="radioAuthTypeAuthCurrentUser" value="<?php echo EnumConvert::ToPost(ESMTPAuthType::AuthCurrentUser, 'ESMTPAuthType'); ?>" <?php $this->Data->PrintCheckedValue('radioAuthTypeAuthCurrentUser'); ?> /> <label id="radioAuthTypeAuthCurrentUser_label" for="radioAuthTypeAuthCurrentUser"> <?php echo CApi::I18N('ADMIN_PANEL/DOMAINS_SMTP_AUTH_USER'); ?> </label> </fieldset> </td> </tr> </table>
/** * @param mixed $mValue * @param string $sClassName * @return string */ public static function ToXml($mValue, $sClassName) { $aConsts = EnumConvert::GetInst($sClassName); $sResult = ''; foreach ($aConsts as $sKey => $mEnumValue) { if ($mValue === $mEnumValue) { $sResult = $sKey; break; } } return $sResult; }
</span> </td> <td> <input type="radio" class="wm_checkbox" name="radioSqlType" id="radioSqlTypeMySQL" value="<?php echo EnumConvert::ToPost(EDbType::MySQL, 'EDbType'); ?> " <?php $this->Data->PrintCheckedValue('radioSqlTypeMySQL'); ?> x-data-label="radioSqlType_label" /> <label id="radioSqlTypeMySQL_label" for="radioSqlTypeMySQL">MySQL</label> <input type="radio" class="wm_checkbox" name="radioSqlType" id="radioSqlTypePostgreSQL" value="<?php echo EnumConvert::ToPost(EDbType::PostgreSQL, 'EDbType'); ?> " <?php $this->Data->PrintCheckedValue('radioSqlTypePostgreSQL'); ?> x-data-label="radioSqlType_label" /> <label id="radioSqlTypePostgreSQL_label" for="radioSqlTypePostgreSQL">PostgreSQL (experimental)</label> </td> </tr> <tr> <td align="left" width="200"> <span id="txtSqlLogin_label"><?php echo CApi::I18N('ADMIN_PANEL/SCREEN_DATABASE_USER'); ?> </span> </td>
<td colspan="2"> <br /> </td> </tr> <tr class="<?php echo $this->Data->PrintValue('classSqlTypeVisibility'); ?>"> <td align="left" width="200"> <span id="txtSqlType_label"><?php echo CApi::I18N('ADMIN_PANEL/SCREEN_DATABASE_TYPE'); ?></span> </td> <td> <input type="radio" class="wm_checkbox" name="radioSqlType" id="radioSqlTypeMySQL" value="<?php echo EnumConvert::ToPost(EDbType::MySQL, 'EDbType'); ?>" <?php $this->Data->PrintCheckedValue('radioSqlTypeMySQL'); ?> x-data-label="radioSqlType_label" /> <label id="radioSqlTypeMySQL_label" for="radioSqlTypeMySQL">MySQL</label> <input type="radio" class="wm_checkbox" name="radioSqlType" id="radioSqlTypePostgreSQL" value="<?php echo EnumConvert::ToPost(EDbType::PostgreSQL, 'EDbType'); ?>" <?php $this->Data->PrintCheckedValue('radioSqlTypePostgreSQL'); ?> x-data-label="radioSqlType_label" /> <label id="radioSqlTypePostgreSQL_label" for="radioSqlTypePostgreSQL">PostgreSQL (experimental)</label> </td> </tr> <tr> <td align="left" width="200"> <span id="txtSqlLogin_label"><?php echo CApi::I18N('ADMIN_PANEL/SCREEN_DATABASE_USER'); ?></span> </td> <td> <input type="text" class="wm_input" name="txtSqlLogin" id="txtSqlLogin" value="<?php $this->Data->PrintInputValue('txtSqlLogin') ?>" size="35" /> </td> </tr> <tr> <td align="left"> <span id="txtSqlPassword_label"><?php echo CApi::I18N('ADMIN_PANEL/SCREEN_DATABASE_PASS'); ?></span>
$this->Data->PrintInputValue('classHideIncomingMailProtocol'); ?> "> <select name="selIncomingMailProtocol" id="selIncomingMailProtocol" class="wm_input"> <option <?php $this->Data->PrintSelectedValue('optIncomingProtocolIMAP'); ?> value="<?php echo EnumConvert::ToPost(EMailProtocol::IMAP4, 'EMailProtocol'); ?> ">IMAP</option> <option <?php $this->Data->PrintSelectedValue('optIncomingProtocolPOP3'); ?> value="<?php echo EnumConvert::ToPost(EMailProtocol::POP3, 'EMailProtocol'); ?> ">POP3</option> </select> </span> </nobr> </td> <td align="left"> <input type="text" class="wm_input" name="txtIncomingMailHost" id="txtIncomingMailHost" value="<?php $this->Data->PrintInputValue('txtIncomingMailHost'); ?> " /> <span id="txtIncomingMailPort_label"> <?php
/** * @param string $sValue * @param string $sEnumName * * @return string */ protected function specConver($sValue, $sEnumName) { if (null !== $sEnumName) { $mResult = EnumConvert::FromXml($sValue, $sEnumName); } return $this->specValidate($mResult, $sEnumName); }
><?php echo CApi::I18N('ADMIN_PANEL/SCREEN_LOGGING_VERBOSITY_WARNINGS'); ?> </option> <option value="<?php echo EnumConvert::ToPost(ELogLevel::Error, 'ELogLevel'); ?> " <?php $this->Data->PrintSelectedValue('selVerbosityError'); ?> ><?php echo CApi::I18N('ADMIN_PANEL/SCREEN_LOGGING_VERBOSITY_ERRORS'); ?> </option> <option value="<?php echo EnumConvert::ToPost(ELogLevel::Spec, 'ELogLevel'); ?> " <?php $this->Data->PrintSelectedValue('selVerbositySpec'); ?> ><?php echo CApi::I18N('ADMIN_PANEL/SCREEN_LOGGING_VERBOSITY_SPEC'); ?> </option> </select> </td> </tr> <tr> <td align="left"> <input id="btnDownloadLog" type="button" class="wm_button" value="<?php echo CApi::I18N('ADMIN_PANEL/SCREEN_LOGGING_DEBUG_DOWNLOAD');