Final Fixes And Clean Up

This commit is contained in:
JonatanRek
2020-04-28 11:52:14 +02:00
parent a3d911d3ec
commit e0bbc09389
18 changed files with 29 additions and 35 deletions

View File

@@ -32,7 +32,7 @@ if (isset($_POST) && !empty($_POST)){
AutomationManager::create($_POST['name'], $onDays, $doCode, $ifCode);
header('Location: ' . BASEDIR . strtolower(basename(__FILE__, '.php')));
header('Location: ' . BASEURL . strtolower(basename(__FILE__, '.php')));
die();
} else if (isset($_POST['modalFinal']) && $_POST['action'] == "edit") {
$doCode = json_encode($_POST['device'], JSON_PRETTY_PRINT);
@@ -70,7 +70,7 @@ if (isset($_POST) && !empty($_POST)){
AutomationManager::create($_POST['name'], $onDays, $doCode, $ifCode, (isset ($_POST['automation_id']) ? $_POST['automation_id'] : ""));
header('Location: ' . BASEDIR . strtolower(basename(__FILE__, '.php')));
header('Location: ' . BASEURL . strtolower(basename(__FILE__, '.php')));
die();
}
}

View File

@@ -7,7 +7,7 @@ if (isset($_POST) && !empty($_POST)){
DashboardManager::Add($subDeviceId);
}
}
header('Location: ' . BASEDIR . strtolower(basename(__FILE__, '.php')));
header('Location: ' . BASEURL . strtolower(basename(__FILE__, '.php')));
die();
}
?>

View File

@@ -78,10 +78,10 @@ if (isset($_POST) && !empty($_POST)){
echo '<pre>';
var_dump($POST);
echo '</pre>';
echo '<a href="' . BASEDIR . '">CONTINUE</a>';
echo '<a href="' . BASEURL . '">CONTINUE</a>';
die();
}
header('Location: ' . BASEDIR );
header('Location: ' . BASEURL );
die();
}
?>

View File

@@ -15,7 +15,7 @@ if (
$ota = $userManager->haveOtaEnabled($userName);
if ($ota == "") {
$landingPage = $userManager->login($userName, $userPassword, $rememberMe);
header('Location: ' . BASEDIR . $landingPage);
header('Location: ' . BASEURL . $landingPage);
die();
}
@@ -40,7 +40,7 @@ if (
$checkResult = $ga->verifyCode($otaSecret, $otaCode, 2); // 2 = 2*30sec clock tolerance
if ($checkResult) {
$landingPage = $userManager->login($userName, $userPassword, $rememberMe);
header('Location: ' . BASEDIR . $landingPage);
header('Location: ' . BASEURL . $landingPage);
echo 'OK';
} else {
echo 'FAILED';

View File

@@ -3,7 +3,7 @@
if (isset($_POST) && !empty($_POST)){
if (isset($_POST['submitFinal']) && $_POST['submitFinal'] != "") {
SceneManager::create($_POST['sceneIcon'], $_POST['sceneName'], json_encode($_POST['devices']));
header('Location: ' . BASEDIR . strtolower(basename(__FILE__, '.php')));
header('Location: ' . BASEURL . strtolower(basename(__FILE__, '.php')));
die();
}
@@ -12,7 +12,7 @@ if (isset($_POST) && !empty($_POST)){
echo '<pre>';
var_dump($_POST);
echo '</pre>';
echo '<a href="/' . BASEDIR . strtolower(basename(__FILE__, '.php')).'">CONTINUE</a>';
echo '<a href="/' . BASEURL . strtolower(basename(__FILE__, '.php')).'">CONTINUE</a>';
die();
}
}

View File

@@ -5,13 +5,13 @@ if (isset($_POST) && !empty($_POST)){
$newPassword = $_POST['newPassword1'];
$newPassword2 = $_POST['newPassword2'];
UserManager::changePassword($oldPassword, $newPassword, $newPassword2);
header('Location: ' . BASEDIR . 'logout');
header('Location: ' . BASEURL . 'logout');
die();
} else if (isset($_POST['submitCreateUser']) && $_POST['submitCreateUser'] != "") {
$userName = $_POST['userName'];
$password = $_POST['userPassword'];
UserManager::createUser($userName, $password);
header('Location: ' . BASEDIR . 'setting');
header('Location: ' . BASEURL . 'setting');
die();
} else if (isset($_POST['submitEnableOta']) && $_POST['submitEnableOta'] != "") {
echo $otaCode = $_POST['otaCode'];
@@ -23,7 +23,7 @@ if (isset($_POST) && !empty($_POST)){
if ($checkResult) {
UserManager::setOta($otaCode, $otaSecret);
}
header('Location: ' . BASEDIR . 'setting');
header('Location: ' . BASEURL . 'setting');
die();
}
}