Bravo List
Register
Go Back   > Bravo List > P2P > Forum > Community Cafe
Reply
  #1  
Old 14th October 2008, 22:40
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Default maxsysops
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

were the hell in that bit of code r u supposed to add ur username and id ???
Reply With Quote
  #2  
Old 14th October 2008, 22:48
3v0 3v0 is offline
Senior Member
 
Join Date: Feb 2008
Netherlands
Posts: 88
Default
That code will be for XAM shitty Template Shares.

Nothing wrong in using this one which can be found on TBDEV

Code:
function maxsysop () {
global $CURUSER;
// Check Staff Names
$lmaxclass  = 8;
$lsysopnames = array("",); // Case sensitive. Change this (YOUR SYSOP-ADMIN NAMES GOES HERE) (example: array("adminname1","adminname2","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', 5); // Minumum Staff Level (4= UC_MODERATOR)
if ($CURUSER['class'] >= UC_STAFF) {
    $allowed_ID = array(); // Change this (YOUR SYSOP-ADMIN IDS GOES HERE) (example: array(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!");            
        }        
    }
}
Reply With Quote
  #3  
Old 14th October 2008, 22:48
Subzero's Avatar
Subzero Subzero is offline
Coder
 
Join Date: Jul 2008
P2P
Posts: 190
Default
Yes we know that
Reply With Quote
  #4  
Old 14th October 2008, 22:49
3v0 3v0 is offline
Senior Member
 
Join Date: Feb 2008
Netherlands
Posts: 88
Default
Quote:
Originally Posted by Darkseeder View Post
Yes we know that
Know what?
Reply With Quote
  #5  
Old 14th October 2008, 22:50
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Default
so were the feck do the username and id go??
Reply With Quote
  #6  
Old 14th October 2008, 22:52
3v0 3v0 is offline
Senior Member
 
Join Date: Feb 2008
Netherlands
Posts: 88
Default
Quote:
Originally Posted by clocktower View Post
so were the feck do the username and id go??
You at the wind up? READ THE CODE!!!
Reply With Quote
  #7  
Old 14th October 2008, 22:54
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Default
i am but it doesnt show were to add the bloody ids
Reply With Quote
  #8  
Old 14th October 2008, 22:56
3v0 3v0 is offline
Senior Member
 
Join Date: Feb 2008
Netherlands
Posts: 88
Default
Code:
function maxsysop () {
	global $CURUSER;
	// Check Staff Names
	$lmaxclass  = 100;
	$lsysopnames = array("Admin1", "Admin2", etc etc); // Case sensitive. Change this (YOUR SYSOP-ADMIN NAMES GOES HERE) (example: array("adminname1","adminname2","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);
		mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES(0, 0, '1', '" . get_date_time() . "', " .sqlesc($msg) . ")") or sqlerr(__FILE__, __LINE__);
		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', 50); // Minumum Staff Level (50= UC_MODERATOR)
	if ($CURUSER['class'] >= UC_STAFF) {
		$allowed_ID = array(1,2,3,etc etc); // Change this (YOUR SYSOP-ADMIN IDS GOES HERE) (example: array(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!");
		}
	}
}
Reply With Quote
  #9  
Old 14th October 2008, 22:57
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Default
ok soz m8 this guy doesnt even know his own site id pffft sod that hehehe
Reply With Quote
  #10  
Old 14th October 2008, 22:59
3v0 3v0 is offline
Senior Member
 
Join Date: Feb 2008
Netherlands
Posts: 88
Default
Well if it's his site I'm guessing he'll be id=1 :P or if he aint sure about that he can go to his profile and look at the address url to see his id #
Reply With Quote
Reply

Tags
maxsysops

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 06:51. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.