-
Notifications
You must be signed in to change notification settings - Fork 82
/
changeemail.php
46 lines (44 loc) · 1.66 KB
/
changeemail.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
<?php
require "include/bittorrent.php";
dbconn();
require_once(get_langfile_path("takeinvite.php","",""));
loggedinorreturn();
parked();
stdhead("修改邮箱");
function bark($msg) {
stdmsg('失败!', $msg);
stdfoot();
exit;
}
if (!(strstr($CURUSER['email'],'@yahoo.cn')||strstr($CURUSER['email'],'@yahoo.com.cn')))
bark('您的邮箱不是中国雅虎邮箱,暂时不支持修改邮箱服务');
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$email=$_POST['email'];
$password=$_POST['password'];
if (!$email)
bark($lang_takeinvite['std_must_enter_email']);
if (!check_email($email))
bark($lang_takeinvite['std_invalid_email_address']);
if(EmailBanned($email))
bark($lang_takeinvite['std_email_address_banned']);
if(!EmailAllowed($email))
bark($lang_takeinvite['std_wrong_email_address_domains'].allowedemails());
if ($CURUSER["passhash"] != md5($CURUSER["secret"] . $password . $CURUSER["secret"]))
bark('密码错误!');
sql_query("UPDATE users SET email=".sqlesc($email)." WHERE id=$CURUSER[id]")or sqlerr(__FILE__, __LINE__);
stdmsg('成功!', '请到<a class=faqlink href=usercp.php>个人页面</a>查看。');
stdfoot();
exit;
}
?>
<h1>修改邮箱</h1>
<form method=post action=changeemail.php>
<table border=1 cellspacing=0 cellpadding=5>
<tr><td class=rowhead>请输入新邮箱</td><td><input type=text name=email size=40><br/>注意:修改后没有验证环节,因此请谨慎修改,避免填错。</td></tr>
<tr><td class=rowhead>请输入你的密码</td><td><input type=password name=password size=40></td></tr>
<tr><td colspan=2 align=center><input type=submit value="确定" class=btn></td></tr>
</table>
<?php
stdfoot();
?>