inc/auth.inc.php
changeset 136 c795dd75a77e
parent 126 cb06e3e29ed8
child 192 3d18290ac993
equal deleted inserted replaced
135:3673b1c9246c 136:c795dd75a77e
    21 
    21 
    22 //session_start();
    22 //session_start();
    23 
    23 
    24 function doAuthenticate() {
    24 function doAuthenticate() {
    25 	global $db;
    25 	global $db;
    26 	global $EXPIRE;
    26 	global $iface_expire;
    27 	if (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] == "logout") {
    27 	if (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] == "logout") {
    28 		logout();
    28 		logout();
    29 	}
    29 	}
    30 
    30 
    31 	// If a user had just entered his/her login && password, store them in our session.
    31 	// If a user had just entered his/her login && password, store them in our session.
    34 			$_SESSION["userpwd"] = $_POST["password"];
    34 			$_SESSION["userpwd"] = $_POST["password"];
    35 			$_SESSION["userlogin"] = $_POST["username"];
    35 			$_SESSION["userlogin"] = $_POST["username"];
    36 	}
    36 	}
    37 
    37 
    38 	// Check if the session hasnt expired yet.
    38 	// Check if the session hasnt expired yet.
    39 	if ((isset($_SESSION["userid"])) && ($_SESSION["lastmod"] != "") && ((time() - $_SESSION["lastmod"]) > $EXPIRE))
    39 	if ((isset($_SESSION["userid"])) && ($_SESSION["lastmod"] != "") && ((time() - $_SESSION["lastmod"]) > $iface_expire))
    40 	{
    40 	{
    41 		logout( _('Session expired, please login again.'),"error");
    41 		logout( _('Session expired, please login again.'),"error");
    42 	}
    42 	}
    43 
    43 
    44 	// If the session hasn't expired yet, give our session a fresh new timestamp.
    44 	// If the session hasn't expired yet, give our session a fresh new timestamp.