Beispiel #1
0
         if (!checkLoginInfo($macid, $wan_ip . $lan_ip)) {
             alreadyLogin();
         }
         // set session data
         saveLoginInfo($macid, $wan_ip . $lan_ip);
     } else {
         // already login
         if (!checkLoginInfo($userid, $macid)) {
             alreadyLogin();
         }
         // set session data
         saveLoginInfo($userid, $macid);
     }
 } 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);
Beispiel #2
0
<?php

require_once 'query/message.php';
$msg = $_POST;
if (isset($msg['user'])) {
    $user = $msg['user'];
}
if (isset($msg['password'])) {
    $pwd = $msg['password'];
}
$rem = isset($msg['remember']);
if (getUserByName($user) || getUserByEmail($user)) {
    if ($r = checkUserPwd($user, $pwd)) {
        if ($rem) {
            $time = time() + 3600 * 24 * 365;
        } else {
            $time = 0;
        }
        setcookie("DOJSS", DOJSS($r->id, $r->password), $time);
        header("Location:/");
    } else {
        $error = $err['wrongPwd'];
    }
} else {
    $error = $err['noUser'];
}
require_once 'template/login.php';