check which settings are imported
This commit is contained in:
parent
9ed53f51de
commit
38293656b6
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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…
Reference in New Issue