{"record":{"id":"fd081e9562bd53a5","repo":"Dolibarr/dolibarr","slug":"errorlogindatevalidity","errorCode":null,"errorMessage":"ErrorLoginDateValidity","messagePattern":"ErrorLoginDateValidity","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"htdocs/main.inc.php","lineNumber":901,"sourceCode":"\t\t\tsession_name($sessionname);\n\t\t\tdol_session_start();\n\n\t\t\tif ($resultFetchUser == 0) {\n\t\t\t\t// Load translation files required by page\n\t\t\t\t$langs->loadLangs(array('main', 'errors'));\n\n\t\t\t\t$_SESSION[\"dol_loginmesg\"] = $langs->transnoentitiesnoconv(\"ErrorCantLoadUserFromDolibarrDatabase\", $login);\n\n\t\t\t\t$user->context['audit'] = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;\n\t\t\t} elseif ($resultFetchUser < 0) {\n\t\t\t\t$_SESSION[\"dol_loginmesg\"] = $user->error;\n\n\t\t\t\t$user->context['audit'] = $user->error;\n\t\t\t} else {\n\t\t\t\t// Load translation files required by the page\n\t\t\t\t$langs->loadLangs(array('main', 'errors'));\n\n\t\t\t\t$_SESSION[\"dol_loginmesg\"] = $langs->transnoentitiesnoconv(\"ErrorLoginDateValidity\");\n\n\t\t\t\t$user->context['audit'] = $langs->trans(\"ErrorLoginDateValidity\").' - login='.$login;\n\t\t\t}\n\n\t\t\t// Call trigger\n\t\t\t$result = $user->call_trigger('USER_LOGIN_FAILED', $user);\n\t\t\tif ($result < 0) {\n\t\t\t\t$error++;\n\t\t\t}\n\t\t\t// End call triggers\n\n\n\t\t\t// Hooks on failed login\n\t\t\t$action = '';\n\t\t\t$hookmanager->initHooks(array('login'));\n\t\t\t$parameters = array('dol_authmode' => $dol_authmode, 'dol_loginmesg' => $_SESSION[\"dol_loginmesg\"]);\n\t\t\t$reshook = $hookmanager->executeHooks('afterLoginFailed', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks\n\t\t\tif ($reshook < 0) {","sourceCodeStart":883,"sourceCodeEnd":919,"githubUrl":"https://github.com/Dolibarr/dolibarr/blob/598aa4bdada683d17ca04b1842548821ff0eb6c6/htdocs/main.inc.php#L883-L919","documentation":"The user record was fetched successfully but its account validity dates make login currently invalid, so Dolibarr stores ErrorLoginDateValidity and fires USER_LOGIN_FAILED. Credentials are correct; the account is simply outside its allowed date range.","triggerScenarios":"User account has datestart in the future or dateend in the past at login time (the $resultFetchUser > 0 branch); an admin-set account expiry was reached.","commonSituations":"Temporary/contractor accounts past their end date; pre-provisioned accounts before their start date; timezone surprises making an account expire 'early' for the user.","solutions":["Extend the account end date (or clear it) in the user card's validity date fields.","If the start date is in the future, adjust it to allow immediate login.","Renew the account rather than troubleshooting credentials — the password is correct.","Check timezone settings if expiration seems off by hours/days.","Audit accounts regularly to renew dates before they lapse."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$u = new User($db); $u->fetch('', $login);\n$now = dol_now();\nif ($u->datestart && $now < $u->datestart) { die('Account not active yet'); }\nif ($u->dateend && $now > $u->dateend) { die('Account expired'); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set reminders before dateend for temporary accounts","Avoid expiry dates near midnight when timezones differ","Include account-date checks in periodic user audits"],"tags":["dolibarr","login","account-expiry"],"backgroundTag":"account-expired","analyzedSha":"598aa4bdada683d17ca04b1842548821ff0eb6c6","analyzedAt":"2026-09-14T11:12:15.309Z","contentChangedAt":"2026-09-14T11:12:15.309Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}