Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 10th December 2010, 23:51
razvikennedy's Avatar
razvikennedy razvikennedy is offline
Member
 
Join Date: Apr 2010
P2P
Posts: 4
Default Quick Ban
This scripts allows you to ban very quickly

quickban.php
PHP Code:
<?require "include/bittorrent.php";dbconn(false);loggedinorreturn();
if (get_user_class() < UC_ADMINISTRATOR)    stderr("Error", "Access denied.");
if ($_SERVER["REQUEST_METHOD"] == "POST" && get_user_class() >= UC_ADMINISTRATOR){    $userid = trim($_POST["userid"]);    
if (!$userid)        stderr("Error", "Missing form data.");   

$res = mysql_query("SELECT * FROM users WHERE id = $userid");   
$res2 = mysql_query("UPDATE users SET enabled = 'NO' WHERE id = $userid");    
$row = mysql_fetch_assoc($res);    
$comment = $row["username"];    
$ip = $row["ip"];    $longip = ip2long($ip);    
$added = sqlesc(get_date_time());    
mysql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES($added, $CURUSER[id], $longip, 
$longip, '$comment')");    header("Location: $server_name$_SERVER[REQUEST_URI]");    die;}ob_start("ob_gzhandler");stdhead("Quickban");   
 
print("<h2>Add ban</h2>\n");    
print("<table border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");    
print("<form method=\"post\" action=\"quickban.php\">\n");    
print("<tr><td class=\"rowhead\">UserID</td><td><input type=\"text\" name=\"userid\" size=\"40\"></td>\n");   print("<tr><td colspan=\"2\"><input type=\"submit\" value='Okay' class=\"btn\"></td></tr>\n");    
print("</form>\n</table>\n");    stdfoot();?>
Reply With Quote
Reply

Tags
ban , quick

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 08:28. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2022, vBulletin Solutions Inc.