Example #1
0
 function processLoginResult($result)
 {
     $foo = User::getUserInfo($result);
     // get the userID, etc
     // @TODO: This may never hit
     if (empty($foo)) {
         // first time on The List
         User::makeUser($result);
         // make a User
         $foo = User::getUserInfo($result);
         // now get the userID
     }
     // Now let's make a session for the user
     $userid = $foo['id'];
     $session = User::getUserSession($userid);
     $session['email'] = $result;
     return $session;
 }
Example #2
0
        if (strlen($_POST['password']) < 4) {
            $output['code'] = 502;
            $output['type'] = 'danger';
            $output['message'] = 'Password must be of at least 4 chars';
        } else {
            if ($auth->checkAdmin($_POST['username'], $_POST['password'], true)) {
                $output['code'] = 200;
                $output['type'] = 'success';
                $output['message'] = 'Logged in successfully.';
            } else {
                Requests::register_autoloader();
                $responce = Requests::post("https://www.psit.in/psit/loginlist.php", array(), array('username' => $_POST['username'], 'password' => $_POST['password'], 'rand' => '5266'));
                $data = $responce->body;
                if ($data == "164") {
                    $output['code'] = 200;
                    $output['type'] = 'success';
                    $output['message'] = 'Logged in successfully.';
                    if (!$user->isUser($_POST['username'])) {
                        $user->makeUser($_POST['username']);
                    }
                    $auth->letHimGainAccess($_POST['username']);
                } else {
                    $output['code'] = 404;
                    $output['type'] = 'danger';
                    $output['message'] = 'Username/Password is wrong';
                }
            }
        }
    }
}
echo json_encode($output);