All pastes #556950 Raw Edit

Something

public php v1 · immutable
·published 2007-06-10 20:25 UTC
rendered paste body
<? //check for POST data indicating a form submission session_start();if($_POST[submit]==='Y') {	//check to see if the username and authcode match a profile in the 'database'	$found=true;	$profiles=parse_ini_file('./database/personneldata.ini',true);	$found=false;	foreach($profiles as $key => $p) {		if($p['name']==$_POST['officer']) {			$profilekey=$key;			$found=true;		}	}	if($found) {		if(md5($_POST['authcode'])==$profiles[$profilekey][authcode] AND $profiles[$profilekey][active]==1) {						$_SESSION['key']=$profilekey;			$_SESSION['logon_time']=time();			$_SESSION['id']=SID;			$_SESSION['access']=$profiles[$profilekey]['access'];			header("Location: admin.php");		} elseif(md5($_POST['authcode'])!=$profiles[$profilekey][authcode]) { //bad authcode			print("<font color=\"red\">You have submitted an invalid authcode.  Please try again or contact the webmaster for assistance.</font>");		} elseif($profiles[$profilekey][active]!==1) {			print("<font color=\"red\">Your account has been locked out or disabled.  Please contact the webmaster for assistance.</font>");		}	} else {			print("<font color=\"red\">A profile for '$_POST[officer]' was not found!  Please contact the webmaster for assistance!</font>");	}} else { //do the normal login page page$title=$loc[0]='Administration'; //page title for the browser goes hereinclude('includes/header.php'); ?><!--content goes here, just use normal HTML--><div style="position: absolute; width: 687px; height: 491px; z-index:0" id="container"><h1>Administration</h1><div style="display: table; position: absolute; width: 300px; height: 75px; z-index: 1; left:300px; top:208px" id="formarea">		<form method="POST" action="">		Username: <input type="text" name="officer" size="15" style="position: relative; left: 28"><br /><br />		AuthCode: 		<input type="password" name="authcode" size="15" style="position: relative; left:30;"><br /></div>		<input type="submit" value="Transmit!" name="B1" style="position: absolute; left: 440; top: 292">		<input type="hidden" name="submit" value="Y">		</form><div style="position: absolute; width: 282px; height: 275; z-index: 2; left: 0px; top: 108px; border-right-style:dotted; border-right-width:1px" id="instructions"><p><h2>General Use</h2>Text text text text  text text text text text text text text text text text text text text text text text</p><p><h2>Authorized Personnel</h2>Text text text text  text text text text text text text text text text text text text text text text text</p><p><h2>Require Assistance?</h2>Text text text text  text text text text text text text text text text text text text text text text text</p></div><? } //end login page else ?></div><? include('includes/footer.php') ?>