Location: PHPKode > scripts > Bioloide > botlane/authorize.php
<?php 
session_start(); 
$users = "scriptol-users.php";
function authorize($login, $passwd)
{ 

  global $users;
	$pass5 = "x". MD5($passwd);

  if(!@file_exists($users)) return false;
	if(stristr($login,'<') !== false)	die("Hacking");	
	if(stristr($passwd,'<') !==false)	die("Hacking");	
	if(empty($login)) return false;
	if(strlen($login) < 3)
	{
		echo "Login must be 3 letters at least. Install again.<br>";
		return false;
	}

	$fp = fopen( $users, 'r' ); 

	while( !feof( $fp ) ) 
	{ 
		$line = trim( fgets( $fp, 1000 ) ); 
		list( $l, $p, $u ) = explode( ',', $line ); 
		
    //echo "$l $p $u --- ".$_SERVER[REMOTE_ADDR]." ".md5($_SERVER[REMOTE_ADDR])."<br>";

		if(strcmp($u , "admin") != 0) continue;
		if($l == 'ip')
		{
		    $computer = $_SERVER[REMOTE_ADDR]; 
	    	$ip = md5($computer);
	    	if($p == $ip) 
	      { 
		      $_SESSION["login"] = $computer;
		      $_SESSION["password"] = $computer;
          fclose($fp);	   		
		      return true;
        }  
    }
		//echo "compare $l and $login<br>";
		if($l != $login) continue;
 		if($p == $pass5)	// same login, same pass, and admin
		{ 

			$authlist = array("login" => $login); 
			session_register( 'authlist' ); 

			$_SESSION["login"] = $login;
			$_SESSION["password"] = $passwd;
      fclose($fp);			
			return true; 
		} 
		else
		{
			break;
		}
	} 

  fclose($fp);
	unset( $authlist); 
	return false; 
}

?>
Return current item: Bioloide