Advertisement
Guest User

Untitled

a guest
Jul 4th, 2018
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <html>
  2. <body>
  3. <?php
  4.  
  5. $username = $_POST['username'];
  6. $password = $_POST['password'];
  7.  
  8. $startTime = microtime(true);
  9.  
  10. require('library/XenForo/Autoloader.php');
  11.  
  12. XenForo_Autoloader::getInstance()->setupAutoloader('library/');
  13.  
  14. XenForo_Application::initialize('library/',"../forum/");
  15. XenForo_Application::set('page_start_time', $startTime);
  16.  
  17.  
  18. $Xendb = XenForo_Application::getDb();
  19.  
  20. $data = $Xendb->fetchOne('
  21. SELECT
  22. auth.data
  23. FROM xf_user_authenticate AS auth
  24. INNER JOIN xf_user AS user ON
  25. (user.user_id = auth.user_id)
  26. WHERE user.username = ?
  27. ', $username);
  28.  
  29. $auth = XenForo_Authentication_Abstract::createDefault();
  30.  
  31. $auth->setData($data);
  32.  
  33. $check = $auth->authenticate($username, $password);
  34.  
  35. if($check){
  36. /*$url = 'localhost:3000/authentication';
  37. $data = array('login' => 'successful');
  38.  
  39. // use key 'http' even if you send the request to https://...
  40. $options = array(
  41. 'http' => array(
  42. 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
  43. 'method' => 'POST',
  44. 'content' => http_build_query($data)
  45. )
  46. );*/
  47. echo '{login: "success}'
  48. }else{
  49. echo '{login: "failure}'
  50. }
  51.  
  52. ?>
  53. </body>
  54. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement