<?php import('forms'); import('users'); import('roles'); if (!empty($_POST)) { if (trim($_POST['USER_LOGIN_ID']) == '') { $errors[] = 'Please fill in username'; } if (trim($_POST['CURRENT_PASSWORD']) == '') { $errors[] = 'Please fill in password'; } if (empty($errors)) { if (user_login_new($_POST['USER_LOGIN_ID'], $_POST['CURRENT_PASSWORD'])) { $_SESSION['user']['IS_ADMIN'] = true; $redirect_url = '/test/index'; header(sprintf("location: %s", $redirect_url)); exit; } else { $errors[] = 'Invalid username and/or password'; } } } $link = THEME . 'index.php'; require_once $link;
exit("SMS配置出错,请联系网站管理员"); } } elseif ($act == 'phone_login') { $_POST = array_map("utf8_to_gbk", $_POST); require_once QISHI_ROOT_PATH . 'include/fun_wap.php'; $mobile = trim($_POST['mobile']); if (empty($mobile)) { exit("3"); } //验证验证码是否正确 $verifycode = trim($_POST['verifycode']); if (empty($verifycode) || empty($_SESSION['mobile_rand']) || $verifycode != $_SESSION['mobile_rand']) { exit("1"); } //登录 if (user_login_new($mobile, 3)) { if (!empty($_SESSION['url']) && !strpos($_SESSION['url'], 'user_get_pass')) { $url = $_SESSION['url']; unset($_SESSION['url']); exit($url); } if ($_SESSION['utype'] == 2) { exit("personal/user.php"); } if ($_SESSION['utype'] == 1) { exit("company/user.php"); } } else { exit("2"); } } elseif ($act == 'waiting_weixin_login') {