add 'lazy ssl' and 'force from'

This commit is contained in:
Uwe Steinmann 2024-09-17 20:24:04 +02:00
parent 32f2cffa9f
commit 55bd02fdea
3 changed files with 31 additions and 2 deletions

View File

@ -227,6 +227,8 @@ class Settings { /* {{{ */
var $_allowReviewerOnly = true; var $_allowReviewerOnly = true;
// enable/disable log system // enable/disable log system
var $_logFileEnable = true; var $_logFileEnable = true;
// enable/disable log system
var $_logFileMaxLevel = 6; // PEAR_LOG_INFO
// the log file rotation // the log file rotation
var $_logFileRotation = "d"; var $_logFileRotation = "d";
// Enable file upload by fine-uploader (was 'jumploader') // Enable file upload by fine-uploader (was 'jumploader')
@ -628,6 +630,7 @@ class Settings { /* {{{ */
$this->_proxyUser = strval($tab["proxyUser"]); $this->_proxyUser = strval($tab["proxyUser"]);
$this->_proxyPassword = strval($tab["proxyPassword"]); $this->_proxyPassword = strval($tab["proxyPassword"]);
$this->_logFileEnable = Settings::boolVal($tab["logFileEnable"]); $this->_logFileEnable = Settings::boolVal($tab["logFileEnable"]);
$this->_logFileMaxLevel = strval($tab["logFileMaxLevel"]);
$this->_logFileRotation = strval($tab["logFileRotation"]); $this->_logFileRotation = strval($tab["logFileRotation"]);
$this->_enableLargeFileUpload = Settings::boolVal($tab["enableLargeFileUpload"]); $this->_enableLargeFileUpload = Settings::boolVal($tab["enableLargeFileUpload"]);
$this->_partitionSize = strval($tab["partitionSize"]); $this->_partitionSize = strval($tab["partitionSize"]);
@ -739,6 +742,8 @@ class Settings { /* {{{ */
$this->_smtpSendFrom = strval($tab["smtpSendFrom"]); $this->_smtpSendFrom = strval($tab["smtpSendFrom"]);
else else
$this->_smtpSendFrom = ini_get("sendmail_from"); $this->_smtpSendFrom = ini_get("sendmail_from");
$this->_smtpForceFrom = Settings::boolVal($tab["smtpForceFrom"]);
$this->_smtpLazySSL = Settings::boolVal($tab["smtpLazySSL"]);
// smtpUser // smtpUser
$this->_smtpUser = strval($tab["smtpUser"]); $this->_smtpUser = strval($tab["smtpUser"]);
$this->_smtpPassword = strval($tab["smtpPassword"]); $this->_smtpPassword = strval($tab["smtpPassword"]);
@ -1021,6 +1026,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "proxyUser", $this->_proxyUser); $this->setXMLAttributValue($node, "proxyUser", $this->_proxyUser);
$this->setXMLAttributValue($node, "proxyPassword", $this->_proxyPassword); $this->setXMLAttributValue($node, "proxyPassword", $this->_proxyPassword);
$this->setXMLAttributValue($node, "logFileEnable", $this->_logFileEnable); $this->setXMLAttributValue($node, "logFileEnable", $this->_logFileEnable);
$this->setXMLAttributValue($node, "logFileMaxLevel", $this->_logFileMaxLevel);
$this->setXMLAttributValue($node, "logFileRotation", $this->_logFileRotation); $this->setXMLAttributValue($node, "logFileRotation", $this->_logFileRotation);
$this->setXMLAttributValue($node, "enableLargeFileUpload", $this->_enableLargeFileUpload); $this->setXMLAttributValue($node, "enableLargeFileUpload", $this->_enableLargeFileUpload);
$this->setXMLAttributValue($node, "partitionSize", $this->_partitionSize); $this->setXMLAttributValue($node, "partitionSize", $this->_partitionSize);
@ -1112,6 +1118,8 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "smtpServer", $this->_smtpServer); $this->setXMLAttributValue($node, "smtpServer", $this->_smtpServer);
$this->setXMLAttributValue($node, "smtpPort", $this->_smtpPort); $this->setXMLAttributValue($node, "smtpPort", $this->_smtpPort);
$this->setXMLAttributValue($node, "smtpSendFrom", $this->_smtpSendFrom); $this->setXMLAttributValue($node, "smtpSendFrom", $this->_smtpSendFrom);
$this->setXMLAttributValue($node, "smtpForceFrom", $this->_smtpForceFrom);
$this->setXMLAttributValue($node, "smtpLazySSL", $this->_smtpLazySSL);
$this->setXMLAttributValue($node, "smtpUser", $this->_smtpUser); $this->setXMLAttributValue($node, "smtpUser", $this->_smtpUser);
$this->setXMLAttributValue($node, "smtpPassword", $this->_smtpPassword); $this->setXMLAttributValue($node, "smtpPassword", $this->_smtpPassword);

View File

@ -187,6 +187,7 @@ if ($action == "saveSettings")
setDirValue("proxyUser"); setDirValue("proxyUser");
setDirValue("proxyPassword"); setDirValue("proxyPassword");
setBoolValue("logFileEnable"); setBoolValue("logFileEnable");
setIntValue("logFileMaxLevel");
setStrValue("logFileRotation"); setStrValue("logFileRotation");
setBoolValue("enableLargeFileUpload"); setBoolValue("enableLargeFileUpload");
setStrValue("partitionSize"); // TODO: check if valid value, e.g. 1M or 5K setStrValue("partitionSize"); // TODO: check if valid value, e.g. 1M or 5K
@ -227,6 +228,8 @@ if ($action == "saveSettings")
setStrValue("smtpServer"); setStrValue("smtpServer");
setIntValue("smtpPort"); setIntValue("smtpPort");
setStrValue("smtpSendFrom"); setStrValue("smtpSendFrom");
setBoolValue("smtpForceFrom");
setBoolValue("smtpLazySSL");
setStrValue("smtpUser"); setStrValue("smtpUser");
setStrValue("smtpPassword"); setStrValue("smtpPassword");

View File

@ -31,6 +31,21 @@
*/ */
class SeedDMS_View_Settings extends SeedDMS_Theme_Style { class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
/**
* Add ' ' after integer
*
* This is a hack to create array keys made of numbers to be
* kept as strings. An array element key made of numbers is treated
* like an index, though it is a string.
* E.g. array('3'=>'foo', '5'=>bar) will be an indexed array, but
* array('3 '=>'foo', '5 '=>bar) will be an associated array
* showConfigOption() will remove the ' ' but use the key as an
* option value, which it wouldn't if the array was indexed.
*/
static protected function int2str($i) { /* {{{ */
return (string) $i." ";
} /* }}} */
protected function showStartPaneContent($name, $isactive) { /* {{{ */ protected function showStartPaneContent($name, $isactive) { /* {{{ */
parent::showStartPaneContent($name, $isactive); parent::showStartPaneContent($name, $isactive);
$this->contentContainerStart(); $this->contentContainerStart();
@ -475,6 +490,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php $this->showConfigText('settings_proxyUser', 'proxyUser'); ?> <?php $this->showConfigText('settings_proxyUser', 'proxyUser'); ?>
<?php $this->showConfigText('settings_proxyUPassword', 'proxyPassword', 'password'); ?> <?php $this->showConfigText('settings_proxyUPassword', 'proxyPassword', 'password'); ?>
<?php $this->showConfigCheckbox('settings_logFileEnable', 'logFileEnable'); ?> <?php $this->showConfigCheckbox('settings_logFileEnable', 'logFileEnable'); ?>
<?php $this->showConfigOption('settings_logFileMaxLevel', 'logFileMaxLevel', array(self::int2str(PEAR_LOG_EMERG)=>'settings_logLevelEmergency', self::int2str(PEAR_LOG_ALERT)=>'settings_logLevelAlert', self::int2str(PEAR_LOG_CRIT)=>'settings_logLevelCritical', self::int2str(PEAR_LOG_ERR)=>'settings_logLevelError', self::int2str(PEAR_LOG_WARNING)=>'settings_logLevelWarning', self::int2str(PEAR_LOG_NOTICE)=>'settings_logLevelNotice', self::int2str(PEAR_LOG_INFO)=>'settings_logLevelInfo', self::int2str(PEAR_LOG_DEBUG)=>'settings_logLevelDebug'), false, true); ?>
<?php $this->showConfigOption('settings_logFileRotation', 'logFileRotation', array('h'=>'hourly', 'd'=>'daily', 'm'=>'monthly'), false, true); ?> <?php $this->showConfigOption('settings_logFileRotation', 'logFileRotation', array('h'=>'hourly', 'd'=>'daily', 'm'=>'monthly'), false, true); ?>
<?php $this->showConfigCheckbox('settings_enableLargeFileUpload', 'enableLargeFileUpload'); ?> <?php $this->showConfigCheckbox('settings_enableLargeFileUpload', 'enableLargeFileUpload'); ?>
<?php $this->showConfigText('settings_partitionSize', 'partitionSize'); ?> <?php $this->showConfigText('settings_partitionSize', 'partitionSize'); ?>
@ -523,6 +539,8 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php $this->showConfigText('settings_smtpServer', 'smtpServer'); ?> <?php $this->showConfigText('settings_smtpServer', 'smtpServer'); ?>
<?php $this->showConfigText('settings_smtpPort', 'smtpPort'); ?> <?php $this->showConfigText('settings_smtpPort', 'smtpPort'); ?>
<?php $this->showConfigText('settings_smtpSendFrom', 'smtpSendFrom'); ?> <?php $this->showConfigText('settings_smtpSendFrom', 'smtpSendFrom'); ?>
<?php $this->showConfigCheckbox('settings_smtpForceFrom', 'smtpForceFrom'); ?>
<?php $this->showConfigCheckbox('settings_smtpLazySSL', 'smtpLazySSL'); ?>
<?php $this->showConfigText('settings_smtpUser', 'smtpUser'); ?> <?php $this->showConfigText('settings_smtpUser', 'smtpUser'); ?>
<?php $this->showConfigText('settings_smtpPassword', 'smtpPassword', 'password'); ?> <?php $this->showConfigText('settings_smtpPassword', 'smtpPassword', 'password'); ?>
<?php $this->showConfigPlain(htmlspecialchars(getMLText('settings_smtpSendTestMail')), htmlspecialchars(getMLText('settings_smtpSendTestMail_desc')), '<a class="btn btn-secondary sendtestmail">'.getMLText('send_test_mail').'</a><div><pre id="maildebug">You will see debug messages here</pre></div>'); ?> <?php $this->showConfigPlain(htmlspecialchars(getMLText('settings_smtpSendTestMail')), htmlspecialchars(getMLText('settings_smtpSendTestMail_desc')), '<a class="btn btn-secondary sendtestmail">'.getMLText('send_test_mail').'</a><div><pre id="maildebug">You will see debug messages here</pre></div>'); ?>
@ -840,8 +858,8 @@ if(is_writeable($settings->_configFilePath)) {
/* /*
* Local variables: * Local variables:
* tab-width: 4 * tab-width: 2
* c-basic-offset: 4 * c-basic-offset: 2
* indent-tabs-mode: t * indent-tabs-mode: t
* End: * End:
* vim600: fdm=marker * vim600: fdm=marker