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')); exit; } // If the user is not admin redirect them back to the shopping cart home page $account = ioAPIv2('/v2/identity/userkey='.$_SESSION['account_id'].'&isverified=1','',$clientsecret); $account = json_decode($account,true); if (!$account || $account[0]['profile'] != 1) { header('Location: ' . url('../index.php')); 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'] : 'settings'; if (isset($_GET['page']) && $_GET['page'] == 'logout') { session_destroy(); header('Location: ' . url('../index.php')); exit; } // Output error variable $error = ''; // Include the requested page include $page . '.php'; ?>