Created
July 6, 2018 00:43
-
-
Save Prid13/74ae9e44f094802919bdcfeedba8d745 to your computer and use it in GitHub Desktop.
Automated login script for phpBB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('IN_PHPBB', true); | |
$phpbb_root_path = './'; | |
$phpEx = substr(strrchr(__FILE__, '.'), 1); | |
include($phpbb_root_path . 'common.' . $phpEx); | |
// Start session management | |
$user->session_begin(); | |
$auth->acl($user->data); | |
if($user->data['is_registered']) | |
{ | |
header('Location: http://website.com/phpBB/'); | |
} | |
else | |
{ | |
$username = request_var('username', '', true); | |
$password = request_var('password', '', true); | |
$result = $auth->login($username, $password); | |
if ($result['status'] == LOGIN_SUCCESS) | |
{ | |
//User was successfully logged into phpBB | |
//echo "Login Success"; | |
header('Location: http://website.com/phpBB/'); | |
} | |
else | |
{ | |
//User's login failed | |
echo "Login Failed"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment