Browse Source

check which settings are imported

pull/101/head
Roland Gruber 3 years ago
parent
commit
38293656b6
  1. 4
      lam/lib/config.inc
  2. 1
      lam/tests/lib/LAMCfgMainTest.php

4
lam/lib/config.inc

@ -2701,6 +2701,10 @@ class LAMCfgMain {
*/
public function importData($data) {
foreach ($data as $dataKey => $dataValue) {
if (!in_array($dataKey, $this->settings)) {
logNewMessage(LOG_WARNING, 'Ignored setting during import: ' . $dataKey);
continue;
}
if (!(is_array($dataValue) || is_string($dataValue) || is_int($dataValue) || is_bool($dataValue))) {
throw new LAMException('Invalid import data type for ' . htmlspecialchars($dataKey) . ': ' . gettype($dataValue));
}

1
lam/tests/lib/LAMCfgMainTest.php

@ -146,6 +146,7 @@ class LAMCfgMainTest extends TestCase {
$importData['sessionTimeout'] = 240;
$importData['logLevel'] = LOG_ERR;
$importData['mailServer'] = 'mailserver';
$importData['IGNORE_ME'] = 'ignore';
$this->conf->importData($importData);

Loading…
Cancel
Save