mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-12 02:04:34 +00:00
Settings Save Mechanism an few fixes
This commit is contained in:
1 parent
464f229a16
commit
daa0e0a2c5
4 files changed
+38
-17
No files matched your search
@@ -21,13 +21,24 @@ if (isset($_POST) && !empty($_POST)){
|
||||
|
||||
$ga = new PHPGangsta_GoogleAuthenticator();
|
||||
$checkResult = $ga->verifyCode($otaSecret, $otaCode, 2); // 2 = 2*30sec clock tolerance
|
||||
if ($checkResult) {
|
||||
$userManager->setOta($otaCode, $otaSecret);
|
||||
}
|
||||
if ($checkResult) {
|
||||
$userManager->setOta($otaCode, $otaSecret);
|
||||
}
|
||||
header('Location: ' . BASEURL . 'setting');
|
||||
die();
|
||||
} else if (isset ($_POST['userPermission']) && !empty ($_POST['userID'])) {
|
||||
$userManager->setUserDataAdmin("permission", $_POST['userPermission'], $_POST['userID']);
|
||||
header('Location: ' . BASEURL . 'setting');
|
||||
die();
|
||||
} else {
|
||||
foreach ($_POST as $key => $value) {
|
||||
if ($key == 'submit') continue;
|
||||
$settingMng = new SettingsManager();
|
||||
if ($settingMng->getByName($key)) {
|
||||
$settingMng->update($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
header('Location: ' . BASEURL . 'setting');
|
||||
die();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user