By default backup-database.php sits in the root of your TorrentTrader Installation... This can be directly accessed and if people create a automatic bot with say a for loop and curl u could find your server full of backups which wasnt created by you or even worse because of the amount of system calls your server could die, Torrentialstorm said he used HTTP Authentication for his so i will show you how to do that here...
# Secured Code Here...
Adding
The default user & pass are Username and Password these could be changed to anything you desire and also the realm could be changed to anything it doesnt have to stay as TT2-SVN i put that there as im thinking of probably adding this to the svn, after you have tested this and if your happy then u can copy the contents of backup-database.php to below # Secured Code Here... and this will mean only Authenticated Users can create backups....
If you require any assistance feel free to reply.
<?php
//
// TorrentTrader v2.x
// $LastChangedDate: 2011-11-18 04:28:50 +0000 (Fri, 18 Nov 2011) $
// $LastChangedBy: dj-howarth1 $
//
// http://www.torrenttrader.org
//
//
# For Security Purposes.
if ( $_SERVER['PHP_AUTH_USER'] != 'Username' && $_SERVER['PHP_AUTH_PASS'] != 'Password' )
{
header('WWW-Authenticate: Basic realm="TT2-SVN"');
header('HTTP/1.1 401 Unauthorized');
die;
}
# Secured Code Here...
?>If you experiment with the above code to any file it should show up like the screenshot if they press cancel nothing will appear, you can test this by below# Secured Code Here...
Adding
echo "You are logged In.";The default user & pass are Username and Password these could be changed to anything you desire and also the realm could be changed to anything it doesnt have to stay as TT2-SVN i put that there as im thinking of probably adding this to the svn, after you have tested this and if your happy then u can copy the contents of backup-database.php to below # Secured Code Here... and this will mean only Authenticated Users can create backups....
If you require any assistance feel free to reply.
