2010-10-29 13:19:51 +00:00
|
|
|
<?php
|
2010-12-06 20:00:18 +00:00
|
|
|
/**
|
|
|
|
* Do authentication of users and session management
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package LetoDMS
|
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2010-10-29 13:19:51 +00:00
|
|
|
|
|
|
|
$refer=urlencode($_SERVER["REQUEST_URI"]);
|
|
|
|
if (!strncmp("/op", $refer, 3)) {
|
|
|
|
$refer="";
|
|
|
|
}
|
2011-01-11 08:03:38 +00:00
|
|
|
if (!isset($_COOKIE["mydms_session"])) {
|
2010-10-29 13:19:51 +00:00
|
|
|
header("Location: " . $settings->_httpRoot . "out/out.Login.php?referuri=".$refer);
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2010-11-17 07:41:35 +00:00
|
|
|
require_once("inc.Utils.php");
|
|
|
|
require_once("inc.ClassEmail.php");
|
2011-01-11 08:03:38 +00:00
|
|
|
require_once("inc.ClassSession.php");
|
2010-10-29 13:19:51 +00:00
|
|
|
|
2011-01-11 08:03:38 +00:00
|
|
|
/* Load session */
|
2010-10-29 13:19:51 +00:00
|
|
|
$dms_session = sanitizeString($_COOKIE["mydms_session"]);
|
2011-01-11 08:03:38 +00:00
|
|
|
$session = new LetoDMS_Session($db);
|
|
|
|
if(!$resArr = $session->load($dms_session)) {
|
2010-10-29 13:19:51 +00:00
|
|
|
setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot); //delete cookie
|
|
|
|
header("Location: " . $settings->_httpRoot . "out/out.Login.php?referuri=".$refer);
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2011-01-11 08:03:38 +00:00
|
|
|
/* Load user data */
|
2010-11-15 12:01:21 +00:00
|
|
|
$user = $dms->getUser($resArr["userID"]);
|
2010-10-29 13:19:51 +00:00
|
|
|
if (!is_object($user)) {
|
|
|
|
setcookie("mydms_session", $dms_session, time()-3600, $settings->_httpRoot); //delete cookie
|
|
|
|
header("Location: " . $settings->_httpRoot . "out/out.Login.php?referuri=".$refer);
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2010-11-15 12:01:21 +00:00
|
|
|
$dms->setUser($user);
|
2010-11-17 07:41:35 +00:00
|
|
|
$notifier = new LetoDMS_Email();
|
|
|
|
$notifier->setSender($user);
|
2010-11-15 12:01:21 +00:00
|
|
|
|
2010-10-29 13:19:51 +00:00
|
|
|
$theme = $resArr["theme"];
|
|
|
|
include $settings->_rootDir . "languages/" . $resArr["language"] . "/lang.inc";
|
|
|
|
|
|
|
|
?>
|