require "include/bittorrent.php"; dbconn(); if ($_SERVER["REQUEST_METHOD"] == "POST") { $username = trim($_POST["username"]); $password = trim($_POST["password"]); if (!$username || !$password) stderr( _("Error"), _("Please fill out the form correctly.")); $res = do_mysql_query( "SELECT * FROM users WHERE username=" . sqlesc($username) . " && passhash=md5(concat(secret,concat(" . sqlesc($password) . ",secret)))") or sqlerr(); if (mysql_num_rows($res) != 1) stderr( _("Error"), _("Bad user name or password. Please verify that all entered information is correct.")); $arr = mysql_fetch_assoc($res); $id = $arr['id']; $res = do_mysql_query("DELETE FROM users WHERE id=$id") or sqlerr(); if (mysql_affected_rows() != 1) stderr( _("Error"), _("Unable to delete the account.")); stderr( _("Success"), sprintf( _("The account %s was deleted."), $username) ); } stdhead( _("Delete account") ); ?>