} } else { if ($action == 'resendemail') { $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input'))); $username = $jsondata->uname; $resendactiveeamil = get_cookie('resendactiveeamil'); if (empty($resendactiveeamil)) { set_cookie('resendactiveeamil', 1, 600); } else { echo json_encode('again'); //重复发送 } $info = $m->sendactiveemail($username); echo json_encode($info); exit; } else { if ($action == 'changeemail') { $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input'))); $newemail = $jsondata->email; if (!empty($_USERS)) { $m->edit($_USERS['uname'], $newemail); $info = $m->sendactiveemail($username); echo json_encode($info); } else { $info = $m->sendactiveemail($username, $newemail); echo json_encode($info); } } } } }
print "<script language='javascript'>alert('密码长度太短!');history.go(-1);</script>"; exit; } if ($password != $password2) { print "<script language='javascript'>alert('两次输入的密码不一致!');history.go(-1);</script>"; exit; } //校验code是否正确 $uid = DB::result_first("Select uid From " . DB::table("users") . " WHERE email='" . $email . "' and uname='" . $uname . "' and activekey='" . $activekey . "'"); if (empty($uid)) { print "<script language='javascript'>alert('数据校验失败!链接已过期或者链接错误!');history.go(-1);</script>"; exit; } include INC_PATH . "/member.class.php"; $m = new memberclass(); $info = $m->edit($uname, "", "", $password); if ($info == "OK") { include template('resetp_ok'); //包含输出修改密码成功 exit; } else { print "<script language='javascript'>alert('修改密码失败!请重试');history.go(-1);</script>"; exit; } } if (empty($uname) || empty($activekey) || empty($email)) { print "<script language='javascript'>alert('链接已过期!');</script>"; jumpurl(url("index.php")); } else { include template('resetp_newpass'); //包含输出指定模板
InitGP(array("action", "mid", "page")); //初始化变量全局返回 include_once INC_PATH . "/member.class.php"; $m = new memberclass(); AjaxHead(); //禁止页面缓存 header("Content-type: text/html; charset=" . CHARSET); if (empty($action)) { $value = $m->getone($_USERS['uname']); } elseif ($action == 'save') { InitGP(array("passwordTxt", "newEmailTxt", "regEmailTxt", "regCodeTxt", "commit")); //初始化变量全局返回 if (!empty($_POST)) { $passwordTxt = Char_cv($passwordTxt); if (isemail($newEmailTxt) and md5($passwordTxt) == $_USERS['password']) { $msg = $m->edit($_USERS['uname'], $newEmailTxt, $_USERS['password'], ''); if ($msg == "OK") { print "<script language='javascript'>alert(" . lang('update_success') . ");</script>"; jumpurl(url('m.php?name=edituserinfo')); exit; } else { print "<script language='javascript'>alert(" . lang('update_lose') . ");</script>"; jumpurl(url('m.php?name=edituserinfo')); exit; } } else { print "<script language='javascript'>alert(" . lang('update_lose') . ");</script>"; jumpurl(url('m.php?name=edituserinfo')); exit; } } else {
InitGP(array("tname", "sex", "tel", "zip", "address", "qq", "msn", "country", "city", "oldface", "commit")); //初始化变量全局返回 if (!empty($commit)) { //上传图片处理 require_once INC_PATH . '/upload.class.php'; $f = new Upload('attachment/avatar', array('gif', 'jpg', 'jpge', 'png'), 50000); //路径 允许扩展名 文件尺寸 $f->setThumb(0); //设置不生成缩微图 $f->run('faceimg', 1); $info = $f->getInfo(); $imgdata = $info[0]['fullsavename']; //获取第一个上传图片反馈 if (isset($info[0]['error'])) { $imgdata = $oldface; } $editarray = array("tname" => Char_cv($tname), "sex" => GetNum($sex), "tel" => GetNum($tel), "zip" => Char_cv($zip), "address" => Char_cv($address), "qq" => GetNum($qq), "msn" => Char_cv($msn), "country" => Char_cv($country), "face" => $imgdata, "city" => Char_cv($city)); $msg = $m->edit($_USERS['uname'], '', $_USERS['password'], '', $editarray); if ($msg == "OK") { print "<script language='javascript'>alert(" . lang('update_success') . ");</script>"; jumpurl(url('m.php?name=edituserinfo')); } else { print "<script language='javascript'>alert(" . lang('update_lose') . ");</script>"; jumpurl(url('m.php?name=edituserinfo')); } } else { $value = $m->getone($_USERS['uname']); } } include template('member_edituserinfo'); //包含输出指定模板
<?php //我的劵 InitGP(array("action", "commit", "email", "username", "oldpassword", "password", "password2", "mobile")); //初始化变量全局返回 if (!empty($commit)) { //处理更新用户资料操作 if ($password != $password2) { showmessage(lang('two_pass_noCorrect'), "-1", false); } $editarray = array("tel" => GetNum($mobile)); include "includes/member.class.php"; $m = new memberclass(); $msg = $m->edit($username, $email, $oldpassword, $password, $editarray); if ($msg == "OK") { showmessage(lang('Success_mod'), "login.php", true); } else { showmessage($msg, "-1", false); } } else { //显示资料修改表单 /** * 输出测试部分开始 print_r($_USERS); */ /** * 输出测试部分结束 */ include template('member_settings');