grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026. -------------------------------------------------------------------------- */ /** @file * @brief * @since version 0.85 in front */ include ('../inc/includes.php'); if (!isset($_SESSION["glpicookietest"]) || ($_SESSION["glpicookietest"] != 'testcookie')) { if (!is_writable(GLPI_SESSION_DIR)) { Html::redirect($CFG_GLPI['root_doc'] . "/index.php?error=2"); } else { Html::redirect($CFG_GLPI['root_doc'] . "/index.php?error=1"); } } $_POST = array_map('stripslashes', $_POST); //Do login and checks //$user_present = 1; if (isset($_SESSION['namfield']) && isset($_POST[$_SESSION['namfield']])) { $login = $_POST[$_SESSION['namfield']]; } else { $login = ''; } if (isset($_SESSION['pwdfield']) && isset($_POST[$_SESSION['pwdfield']])) { $password = Toolbox::unclean_cross_side_scripting_deep($_POST[$_SESSION['pwdfield']]); } else { $password = ''; } // Redirect management $REDIRECT = ""; if (isset($_POST['redirect']) && (strlen($_POST['redirect']) > 0)) { $REDIRECT = "?redirect=" .rawurlencode($_POST['redirect']); } else if (isset($_GET['redirect']) && strlen($_GET['redirect'])>0) { $REDIRECT = "?redirect=" .rawurlencode($_GET['redirect']); } $auth = new Auth(); // now we can continue with the process... if ($auth->Login($login, $password, (isset($_REQUEST["noAUTO"])?$_REQUEST["noAUTO"]:false))) { // Redirect to Command Central if not post-only if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") { if ($_SESSION['glpiactiveprofile']['create_ticket_on_login'] && empty($REDIRECT)) { Html::redirect($CFG_GLPI['root_doc'] . "/front/helpdesk.public.php?create_ticket=1"); } Html::redirect($CFG_GLPI['root_doc'] . "/front/helpdesk.public.php$REDIRECT"); } else { if ($_SESSION['glpiactiveprofile']['create_ticket_on_login'] && empty($REDIRECT)) { Html::redirect($CFG_GLPI['root_doc'] . "/front/ticket.form.php"); } Html::redirect($CFG_GLPI['root_doc'] . "/front/central.php$REDIRECT"); } } else { // we have done at least a good login? No, we exit. Html::nullHeader("Login", $CFG_GLPI["root_doc"] . '/index.php'); echo '
' . $auth->getErr() . '

'; // Logout whit noAUto to manage auto_login with errors echo '' .__('Log in again') . '
'; Html::nullFooter(); exit(); } ?>