CMXX - First testing
This commit is contained in:
@@ -31,10 +31,10 @@ if (!isset($_SESSION['account_loggedin'])) {
|
||||
exit;
|
||||
}
|
||||
// If the user is not admin redirect them back to the shopping cart home page
|
||||
$stmt = $pdo->prepare('SELECT * FROM accounts WHERE id = ?');
|
||||
$stmt->execute([ $_SESSION['account_id'] ]);
|
||||
$account = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (!$account || $account['role'] != 'Admin') {
|
||||
$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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user