38 dol_syslog(
"functions_http::check_user_password_http _SERVER[REMOTE_USER]=".(empty($_SERVER[
"REMOTE_USER"]) ?
'' : $_SERVER[
"REMOTE_USER"]));
41 if (!empty($_SERVER[
"REMOTE_USER"])) {
42 $login = $_SERVER[
"REMOTE_USER"];
44 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
46 $tmpuser =
new User($db);
47 $tmpuser->fetch(
'', $login,
'', 1, ($entitytotest > 0 ? $entitytotest : -1));
50 if ($tmpuser->datestartvalidity && $db->jdate($tmpuser->datestartvalidity) >= $now) {
52 $langs->loadLangs(array(
'main',
'errors'));
53 $_SESSION[
"dol_loginmesg"] = $langs->transnoentitiesnoconv(
"ErrorLoginDateValidity");
54 return '--bad-login-validity--';
56 if ($tmpuser->dateendvalidity && $db->jdate($tmpuser->dateendvalidity) <=
dol_get_first_hour($now)) {
58 $langs->loadLangs(array(
'main',
'errors'));
59 $_SESSION[
"dol_loginmesg"] = $langs->transnoentitiesnoconv(
"ErrorLoginDateValidity");
60 return '--bad-login-validity--';
Class to manage Dolibarr users.
dol_get_first_hour($date, $gm='tzserver')
Return GMT time for first hour of a given GMT date (it removes hours, min and second part)
dol_now($mode='auto')
Return date for now.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
check_user_password_http($usertotest, $passwordtotest, $entitytotest)
Check validity of user/password/entity If test is ko, reason must be filled into $_SESSION["dol_login...