/* If logout has a set initial page, redirect to that. Check that * it is not a looping redirect. */ if (isset($registry->applications['logout']['initial_page']) && $registry->applications['logout']['initial_page'] != 'login.php?' . AUTH_REASON_PARAM . '=' . AUTH_REASON_LOGOUT) { header('Location: ' . Horde::applicationUrl($registry->applications['logout']['initial_page'])); exit; } Horde::setupSessionHandler(); @session_start(); NLS::setLang($language); /* Hook to preselect the correct language in the widget. */ $_GET['new_lang'] = $language; } if (isset($_POST['horde_user']) && isset($_POST['horde_pass'])) { /* Destroy any existing session on login and make sure to use a * new session ID, to avoid session fixation issues. */ Horde::getCleanSession(); if ($auth->authenticate(Util::getPost('horde_user'), array('password' => Util::getPost('horde_pass')))) { $entry = sprintf('Login success for %s [%s] to Horde', Auth::getAuth(), $_SERVER['REMOTE_ADDR']); Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_INFO); if ($url_param) { $url = Horde::url(Util::removeParameter($url_param, session_name()), true); $horde_url = Horde::applicationUrl($registry->getParam('webroot', 'horde') . '/index.php', true); $horde_url = Util::addParameter($horde_url, 'url', $url); } else { $horde_url = Horde::applicationUrl('index.php', true); } $horde_url = Util::addParameter($horde_url, 'frameset', Util::getFormData('frameset') ? 1 : 0); header('Location: ' . $horde_url); exit; } else { $entry = sprintf('FAILED LOGIN for %s [%s] to Horde', Util::getFormData('horde_user'), $_SERVER['REMOTE_ADDR']);