Phpbb3 Label and login intergration Hack

simur612

Member
May 25, 2018
879
0
16
After doing The Vbulletin hack thought I would give phpbb3 simlar hack

This is untested but most of the code has been pulled of forums and just adjusted to suit our needs

Here is the code to get username from phpbb add this code to your addtorrent just under the $label = null; to pass the username to a label

Code:
// phpBB includes
define('IN_PHPBB', true);
// next one is the physical path to your forums root : CUSTOMIZE
$phpbb_root_path = '/home/user/you/forums/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// Start session
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// From now on, we have user infos
$label=$userdata['username'];
Now this could be fine on it own but people may not be loged in the forum I hear you say to get around this problem open your index.html file from the rutorrent directory and add this line of code somewhere near the top

Code:
<iframe id="logedin" name="logedin" style="width:0px; height:0px; border: 0px" src="logedin.php"></iframe>
I have mine just after the style close


now create a new php script called logedin.php

Code:
<?php
// phpBB includes
define(&#39;IN_PHPBB&#39;, true);
// next one is the physical path to your forums root : CUSTOMIZE
$phpbb_root_path = &#39;/home/user/you/forums/&#39;;
include($phpbb_root_path . &#39;extension.inc&#39;);
include($phpbb_root_path . &#39;common.&#39;.$phpEx);
// Start session
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// From now on, we have user infos
if(!$user->data[&#39;is_registered&#39;])
{
?>
<script type="text/javascript">
top.window.location = '/login.php';
</script>
Create some code for the login calling it login.php

Code:
<?php
define(&#39;IN_PHPBB&#39;, true);
define(&#39;PHPBB_ROOT_PATH&#39;, &#39;./phpBB3/&#39;); // The web server path of whhere your forum is located
$phpbb_root_path = &#39;phpBB3/&#39;; // the relative path to where you forum is located
$rtorrentpath= " "; // your page you want to load after you have loged in.


$phpEx = substr(strrchr(__FILE__, &#39;.&#39;), 1);
include($phpbb_root_path . &#39;common.&#39; . $phpEx);
include($phpbb_root_path . &#39;includes/functions_display.&#39; . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);

/* Start Logout*/
if ($user->data[&#39;is_registered&#39;]){
echo("<form method=&#39;post&#39; action=&#39;".$phpbb_root_path."ucp.php?mode=logout&amp;sid=".$user->data[&#39;session_id&#39;]."&#39;>");
echo("<input type=&#39;submit&#39; name=&#39;logout&#39; value=&#39;Logout&#39;>");
echo("<input type=&#39;hidden&#39; name=&#39;redirect&#39; value=&#39;".$rtorrentpath."/index.html&#39;>");
echo("<br /></form>");
}
/*End Logout*/

/*Start Login Box*/
if (!$user->data[&#39;is_registered&#39;]){
echo("form method=&#39;post&#39; action=&#39;".$phpbb_root_path."ucp.php?mode=login&#39;>");
echo(" Username:");
echo("<br />");
echo(" <input type=&#39;text&#39; name=&#39;username&#39; size=&#39;15&#39; value=&#39;&#39;>");
echo("<br /><br />");
echo(" Password:");
echo("<br />");
echo(" <input type=&#39;password&#39; name=&#39;password&#39; size=&#39;15&#39; value=&#39;&#39;>");
echo("<br /><br />");
echo("<input type=&#39;submit&#39; name=&#39;login&#39; value=&#39;Login&#39;>");
echo("<input type=&#39;hidden&#39; name=&#39;redirect&#39; value=&#39;../".$_SERVER[&#39;PHP_SELF&#39;]."&#39;>");
echo("<br /></form>");
}
/*End Login Box*/
Now someone else posted you could just use as your logon script
Code:
<?php
$path = "path to your forum directory";
?>

Please log in:<br />
<form method="POST" action="<? echo $path; ?>/ucp.php?mode=login">
<p>Username: <input type="text" name="username" size="40" /> /<br />
Password: <input type="password" name="password" size="40" /><br />
Remember Me?: <input type="checkbox" name="autologin" /><br />
<input type="submit" value="Submit" name="login" /></p>
<input type="hidden" name="redirect" value="index.php" />
</form>
Now in theory this should all work but as I said havent tested it.