- initial steps on frame location separation

This commit is contained in:
Wiesner András 2024-09-26 08:58:37 +02:00
parent 6a07654267
commit be7513be2f
4 changed files with 11 additions and 33 deletions

View File

@ -1,5 +1,7 @@
<?php
//require_once "frames_common.php";
require_once "globals.php";
require_once "autologin.php";

5
frames/frames_common.php Normal file
View File

@ -0,0 +1,5 @@
<?php
// Add root dir to the include path and also switch working directory
const ROOT_DIR = __DIR__ . DIRECTORY_SEPARATOR . "..";
set_include_path(get_include_path() . PATH_SEPARATOR . ROOT_DIR);
chdir(ROOT_DIR);

View File

@ -7,37 +7,6 @@ function logout() {
});
}
function change_password() {
let oldpassF = document.getElementById("old_password");
let newpass1F = document.getElementById("new_password_1");
let newpass2F = document.getElementById("new_password_2");
let oldpass = oldpassF.value;
let newpass1 = newpass1F.value;
let newpass2 = newpass2F.value;
if (newpass1 !== newpass2) {
alert("Az új jelszavak nem egyeznek!");
} else {
let req = {
action: "change_password",
oldpass: oldpass,
newpass: newpass1
}
request(req).then(resp => {
if (resp === "OK") {
alert("Sikeres jelszóváltoztatás!");
hide("change_password_window");
oldpassF.value = "";
newpass1F.value = "";
newpass2F.value = "";
} else {
alert("Sikertelen jelszóváltoztatás!");
}
});
}
}
function change_password() {
let oldpassF = document.getElementById("old_password");
let newpass1F = document.getElementById("new_password_1");

View File

@ -17,8 +17,10 @@ function login() {
});
}
function open_in_content_frame(url) {
document.getElementById("content_frame").src = url;
const FRAME_RELATIVE_LOCATION = "";
function open_in_content_frame(url, isFrame = true) {
document.getElementById("content_frame").src = (isFrame ? FRAME_RELATIVE_LOCATION : "") + url;
}
var USERDATA = {};