this italian guy is using ts 3.1 but i aint a clue were to add username or id
PHP Code:
//---- Max. Sysops v0.9 by xam
function maxsysop () {
global $CURUSER,$rootpath, $lang;
$lmaxclass = UC_MODERATOR;
$filename = $rootpath . 'config/STAFFNAMES';
$filename2 = $rootpath . 'config/STAFFIDS';
if ($CURUSER['class'] >= $lmaxclass) {
$fp = fopen($filename, 'r');
while (!feof($fp))
{
$staffnames= fgets($fp);
$results = explode(' ', $staffnames);
}
$msg = 'Fake Account Detected: Username: '.$CURUSER['username'].' - UserID: '.$CURUSER['id'].' - UserIP : '.getip();
$subject = 'Warning: Fake Account Detected!';
$added = sqlesc(get_date_time());
if (!in_array($CURUSER['username'], $results, true)) { // true for strict comparison
sql_query('INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES(0, 1, '.$added.', '.sqlesc($subject).', '.sqlesc($msg).', 0)');
write_log($msg);
fclose($fp);
stderr($lang->global['error'], $lang->global['fakeaccount']);
}
fclose($fp);
}
if ($CURUSER['class'] >= $lmaxclass) {
$fp2 = fopen($filename2, 'r');
while (!feof($fp2))
{
$staffids = fgets($fp2);
$results2 = explode(' ', $staffids);
}
if (!in_array($CURUSER['id'], $results2, true)) { // true for strict comparison
sql_query('INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES(0, 1, '.$added.', '.sqlesc($subject).', '.sqlesc($msg).', 0)');
write_log($msg);
fclose($fp2);
stderr($lang->global['error'], $lang->global['fakeaccount']);
}
fclose($fp2);
}
return true;
}
also this is for lukes site is this right??
PHP Code:
//---------------------------------
//---- Max. Sysops v0.2 by xam
//---------------------------------
function maxsysop () {
global $CURUSER;
// Check Staff Names
$lmaxclass = 8;
$lsysopnames = array("",); // Case sensitive. Change this (YOUR SYSOP-ADMIN NAMES GOES HERE) (example: array("root","Clock","adminname3","adminname4","so far")
if ($CURUSER["class"] >= $lmaxclass)
if (!in_array($CURUSER["username"], $lsysopnames, true)) { // true for strict comparison
$msg = "Fake Account Detected: Username: ".$CURUSER["username"]." - UserID: ".$CURUSER["id"]." - UserIP : ".getip();
write_log($msg);
stderr("Access Denied!","We come to believe you are using a fake account, therefore we've logged this action!");
}
// Check Staff IDS
define ('UC_STAFF', 8); // Minumum Staff Level (4= UC_MODERATOR)
if ($CURUSER['class'] >= UC_STAFF) {
$allowed_ID = array(); // Change this (YOUR SYSOP-ADMIN IDS GOES HERE) (example: array(0,1,2,3,4,5))
if (!in_array((int)$CURUSER['id'], $allowed_ID, true)) { // true for strict comparison
$msg = "Fake Account Detected: Username: ".$CURUSER["username"]." - UserID: ".$CURUSER["id"]." - UserIP : ".getip();
write_log($msg);
stderr("Access Denied!","We come to believe you are using a fake account, therefore we've logged this action!");
}
}
}
//---------------------------------
//---- Max. Sysops v0.2 by xam
//---------------------------------