$discord_auth, 'client_id' => OAUTH2_CLIENT_ID, 'client_secret' => OAUTH2_CLIENT_SECRET, )); $_SESSION['discord_auth'] = ""; $discord_auth = ""; $user_check_query = "UPDATE `accounts` SET `Discord` = '' WHERE `ID` = '$playersqlid' LIMIT 1"; $result = mysqli_query($link, $user_check_query); mysqli_free_result($result); } if($_GET['test'] == "revoke_forum") { if(!isset($link)) { $link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME); if($link === false) { die("ERROR: Could not connect."); } } $_SESSION['forum_auth'] = ""; $forum_auth = ""; $user_check_query = "UPDATE `accounts` SET `Forum` = '' WHERE `ID` = '$playersqlid' LIMIT 1"; $result = mysqli_query($link, $user_check_query); mysqli_free_result($result); } } if(isset($_GET['code'])) { $code = $_GET['code']; if(!isset($link)) { $link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME); if($link === false) { die("ERROR: Could not connect."); } } $token = apiRequest($tokenURL, array( "grant_type" => "authorization_code", 'client_id' => OAUTH2_CLIENT_ID, 'client_secret' => OAUTH2_CLIENT_SECRET, 'redirect_uri' => './panel/settings', 'code' => $code )); $_SESSION['discord_auth'] = $token->access_token; $discord_auth = $_SESSION['discord_auth']; $user_check_query = "UPDATE `accounts` SET `Discord` = '$discord_auth' WHERE `ID` = '$playersqlid' LIMIT 1"; $result = mysqli_query($link, $user_check_query); mysqli_free_result($result); } // Processing form data when form is submitted if($_SERVER["REQUEST_METHOD"] == "POST") { $email = $_POST["email"]; $password = $_POST['password']; $password_confirm = $_POST['password_confirm']; if(!isset($link)) { $link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME); if($link === false) { die("ERROR: Could not connect."); } } if((!empty($password) && empty($password_confirm)) || (empty($password) && !empty($password_confirm))) { $gabim = "Re-confirm the password by entering it."; } else if(!empty($password) && !empty($password_confirm)) { if($password == $password_confirm) { $password = mysqli_real_escape_string($link, $password); $hashed_pas = hash('whirlpool', $password); $hashed_pas = strtoupper($hashed_pas); $user_check_query = "UPDATE `accounts` SET `Password` = '$hashed_pas' WHERE `ID` = '$playersqlid' LIMIT 1"; $result = mysqli_query($link, $user_check_query); $change_pass = true; } else $gabim = "Password does not match."; } if(!empty($email) && $playeremail != $email) { if(valid_email($email) && $email != $playeremail) //if(containsWord($email, '@')) { $email = mysqli_real_escape_string($link, $email); $user_check_query = "SELECT `Email` FROM `accounts` WHERE `Email` = '$email' LIMIT 1"; $result = mysqli_query($link, $user_check_query); $rowcount = $result->num_rows; if($rowcount == 0) { $_SESSION['playeremail'] = $email; $playeremail = $email; $user_check_query = "UPDATE `accounts` SET email = '$email' WHERE `ID` = '$playersqlid' LIMIT 1"; $result = mysqli_query($link, $user_check_query); $change_email = true; } else $gabim = "This email is already in use."; } else $gabim = "Invalid email specified."; } if($change_pass == true && $change_email == true) $gabim = "Password & Email updated."; else if($change_pass == true && $change_email == false) $gabim = "Password updated."; else if($change_pass == false && $change_email == true) $gabim = "Email updated."; } if(isset($link)) { mysqli_close($link); } ?>

Settings

  • Accounts
Personal Information
Save