I adapted the security mod of my old tracker for TT v.2.7
It is based on a security list where the names of all staff members must be written. If someone manage to promote himself higher than Uploader
his name is not found in the security list and he it receives demote, disable and the owner (ID=1) receives a warning message.
In backend/functions.php, after this line:
...
It is based on a security list where the names of all staff members must be written. If someone manage to promote himself higher than Uploader
his name is not found in the security list and he it receives demote, disable and the owner (ID=1) receives a warning message.
In backend/functions.php, after this line:
$GLOBALS['tstart'] = array_sum(explode(" ", microtime()));Include this code: //===== Security Staff =====//
function security_staff ()
{
global $CURUSER;
$class_m = 5; //number class of MODERATOR
$max = array("name1","name2","name3");
//== Case sensitive. (example: array("adminname1","adminname2","adminname3","so far") ==//
if ($CURUSER["class"] >= $class_m)
if (!in_array($CURUSER["username"], $max, true)) { // true for strict comparison
$msg = "Attention! a user has managed to promote by himself in staff and was not found in the security list:
Username: ".$CURUSER["username"].";
User ID: ".$CURUSER["id"].";
IP: ".getip();
mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES(0, 0, '1', '" . get_date_time() . "', " .sqlesc($msg) . ")");
mysql_query("UPDATE users set enabled='no' WHERE id=$CURUSER[id]");
mysql_query("UPDATE users set class='1' WHERE id=$CURUSER[id]");
show_error_msg("Your username not found in security list and your account will be disabled. Have a nice day!");
}
}
//=== End Security Staff ===//
After that, into each page you want to protect, after this line:
dbconn();
Copy this code:
//===== Security Staff =====//
security_staff();
if ($CURUSER["class"] > 9) { // highest class number
stdhead();
show_error_msg("FUCK OFF DUDE", "Stop cheating or you will be banned");
stdfoot(); exit; }
//=== End Security Staff ===//...
