Location: PHPKode > projects > Opensheet > opensheet/index.php
<?php
ini_set('display_errors','1');
error_reporting(E_ALL);
session_start(); 
require ('functions/base.functions.php');
require ('classes/global.class.php');
#include ('functions/ldap.inc.php');
require ('functions/ldap.inc.php');
if(!isset($_POST['ok'])) {
include ('include/login_form.inc.html');
exit;

} elseif(!empty($_POST['login']) && !empty($_POST['pass']) ) {	

	
	$login= mysql_real_escape_string($_POST['login']);
	$passwd= mysql_real_escape_string($_POST['pass']);
	
	$auth = new Users;
	if ($auth->check_user($login,$passwd) == TRUE) {
		
		$new_user = new Users;
	    $user_id = $new_user->set_login($login)->getIDfromLogin();
		$_SESSION = $new_user->set_id($user_id)->getUserVars();
		$_SESSION['permissions'] = $new_user->getPermission();
		$_SESSION['login']=$login;
		$_SESSION['lang']=$_POST['lang'];
		Header("Location: timesheet.php");		
		
	}else {
		
		Header("Location: index.php");
		
	}
	
	
}

?>
Return current item: Opensheet