} } else { // check user id $row = checkUserPwd($conn, $userid, $password); if ($row == null) { invalidUser(); } $uid = $row["id"]; $usertype = $row["type"]; $userflag = $row["flag"]; $buffersize = $row["buffersize"]; $agentstoreid = $row["agentstoreid"]; $activation = $row["activation"]; if ($userid != "anonymous") { // already login if (!checkLoginInfo($userid, $macid)) { alreadyLogin(); } $row = getUserFromMacID($conn, $macid); if ($row != null) { $old_uid = $row["id"]; } else { $old_uid = null; } if ($old_uid == null || $old_uid != $uid) { // delete old macid if ($old_uid != null) { $sql = "update tbl_user_macid set delete_flag=1, update_id=" . correctSQL($userid) . ", update_date=now() where userid=" . correctSQL($old_uid) . " and macid=" . correctSQL($macid); executeSQL($conn, $sql); $sql = "\n\t\t\t\t\t\tupdate tbl_user a,\n\t\t\t\t\t\t(\n\t\t\t\t\t\tselect a.userid, a.macid\n\t\t\t\t\t\tfrom tbl_user_macid a,\n\t\t\t\t\t\t(select userid, max(update_date) as update_date from tbl_user_macid where delete_flag=0 group by userid) b\n\t\t\t\t\t\twhere a.delete_flag=0 and a.userid=b.userid and a.update_date=b.update_date\n\t\t\t\t\t\t) b\n\t\t\t\t\t\tset a.macid = b.macid\n\t\t\t\t\t\twhere a.id = b.userid and a.id=" . correctSQL($old_uid); executeSQL($conn, $sql);
<?php /** * Created by PhpStorm. * User: fish * Date: 2015/12/11 * Time: 10:24 */ require_once 'sessionProcess.php'; checkLoginInfo(); echo $_GET['user'] . '登录成功'; require_once 'timeProcess.php'; getLastVisitTime(); ?> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" > </head> </br> <a href="empList.php">查看雇员信息</a> </html>