<?
//board-tnk v2.1 admin page
//Thierry Nkaoua hide@address.com
// http://www.linux-sottises.net
include ("include/config_board.php");
// store password in cookie, and reset it to "" if logout
if($bp){
$login_password=$bp;
}else{
if(isset($login_password)){
$login_password=crypt($login_password,"tn");
if($login_password==$admin_password){
setcookie("bp",$login_password, time() + $time_cookie);
}
}
}
if($admin=="logout"){
$login_password="";
setcookie("bp","", time()-3600);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<?
include("include/head.inc");
?>
</head>
<?
print("<body><center><h2>$talk[47]</h2></center>");
// Check URL manipulation!
if(sizeof($HTTP_GET_VARS)!=0){
print("$talk[48]");
exit();
}
// Authentification
$auth=($login_password==$admin_password);
// if no authentification then show login screen
if(!$auth){
// bad password has been given
if($login==$talk[23]){
print("<center><b>$talk[49]</b></center>");
}
// login screen if authentification is not achieved
?>
<center>
<form action="<? print("$SELF"); ?>" method="post">
<input type="hidden" name="admin" value="0">
<table border="1" cellspacing="5" cellpadding="5">
<tr class="head">
<td><? print("$talk[50]");?>:</td>
<td><input type="password" name="login_password" size="25" maxlength="25"></td>
</tr>
<tr class="row1">
<td colspan="2" align="center"><input type="submit" name="login" value="<? print("$talk[23]"); ?>"></td>
</tr>
</table>
</form>
</center>
<?
// end login screen
// authentification OK, let's do the job
}else{
// form to enter administration functions
?>
<br>
<center>
<form action="<? print("$BOARD_NAME"); ?>" method="post">
<input type="hidden" name="admin" value="admin">
<b><input type="submit" value="<? print("$talk[47]"); ?>"></b>
</form>
<br>
<? include("include/logout.inc"); ?>
</center>
<?
} // end authentificaion OK
include("include/foot.inc");