Location: PHPKode > projects > Skat Statistics > skatstat-1.7.1/skatstat/login.php
<?php
require_once "include.php";
require_once "smconfig.php";
require_once "authentication.php";
require_once "session.php";
require_once "auxiliary.php";

/**
 * Login page, displays login screen and receives input data
 * after submission
 */
  if( $_POST )
  {
$name     = $_POST['uid'];
$password = $_POST['pwd'];
$handheld = $_POST['Handheld'] ? true : false;
  }

$uri = BASEHREF.'/';

list($userid,$username,$groupid,$groupname,$admin) =
	Authentication::check_credentials($name, $password);
	
if( $userid && $groupid )
{

	# Read session data
	ss_session_read();
	$SKAT_SESSION[userid]    = $userid;
	$SKAT_SESSION[username]  = $username;
	$SKAT_SESSION[groupid]   = $groupid;
	$SKAT_SESSION[groupname] = $groupname;
	$SKAT_SESSION[admin]     = $admin;
	$SKAT_SESSION[handheld]  = $handheld;
	# Write session data
	ss_session_write();

	/**
	 * Redirect to the first page after successfull login
	 */
	header( "Location: $uri" );
	exit;
}
else
{
   /**
    * Something went wrong. Destroy cookie, and print welcome page
    */
	ss_session_destroy();

	if( isset($_POST['uid']) )
	{
		echo getWarning( "Benutzername und/oder Passwort nicht korrekt!" );
	}

	include( "header.php" );
	require( "welcomepage.php");
	include( "footer.php" );
}
?>
Return current item: Skat Statistics