mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-06 03:49:56 +02:00
allow to store configuration in database
This commit is contained in:
parent
bf6bbe5e7a
commit
d6fd49a232
2 changed files with 6 additions and 2 deletions
|
@ -3099,6 +3099,9 @@ class LAMCfgMain {
|
|||
return false;
|
||||
}
|
||||
$data = $result->fetchAll();
|
||||
if (empty($data)) {
|
||||
return true;
|
||||
}
|
||||
$jsonData = json_decode($data[0]['value'], true);
|
||||
foreach ($this->persistenceSettings as $persistenceSetting) {
|
||||
if (isset($jsonData[$persistenceSetting])) {
|
||||
|
@ -3108,11 +3111,11 @@ class LAMCfgMain {
|
|||
$this->importData($jsonData);
|
||||
}
|
||||
catch (PDOException $e) {
|
||||
logNewMessage(LOG_ERR, 'Unable to read main config: ' . $e->getMessage());
|
||||
syslog(LOG_ERR, 'Unable to read main config: ' . $e->getMessage());
|
||||
return false;
|
||||
}
|
||||
catch (LAMException $e) {
|
||||
logNewMessage(LOG_ERR, 'Unable to import main config: ' . $e->getMessage());
|
||||
syslog(LOG_ERR, 'Unable to import main config: ' . $e->getMessage());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -263,6 +263,7 @@ function logNewMessage($level, $message) {
|
|||
}
|
||||
else {
|
||||
$cfg = new LAMCfgMain();
|
||||
$_SESSION['cfgMain'] = $cfg;
|
||||
}
|
||||
// check if logging is disabled
|
||||
if (($cfg->logDestination == 'NONE')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue