Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- $username = $_POST['username'];
- $password = $_POST['password'];
- $startTime = microtime(true);
- require('library/XenForo/Autoloader.php');
- XenForo_Autoloader::getInstance()->setupAutoloader('library/');
- XenForo_Application::initialize('library/',"../forum/");
- XenForo_Application::set('page_start_time', $startTime);
- $Xendb = XenForo_Application::getDb();
- $data = $Xendb->fetchOne('
- SELECT
- auth.data
- FROM xf_user_authenticate AS auth
- INNER JOIN xf_user AS user ON
- (user.user_id = auth.user_id)
- WHERE user.username = ?
- ', $username);
- $auth = XenForo_Authentication_Abstract::createDefault();
- $auth->setData($data);
- $check = $auth->authenticate($username, $password);
- if($check){
- /*$url = 'localhost:3000/authentication';
- $data = array('login' => 'successful');
- // use key 'http' even if you send the request to https://...
- $options = array(
- 'http' => array(
- 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
- 'method' => 'POST',
- 'content' => http_build_query($data)
- )
- );*/
- echo '{login: "success}'
- }else{
- echo '{login: "failure}'
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement