define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = 'php'; include('common.php'); include('includes/functions_user.php'); include('phpbb/passwords/manager.php'); $provider_collection = $phpbb_container->get('auth.provider_collection'); $provider = $provider_collection->get_provider(); $result = $provider->login($username, $password); if ($result['status'] === 3) { echo 'Login successful.'; } else { echo 'Login failed!'; }
The first three lines are important even if they don't immediately appear to do anything - the included phpBB files check them. Also note that if you're getting the username and password to verify from GET or POST parameters, you'll need to extract them into variables before including the phpBB files because phpBB seems to somehow disable superglobals; attempting to use them results in an error page.
Some of the above script is from this forum post.
No comments:
Post a Comment