forked from sicalpath/tjupt
-
Notifications
You must be signed in to change notification settings - Fork 2
/
suicide.php
55 lines (55 loc) · 1.59 KB
/
suicide.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* Created by PhpStorm.
* User: scaryken
* Date: 2017/3/15
* Time: 0:14
*/
require "include/bittorrent.php";
dbconn(true);
loggedinorreturn(true);
stdhead('自杀');
if (!isset($_POST['suicide_option'])) {
$form = <<<HTML
<h1>你确定删除或禁用你的账号吗?</h1>
<form action="suicide.php" method="post">
<table width="100%" border="1" cellspacing="0" cellpadding="4">
<tbody>
<tr>
<td class="rowhead" width="300px">请选择:</td>
<td class="rowfollow">
<input type="radio" name="suicide_option" value="ban"/>我要禁用我的账户<br/>
<input type="radio" name="suicide_option" value="delete"/>我要彻底删除我的账户(此操作不可逆)<br/>
</td>
</tr>
<tr>
<td class="rowhead">请输入你的登录密码以确认操作:</td>
<td class="rowfollow"><input type="password" name="passwd" size="5"></td>
</tr>
<tr>
<td colspan="2" class="toolbox" align="center"><input type="submit" value="确认" class="btn"></td>
</tr>
</tbody>
</table>
</form>
HTML;
print($form);
} else {
$option = $_POST['suicide_option'];
$password = $_POST['passwd'];
if (check_password($password)) {
switch ($option) {
case 'ban':
suicide();
$message = '<h1>您的账号已经被禁用</h1>';
break;
case 'delete':
suicide(true);
$message = '<h1>您的账号已经被删除</h1>';
break;
}
}
logoutcookie();
print($message);
}
stdfoot();