} } else { return false; } } if (isset($_POST["login"])) { $pass = sha1($_POST["pass"]); if (login2($user, $pass)) { $_SESSION["new_login"] = 2; header("location: ./"); } else { $ress = "The username/email doesn't match the password provided"; } } if (isset($_COOKIE["um"]) && isset($_COOKIE["pm"])) { if (login2($_COOKIE["um"], $_COOKIE["pm"])) { $_SESSION["new_login"] = 2; header("location: ./"); } else { $ress = ""; } } if (isset($_POST["add"])) { $con = new db(); $conc = $con->c(); $cont = true; $q = mysqli_query($conc, "SELECT `id` FROM users WHERE email = '{$email}'"); if (mysqli_num_rows($q) == 1) { $cont = false; session_destroy(); $res = "That email address is already registered";
$login = login(USERNAME, $passwd, $verify[1]); if (is_array($login) && $login['4'] == "登录成功!") { log_message("debug", "初次登陆成功:" . $login['5']); } elseif (isset($login[4])) { log_message("error", "初次登陆失败:" . $login[4]); exit("初次登陆失败\n"); } else { log_message("error", "初次登陆失败"); exit("初次登陆失败\n"); } // 获取cookie信息 $cookie = get_cookie(); // 生成客户端id $cookie['clientid'] = mt_rand(50888888, 80888888); // 真正的上线 $login = obj_to_array(json_decode(login2($cookie['ptwebqq'], $cookie['clientid']))); if ($login['retcode'] == 0) { $cookie["login"] = $login['result']; log_message("debug", "已成功上线"); } else { log_message("error", "登陆失败,可能原因:vfwebqq参值不正确"); exit("登陆失败,可能原因:vfwebqq参值不正确"); } // 获取好友列表 // $friend_list = obj_to_array(json_decode(get_user_friend($cookie['login']['vfwebqq']))); // 获取群列表 $group_name_list = obj_to_array(json_decode(get_group_name_list_mask($cookie['login']['vfwebqq']))); // 获取管理员id // $my_uin = get_friend_uin($friend_list); //http://s.web2.qq.com/api/get_friend_uin2?tuin={$tuin}&verifysession=&type=1&code=&vfwebqq={$vfwebqq}c&t=136610165502 print_r($cookie);
header('Cache-Control: no-store, no-cache, must-revalidate'); header('Pragma: no-cache'); // HTTP 1.0. header('Expires: 0'); // Proxies. require 'config.inc.php'; require 'functions.inc.php'; session_start(); @($db = new mysqli($mysql_host, $mysql_user, $mysql_pw, $mysql_db)) or die($db->error); $user = 0; $name = ''; if (isset($_SESSION['userid'])) { $user = $_SESSION['userid']; $name = $_SESSION['username']; } elseif (isset($_COOKIE['usertoken'])) { $res = login2($_COOKIE['usertoken']); if ($res['msg'] == 'OK') { $user = $_SESSION['userid']; $name = $_SESSION['username']; } } ?> <!DOCTYPE html> <html ng-app="TVShowManager"> <head> <title>TV Show Manager</title> <meta charset="utf-8"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
} } $postdata = file_get_contents("php://input"); if (!empty($postdata)) { $_POST = json_decode($postdata, TRUE); } if (!empty($_GET['search'])) { $res = search(urldecode($_GET['search'])); } elseif (!empty($_GET['show'])) { $res = getShow($_GET['show'], isset($_GET['force']), isset($_GET['q'])); } elseif (isset($_GET['usershows'])) { $res = getUserShows(); } elseif (!empty($_POST['addshow'])) { $res = addShow($_POST['addshow']); } elseif (!empty($_POST['delshow'])) { $res = delShow($_POST['delshow']); } elseif (!empty($_POST['updateshow'])) { $res = updateShow($_POST['updateshow']); } elseif (!empty($_POST['username']) && !empty($_POST['password'])) { $res = login($_POST['username'], $_POST['password'], isset($_POST['stay']) && $_POST['stay']); } elseif (!empty($_POST['token'])) { $res = login2($_POST['password']); } elseif (isset($_POST['logout'])) { $res = logout(); } elseif (!empty($_POST['registername']) && !empty($_POST['password'])) { $res = register($_POST['registername'], $_POST['password']); } else { $res = array('msg' => 'Command not set', 'post' => $_POST, 'get' => $_GET); } header("Content-type: application/json"); echo json_encode($res);
<?php include_once 'includes/db_connect.php'; include_once 'includes/functions.php'; sec_session_start(); // Our custom secure way of starting a PHP session. if (isset($_POST['email'], $_POST['p'])) { $email = $_POST['email']; $password = $_POST['p']; // The hashed password. if (login($email, $password, $mysqli) == true) { // Login success header('Location: admin/protected_page.php'); } elseif (login1($email, $password, $mysqli) == true) { // Login success header('Location: user1/protected_page.php'); } elseif (login2($email, $password, $mysqli) == true) { // Login success header('Location: user2/protected_page.php'); } elseif (login3($email, $password, $mysqli) == true) { // Login success header('Location: user3/protected_page.php.php'); } else { // Login failed header('Location: index.php?error=1'); } } else { // The correct POST variables were not sent to this page. echo 'Invalid Request'; }