Location: PHPKode > projects > OpenBnet > OpenBnet_1.0_final/includes/check_login.php
<?
// +----------------------------------------------------------------------+
// | OpenBnet  (B├╝rgernetz)                                               |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004 Joachim Seitz                                     |
// +----------------------------------------------------------------------+
// | Distributed under Artistic License                                   |
// +----------------------------------------------------------------------+

session_start();
if($_COOKIE["buergernetz"]){
   $array = explode("#",$_COOKIE["buergernetz"]);
   $_SESSION['id'] = $array[0];
   $_SESSION['passwort'] = $array[1];
}

if (!isset($_SESSION['id']) || !isset($_SESSION['passwort'])){
	$logged_in = 0;
}
else{
   $besult=mysql_query("SELECT passwort FROM $buerger_table WHERE status!='0' AND id= '".$_SESSION['id']."'");
   $besult=mysql_fetch_object($besult);
   $passwortdb=$besult->passwort;
   
   if($_SESSION['passwort']==$passwortdb){
   	  $bn = $_SESSION['id'];
      $ip = $_SERVER['REMOTE_ADDR'];
      $timestamp = time();
      $result = mysql_query("UPDATE $buerger_table SET lastlogin='$timestamp', lastip='$ip' WHERE id='$bn'");
      $logged_in = 1;
   }
   else{
      $logged_in = 0;
      unset($_SESSION['id']);
      unset($_SESSION['passwort']);
   }
}
unset($passworddb);
?>
Return current item: OpenBnet