I share my seedbox with a few mates and to make things easier I have done this hack to use there Vbulletin Username as the label for any newly added torrents
You will need to install Vbull for this to work
In the php directory open addtorrent
find
Code:
$label = null;
Under this add
Code:
define('CWD','/var/www/website/Forum'); // set this as the folder your forum is located
$getcwd = getcwd();
require_once(CWD. '/global.php');
require_once(CWD. '/includes/functions_login.php');
$label=$vbulletin->userinfo['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:
<?
define('CWD','/var/www/website/Forum'); // set this as the folder your forum is located
$getcwd = getcwd();
require_once(CWD. '/global.php');
require_once(CWD.'/includes/functions_login.php');
$hh=$vbulletin->userinfo['logouthash'];
if ($hh == '')
{
?>
<script type="text/javascript">
top.window.location = 'login.php';
</script>
have this code in the same folder as you index.html file and your all done if a user is not loged on to the forum it will direct them to the forum login page.
This is a nice basic way to have a semi secure user access for your seedbox and have forums as well.
Now im sure people could chip in with methods too allow this to work with other forums or user front ends.
Oh I forgot I had created a seperate login.php script as well this should be placed in your rtorrent folder
Code:
<?
define('CWD','/var/www/website/Forum'); // set this as the folder your forum is located
$path= "Forum"; // the relative path to where you forum is located
$rtorrenturl= "http://www.YourSite.com"; // your page you want to load after you have loged in.
// Change settings above to relative paths for your site
ini_set('display_errors','Off');
require_once(CWD. '/global.php');
if(!empty($vbulletin->userinfo['userid']))
{
header( 'Location: '.$rtorrenturl ) ;
}
else
{
?>
<!-- <strong class="highlight">login</strong> form -->
<form action="<? echo $path ?>/login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
<script type="text/javascript" src="Forum/clientscript/vbulletin_md5.js?v=370b5h"></script>
<label for="navbar_username">
<div align="center">User Name
<input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="30" accesskey="u" tabindex="101" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" />
</div>
</label>
<div align="center"></div>
<label for="cb_cookieuser_navbar">
<div align="center"><br />
<input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />
Remember Me?
</div>
</label>
<label for="navbar_password">
<div align="center"><br />
Password
<input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="30" tabindex="102" />
</div>
</label>
<div align="center">
<input type="submit" class="button" value="Log in" tabindex="104" title="Enter your username and password in the boxes provided to <strong class="highlight">
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</div>
</div>
</form>
<!-- / <strong class="highlight">login</strong> form -->
<?
}
Edit (reason added some code)
You will need to install Vbull for this to work
In the php directory open addtorrent
find
Code:
$label = null;
Under this add
Code:
define('CWD','/var/www/website/Forum'); // set this as the folder your forum is located
$getcwd = getcwd();
require_once(CWD. '/global.php');
require_once(CWD. '/includes/functions_login.php');
$label=$vbulletin->userinfo['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:
<?
define('CWD','/var/www/website/Forum'); // set this as the folder your forum is located
$getcwd = getcwd();
require_once(CWD. '/global.php');
require_once(CWD.'/includes/functions_login.php');
$hh=$vbulletin->userinfo['logouthash'];
if ($hh == '')
{
?>
<script type="text/javascript">
top.window.location = 'login.php';
</script>
have this code in the same folder as you index.html file and your all done if a user is not loged on to the forum it will direct them to the forum login page.
This is a nice basic way to have a semi secure user access for your seedbox and have forums as well.
Now im sure people could chip in with methods too allow this to work with other forums or user front ends.
Oh I forgot I had created a seperate login.php script as well this should be placed in your rtorrent folder
Code:
<?
define('CWD','/var/www/website/Forum'); // set this as the folder your forum is located
$path= "Forum"; // the relative path to where you forum is located
$rtorrenturl= "http://www.YourSite.com"; // your page you want to load after you have loged in.
// Change settings above to relative paths for your site
ini_set('display_errors','Off');
require_once(CWD. '/global.php');
if(!empty($vbulletin->userinfo['userid']))
{
header( 'Location: '.$rtorrenturl ) ;
}
else
{
?>
<!-- <strong class="highlight">login</strong> form -->
<form action="<? echo $path ?>/login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
<script type="text/javascript" src="Forum/clientscript/vbulletin_md5.js?v=370b5h"></script>
<label for="navbar_username">
<div align="center">User Name
<input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="30" accesskey="u" tabindex="101" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" />
</div>
</label>
<div align="center"></div>
<label for="cb_cookieuser_navbar">
<div align="center"><br />
<input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />
Remember Me?
</div>
</label>
<label for="navbar_password">
<div align="center"><br />
Password
<input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="30" tabindex="102" />
</div>
</label>
<div align="center">
<input type="submit" class="button" value="Log in" tabindex="104" title="Enter your username and password in the boxes provided to <strong class="highlight">
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</div>
</div>
</form>
<!-- / <strong class="highlight">login</strong> form -->
<?
}
Edit (reason added some code)