header('location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']); } $param = array(); $param['m_account'] = $account; if (!empty($code)) { $auth_code = new AuthCode(); if (!$auth_code->validate($code)) { $param['msg'] = '校验码错误,请重新输入'; $param['codeNum'] = FAILURE_NUM; showTpl($smarty, $param); exit; } } $soapData = array(); $soap = new Soap_xjt(); $result = $soap->login($account, $pwd, $soapData); if ($result) { $_SESSION['login_failure'] = 0; //修改失败次数为0 $_SESSION['userData'] = $soapData; $u_ary = array('login_failure' => 0); if (!checkuser($account)) { $u_ary['m_account'] = $account; $u_ary['m_pwd'] = ''; $u_ary['m_name'] = $soapData['AccName']; $u_ary['m_school'] = $soapData['schName']; $u_ary['m_group'] = 2; //普通用户 $db->insert(TABLE_CZECH_MEMBER, $u_ary); } $strsql = 'select * from ' . TABLE_CZECH_MEMBER . ' where m_account = \'' . $account . '\'';
} $mobile = request_var('mobile', ''); $smarty->assign('msg', $msg); $smarty->assign('oldmobile', $mobile); $smarty->display('xjt/changeaccmobile.tpl'); } else { if ($mod == 'modifypassword') { $msg = ''; if ($act == 'submit') { $soap = new Soap_xjt(); //创建接口对象 $oldpwd = request_var('oldpwd', ''); $newpwd = request_var('newpwd', ''); $newpwd2 = request_var('newpwd2', ''); $soapData = array(); $result = $soap->login($userData['m_account'], $oldpwd, $soapData); if ($result) { if (!preg_match('/\\d{6}/', $newpwd) || !preg_match('/\\d{6}/', $newpwd2)) { $msg = '您正确输入的新密码(6位数字)!'; } else { if ($newpwd == $newpwd2) { $result = $soap->modifyPassword($userData['m_account'], $oldpwd, $newpwd); if ($result) { if (isset($_SESSION['userData'])) { unset($_SESSION['userData']); } //删除session $db->delete(TABLE_CZECH_SESSION, 'session_id = "' . $_COOKIE['session_id'] . '"'); setcookie('m_account', '', time() - $system_data['cookie_time'], '/'); setcookie('session_id', '', time() - $system_data['cookie_time'], '/'); message_box('您的密码已经修改,请用新密码登录系统', XJT, go_to(array('/xjt/login.php' => '重新登录')));