Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Community Cafe (http://www.bvlist.com/forumdisplay.php?f=18)
-   -   maxsysops (http://www.bvlist.com/showthread.php?t=1167)

wMan 14th October 2008 22:40

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 ???

3v0 14th October 2008 22:48

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!");           
        }       
    }
}


Subzero 14th October 2008 22:48

Yes we know that

3v0 14th October 2008 22:49

Quote:

Originally Posted by Darkseeder (Post 5305)
Yes we know that

Know what?

wMan 14th October 2008 22:50

so were the feck do the username and id go??

3v0 14th October 2008 22:52

Quote:

Originally Posted by clocktower (Post 5307)
so were the feck do the username and id go??

You at the wind up? READ THE CODE!!!

wMan 14th October 2008 22:54

i am but it doesnt show were to add the bloody ids

3v0 14th October 2008 22:56

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!");
                }
        }
}


wMan 14th October 2008 22:57

ok soz m8 this guy doesnt even know his own site id pffft sod that hehehe

3v0 14th October 2008 22:59

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 #

luke 14th October 2008 23:00

Quote:

Originally Posted by clocktower (Post 5311)
ok soz m8 this guy doesnt even know his own site id pffft sod that hehehe

id = 1.

wMan 14th October 2008 23:00

well ive added his username admin id=1

3v0 14th October 2008 23:03

Quote:

Originally Posted by clocktower (Post 5314)
well ive added his username admin id=1

It would be $lsysopnames = array("Luke"); I only used admin1 admin2 as an example

wMan 14th October 2008 23:04

well his id =0 username root (dunno why) but on site hes just sysop



this is that guys im trying to help


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))
            { 
                
$staffnamesfgets($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'], $resultstrue)) { // 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'], $results2true)) { // 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;



3v0 14th October 2008 23:08

Just replace the whole maxsyops function with the one I posted. Is that v0.9 one from TemplateShares code?

wMan 14th October 2008 23:09

i did 3vo but he gets a white page

3v0 14th October 2008 23:11

Which source is being used here TBDEV or TS?

adry93 14th October 2008 23:12

TS

wMan 14th October 2008 23:12

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))

$staffnamesfgets($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'], $resultstrue)) { // 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'], $results2true)) { // 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"], $lsysopnamestrue)) { // 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_IDtrue)) { // 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
//--------------------------------- 


3v0 14th October 2008 23:21

No idea how that source works sorry but looking at that code I'm guessing it's all built in somehow without having to edit the username or id's in a file each time you promote someone to staff class.

As for luke

PHP Code:

function maxsysop () {
    global 
$CURUSER;
    
// Check Staff Names
    
$lmaxclass  8;
    
$lsysopnames = array("root","Clock"); // 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"], $lsysopnamestrue)) { // 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'8); // Minumum Staff Level (50= UC_MODERATOR)
    
if ($CURUSER['class'] >= UC_STAFF) {
        
$allowed_ID = array(0,1,2,3,4,5); // Change this (YOUR SYSOP-ADMIN IDS GOES HERE) (example: array(1,2,3,4,5))
        
if (!in_array((int)$CURUSER['id'], $allowed_IDtrue)) { // 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!");
        }
    }



wMan 14th October 2008 23:22

when i had 4.3 xam code we had to go in admincp panel and add usernames and ids for new staff so they didint get fake account detected

Dragan3591 14th October 2008 23:23

By the look of things in that first code it looks like it gets name from config file but that's confusing! Am I wrong?

wMan 14th October 2008 23:29

yeah i looked dragan nothing but site configs but nothing about maxsysops its got to be in admincp panel or staff panel on site

Dragan3591 14th October 2008 23:31

Where to hell did that code come from??

wMan 14th October 2008 23:36

its a guy called adry from here feck knows were from

Dragan3591 14th October 2008 23:49

That actually doesn't look like TBDev code at all, but idea is good. It does look like a good idea because it takes it from profile when you give status from someone, which just reminded me. Xam had that done same way in his 1.3.9 or whatever was name of that code. But that was taken from TBDev which doesn't make sense.
This code also might came from Btit for all I know

wMan 14th October 2008 23:54

well its deffo xam code but when i had it i didnt edit the code i went to
a admin panel built in on site added each staff username and id and they could get on site
sod it ive tried to help him feel awfull but told him to use tbdev or another

Dragan3591 15th October 2008 00:03

Yeah, on 3.1 version. We need to find that code and redecorate it. I think paralax came up with it.

fireman 19th November 2008 17:21

PLEASE HELP
 
I have installed ts 4.3 but have had a problem i entered user name and id in manage staff team and it says error fake account can someone upload fix on this plz. :sos:


All times are GMT +2. The time now is 17:45.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.