Location: PHPKode > projects > AccSoft > accsoft/www/index2.php
<?
// Specify web root directory
session_start();
session_register("WWWDIR","SRCDIR","USER","SESSION_ID","RIGHTS","USER_IP");

$script=dirname($SCRIPT_NAME);
if ($SERVER_PORT == 80) $WWWDIR="http://$SERVER_NAME$script";
else if ($SERVER_PORT == 443) $WWWDIR="https://$SERVER_NAME$script";
$SRCDIR=dirname($SCRIPT_FILENAME);


require "$SRCDIR/lib/table_func.php";


if (testvar($login) == 0) $USER=$login;
else {
	flush();
	exit;
}

$SESSION_ID=session_id();
$USER_IP=$_SERVER["REMOTE_ADDR"];

$conn = DB_Connect();
$result=DB_Query("SELECT * FROM user WHERE login LIKE '$USER'");
$record=DB_Fetch_Array($result);
$salt12=substr($record["password"],0,12); // for md5
$salt2=substr($record["password"],0,2); // for old unix (DES)
if (crypt($passwd,$salt12)==$record["password"]) {


	$RIGHTS=$record["rights"];

?>

<html>
  <frameset rows="100,*">
    <frame src = "main.php" name="menu" scrolling="no" frameborder="no" marginheight="0" marginwidth="0">

    <frame src = "body.php" name="body" scrolling="yes" frameborder="yes" marginheight="0" marginwidth="0" bordercolor="#999999" framespacing="2">

  </frameset>
</html>
<?

} elseif (crypt($passwd,$salt2)==$record["password"]) {
	$RIGHTS=$record["rights"];

?>

<html>
  <frameset rows="100,*">
    <frame src = "main.php" name="menu" scrolling="no" frameborder="no" marginheight="0" marginwidth="0">

    <frame src = "body.php" name="body" scrolling="yes" frameborder="yes" marginheight="0" marginwidth="0" bordercolor="#999999" framespacing="2">

  </frameset>
</html>
<?
	
}
else {
	echo "<html><body><font color=red size=+3>Unauthorized access !!!</font></body></html>";
	session_destroy();
}

?>
Return current item: AccSoft