Browse Source

deleting an account deletes ALL characters from the account, and ALL stats related to both the account and characters

pull/16/head
mauirixxx 7 years ago
parent
commit
298c09ce6c
4 changed files with 16 additions and 7 deletions
  1. +2
    -2
      includes/del-account.php
  2. +7
    -1
      includes/del-character.php
  3. +1
    -2
      preferences.php
  4. +6
    -2
      updatecharstats.php

+ 2
- 2
includes/del-account.php View File

@@ -16,12 +16,12 @@ if (isset($_SESSION['userid'])) {
$dac = $con->prepare("DELETE FROM gwaccstats WHERE accid = ? AND userid = ?");
$dac->bind_param("ii", $gcirow['accid'], $_SESSION['userid']);
$dac->execute();
$dac->close();/*
$dac->close();
// $dcs = Delete Character Stats
$dcs = $con->prepare("DELETE FROM gwcharstats WHERE charid = ? AND accid = ? AND userid = ?");
$dcs->bind_param("iii", $gcirow['charid'], $gcirow['accid'], $_SESSION['userid']);
$dcs->execute();
$dcs->close(); */
$dcs->close();
}
$gci->close();
//this should be the last SQL query to run!


+ 7
- 1
includes/del-character.php View File

@@ -9,7 +9,13 @@ if (isset($_SESSION['userid'])) {
}
$delchar->close();
}
// need to delete associate character stats as well. TODO
// $dcs = Delete Character Stats
$gcharid = implode(", ", $_POST['delcharid']);
$dcs = $con->prepare("DELETE FROM gwcharstats WHERE charid IN ($gcharid) AND accid = ? AND userid = ?");
$dcs->bind_param("ii", $_SESSION['prefaccid'], $_SESSION['userid']);
$dcs->execute();
$dcs->close();
// set preferred character to none
$nap = $con->prepare("UPDATE userinfo SET prefcharid = 0, prefcharname = 'No default selected' WHERE userid = ?");
$nap->bind_param("i", $_SESSION['userid']);
$nap->execute();


+ 1
- 2
preferences.php View File

@@ -69,8 +69,7 @@ if (isset($_SESSION['userid'])){
}
</script>
<input type="submit" name="submission" value="Update password" onclick="return Validate()" id="btnSubmit"></form>
UPDPASS;
}
UPDPASS;
}
include_once ('footer.php');
?>

+ 6
- 2
updatecharstats.php View File

@@ -5,7 +5,11 @@ if (isset($_SESSION['userid'])) {
if (!isset($_POST['chartitle'])) {
$_POST['chartitle'] = "notselected";
}
if ($_SESSION['prefcharid'] == "0") {
echo 'Please select a character from the menu above to add stats to before continuing';
include_once ('footer.php');
exit();
}
if (isset($_POST['titlepoints'])) {
// include file just updates the database
include_once ('includes/update-chartitleranks.php');
@@ -15,7 +19,7 @@ if (isset($_SESSION['userid'])) {
echo '<form action="updatecharstats.php" method="post">';
echo 'Select character title to update: <select name="chartitle" onchange="this.form.submit()">';
// $cts = Character Title Select
$cts = $con->prepare("SELECT titlenameid, titlename FROM gwtitles WHERE titletype = 1 ORDER BY titlename");
$cts = $con->prepare("SELECT titlenameid, titlename FROM gwtitles WHERE titletype = 1 AND autofilled = 0 ORDER BY titlename");
$cts->execute();
$result = $cts->get_result();
while ($row = $result->fetch_assoc()) {


Loading…
Cancel
Save