Location: PHPKode > projects > Soraxdesign PHP Guestbook > admin/settings_main.passwort.inc.php
<?php
if($session_id==$sess_id and $session_id!="" and $sess_id!="")
{
	if($do=="")
	{
		if(file_exists("../Data/pw.dat"))
		{
		$time=time();
		$filetime=filemtime("../Data/pw.dat");
		$differenz=$time-$filetime;
		$letzte_aenderung=date("d.m.Y - H:i:s", $filetime);
			if($differenz>2419200)
			{
			$warnung="<br><b><font color=\"red\"><br>".$sprache[114]."</b></font>";
			}
		}
	?>
	<form name="form1" method="post" action="admin.php?action=login&go=1&session_id=<?php echo $sess_id ?>&show=passwort&do=edit_pw" style="margin:0px;padding:0px">
	<div id="grundeinstellungen" style="position:absolute;width:800px;margin:0px;overflow:auto;height:407px">
		<div class="warnung" style="width:770px">
		<span class="warnung_text"><?php echo $sprache[112] ?></span>
		</div>
		<div class="titeldiv" style="width:770px;background-color:#E9E6E6;border:1px solid #D5D5D5">
		<b><?php echo $sprache[113] ?></b>&nbsp &nbsp <?php echo $letzte_aenderung ?><?php echo $warnung ?>
		</div>
		<div class="titeldiv" style="width:770px;background-color:#FFFFFF;border:1px solid #EAEAEA;height:80px">
		<span class="titel"><?php echo $sprache[116] ?></span>
		<br><br>
			<div style="float:left;width:200px;padding-left:5px">
			<?php echo $sprache[117] ?>
			<br><br>
			<input type="password" style="border:1px solid #E0DAC4" name="pwalt" maxlength="20">
			</div>
			<div style="float:left;width:200px">
			<?php echo $sprache[118] ?>
			<br><br>
			<input type="password" style="border:1px solid #E0DAC4" name="pwneu1" maxlength="20">
			</div>
			<div style="float:left;width:200px">
			<?php echo $sprache[119] ?>
			<br><br>
			<input type="password" style="border:1px solid #E0DAC4" name="pwneu2" maxlength="20">
			</div>
		</div>
	</div>
	<div id="menu_unten" style="position:absolute;margin-top:407px;width:800px;height:25px;background-image:url('images/symbolleisten/menu_back_unten.jpg')">
		<div style="float:left;height:25px;background-image:url('images/symbolleisten/menu_back_unten_button.jpg');border-right:1px solid #83ACCA">
			<div style="margin-left:10px;margin-top:7px;margin-right:10px">
			<a href="admin.php?action=login&go=1&session_id=<?php echo $session_id ?>" class="menu"><?php echo $sprache[95] ?></a>
			</div>
		</div>
		<div style="float:right;height:25px;background-image:url('images/symbolleisten/menu_back_unten_button.jpg');border-left:1px solid #83ACCA">
			<div style="margin-left:10px;margin-top:7px;margin-right:10px">
			<a href="javascript:document.form1.submit()" class="menu"><?php echo $sprache[115] ?></a>
			</div>
		</div>
	</div>
	</form>
	<?php
	}
	
	if($do=="edit_pw")
	{
	echo"<br><br>";
	$pwalt=$_POST['pwalt'];
	$pwneu1=$_POST['pwneu1'];
	$pwneu2=$_POST['pwneu2'];
	$file=file("../Data/pw.dat");
		if(sha1($pwalt)==$file[0])
		{
			if($pwneu1!="" and $pwneu2!="")
			{
				if($pwneu1==$pwneu2)
				{
				$fp=fopen("../Data/pw.dat","w");
				$pwneu=sha1($pwneu2);
				fputs($fp,$pwneu);
				fclose($fp);
				echo"
				<br><br>
				<center>
				<font color=\"#2F9A1E\"><b>$sprache[120]<br><br><a href=\"admin.php?go=1&session_id=$sess_id&action=login&show=passwort\" class=\"links\">$sprache[95]</a></b></font>
				</center>
				";
				$_SESSION['passwort_weiter']=$pwneu;
				}
				else
				{
				echo"
				<br><br>
				<center>
				<font color=\"red\"><b>$sprache[121]</b><br><br><a href=\"javascript:history.back()\" class=\"links\">$sprache[95]</a></font>
				</center>
				";
				}
			}
			else
			{
			echo"
			<br><br>
			<center>
			<font color=\"red\"><b>$sprache[122]</b><br><br><a href=\"javascript:history.back()\" class=\"links\">$sprache[95]</a></font>
			</center>
			";
			}
		}
		else
		{
		echo"
		<br><br>
		<center>
		<font color=\"red\"><b>$sprache[123]</b><br><br><a href=\"javascript:history.back()\" class=\"links\">$sprache[95]</a></font>
		</center>
		";
		}
	}
}
else
{
echo"<meta http-equiv=\"refresh\" content=\"0; URL=error.php\" target=\"_top\">";
}
?>
Return current item: Soraxdesign PHP Guestbook