getMessage()); \dashboard\primary\error($errorMsg); }); $username = $_SESSION['username']; $query = misc\mysql\query("SELECT * FROM `accounts` WHERE `username` = ?",[$username]); $row = mysqli_fetch_array($query->result); $banned = $row['banned']; $lastreset = $row['lastreset']; if (!is_null($banned) || $_SESSION['logindate'] < $lastreset || $query->num_rows < 1) { echo ""; session_destroy(); exit(); } $role = $row['role']; $permissions = $row['permissions']; $admin = $row['admin']; $staff = $row['staff']; $formBanned = $row['formBanned']; $twofactor = $row['twofactor']; $alertMsg = $row['alert']; $secwords = $row['secWords']; $_SESSION['role'] = $role; $expires = $row['expires']; if (in_array($role, array("developer", "seller"))) { dashboard\primary\expireCheck($username, $expires); } if (!$_SESSION['app']) // no app selected yet { $query = misc\mysql\query("SELECT `secret`, `name`, `banned`, `sellerkey` FROM `apps` WHERE `owner` = ? AND `ownerid` = ?",[$_SESSION['username'], $_SESSION['ownerid']]); // select all apps where owner is current user if ($query->num_rows == 1) // if the user only owns one app, load that app (they can still change app after it's loaded) { $row = mysqli_fetch_array($query->result); $_SESSION['name'] = $row["name"]; $_SESSION['app'] = $row["secret"]; $_SESSION['sellerkey'] = $row["sellerkey"]; } } ?> KeyAuth - Open Source Auth
Loading taking a while? Please feel free to return.