CMXX - Myaccount
This commit is contained in:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user