Fix so update.sh script warns about changed defaults (#7011)

pull/5989/merge
Aleksander Machniak 5 years ago
parent a269e7c106
commit 294683b390

@ -8,6 +8,7 @@ CHANGELOG Roundcube Webmail
- Fix invalid Signature button state after escaping Mailvelope mode (#7015) - Fix invalid Signature button state after escaping Mailvelope mode (#7015)
- Fix so 401 error is returned only on failed logon requests (#7010) - Fix so 401 error is returned only on failed logon requests (#7010)
- Fix db_prefix handling in queries with `TRUNCATE TABLE <name>` and `UNIQUE <name>` (#7013) - Fix db_prefix handling in queries with `TRUNCATE TABLE <name>` and `UNIQUE <name>` (#7013)
- Fix so update.sh script warns about changed defaults (#7011)
RELEASE 1.4.0 RELEASE 1.4.0
------------- -------------

@ -43,7 +43,7 @@ $RCI->load_config();
if ($RCI->configured) { if ($RCI->configured) {
$success = true; $success = true;
if (($messages = $RCI->check_config()) || $RCI->legacy_config) { if (($messages = $RCI->check_config($opts['version'])) || $RCI->legacy_config) {
$success = false; $success = false;
$err = 0; $err = 0;
@ -56,8 +56,6 @@ if ($RCI->configured) {
echo "- '" . $msg['prop'] . "' was replaced by '" . $msg['replacement'] . "'\n"; echo "- '" . $msg['prop'] . "' was replaced by '" . $msg['replacement'] . "'\n";
$err++; $err++;
} }
echo "\n";
} }
// list obsolete config options (just a notice) // list obsolete config options (just a notice)
@ -70,8 +68,6 @@ if ($RCI->configured) {
echo "- '" . $msg['prop'] . ($msg['name'] ? "': " . $msg['name'] : "'") . "\n"; echo "- '" . $msg['prop'] . ($msg['name'] ? "': " . $msg['name'] : "'") . "\n";
$err++; $err++;
} }
echo "\n";
} }
if (!$err && $RCI->legacy_config) { if (!$err && $RCI->legacy_config) {
@ -137,6 +133,15 @@ if ($RCI->configured) {
} }
} }
// list of config options with changed default (just a notice)
if (!empty($messages['defaults'])) {
echo "WARNING: Changed defaults (These config options have new default values):\n";
foreach ($messages['defaults'] as $opt) {
echo "- '{$opt}'\n";
}
}
// check dependencies based on the current configuration // check dependencies based on the current configuration
if (is_array($messages['dependencies'])) { if (is_array($messages['dependencies'])) {
echo "WARNING: Dependency check failed!\n"; echo "WARNING: Dependency check failed!\n";

@ -61,6 +61,10 @@ class rcmail_install
'Oracle' => 'oci8', 'Oracle' => 'oci8',
); );
/** @var array List of config options with default value change per-release */
public $defaults_changes = array(
'1.4.0' => array('skin', 'smtp_port', 'smto_user', 'smtp_pass'),
);
/** /**
* Constructor * Constructor
@ -298,9 +302,11 @@ class rcmail_install
* Check the current configuration for missing properties * Check the current configuration for missing properties
* and deprecated or obsolete settings * and deprecated or obsolete settings
* *
* @param string $version Previous version on upgrade
*
* @return array List with problems detected * @return array List with problems detected
*/ */
public function check_config() public function check_config($version = null)
{ {
$this->load_config(); $this->load_config();
@ -379,6 +385,18 @@ class rcmail_install
} }
} }
if ($version) {
$out['defaults'] = array();
foreach ($this->defaults_changes as $v => $opts) {
if (version_compare($v, $version, '>')) {
$out['defaults'] = array_merge($out['defaults'], $opts);
}
}
$out['defaults'] = array_unique($out['defaults']);
}
return $out; return $out;
} }

Loading…
Cancel
Save