CMXX - Myaccount

This commit is contained in:
“VeLiTi”
2025-02-23 15:25:46 +01:00
parent 0b2ee8c3ce
commit 5dd2973a26
12 changed files with 440 additions and 223 deletions

View File

@@ -15,6 +15,16 @@ include '../custom/settings/config.php';
include '../functions.php';
// Connect to MySQL database
$pdo = pdo_connect_mysql();
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
//LOGIN TO API
//+++++++++++++++++++++++++++++++++++++++++++++++++++++
$data = json_encode(array("clientID" => clientID, "clientsecret" => clientsecret), JSON_UNESCAPED_UNICODE);
$responses = ioAPIv2('/v2/authorization', $data,'');
//Decode Payload
if (!empty($responses)){$responses = json_decode($responses,true);}else{$responses = '400';}
$clientsecret = $responses['token'];
// If the user is not logged-in redirect them to the login page
if (!isset($_SESSION['account_loggedin'])) {
header('Location: ' . url('../index.php?page=myaccount'));
@@ -29,7 +39,7 @@ if (!$account || $account['role'] != 'Admin') {
exit;
}
// Page is set to home (home.php) by default, so when the visitor visits that will be the page they see.
$page = isset($_GET['page']) && file_exists($_GET['page'] . '.php') ? $_GET['page'] : 'dashboard';
$page = isset($_GET['page']) && file_exists($_GET['page'] . '.php') ? $_GET['page'] : 'settings';
if (isset($_GET['page']) && $_GET['page'] == 'logout') {
session_destroy();
header('Location: ' . url('../index.php'));