Advertisement
RockstarPtr

Ajax File - Processing a login request

Jan 14th, 2017
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. if ( isset( $_POST['submit'] ) && $_SESSION['csrfToken'] == $_POST['csrfToken'] ) {
  2.        
  3.         $http_request = new http_req($Core->protocol . '://' . $Core->www_address . '/native/validate');
  4.         $request = $http_request->make_post_request($_POST, false);
  5.         $result = $http_request->POSTResponse()['return'] ? true : false;
  6.         if($result == false)
  7.             echo Error::HandleJsonError($http_request->POSTResponse());
  8.         else {
  9.             $_SESSION['username'] = $_POST['username'];
  10.             $_SESSION['password'] = $_POST['password'];
  11.             $Core->login($_SESSION);
  12.             echo 'OAuthValidated';          // <- OAuthValidated is just a identifier, not really a keyword or state.
  13.         }
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement