POST-DATA: ".htmlspecialchars(print_r($_POST, true))."\nSESSION_DATA: ".htmlspecialchars(print_r($_SESSION, true)).""); if (have_module('webmailtotp') && isset($_POST['webinterface_totpcode']) && isset($_SESSION['totp']) && isset($_SESSION['totp_username'])) { require_once('modules/webmailtotp/include/totp.php'); $role = NULL; if (check_totp($_SESSION['totp_username'], $_POST['webinterface_totpcode'])) { $role = find_role($_SESSION['totp_username'], '', true); } if ($role === NULL) { $_SESSION['role'] = ROLE_ANONYMOUS; logger(LOG_WARNING, "session/start", "login", "wrong totp code (username: »{$_SESSION['totp_username']}«)"); warning('Ihre Anmeldung konnte nicht durchgeführt werden. Geben Sie bitte einen neuen Code ein.'); show_page('webmailtotp-login'); die(); } else { setup_session($role, $_SESSION['totp_username']); } unset($_POST['webinterface_totpcode']); unset($_SESSION['totp']); unset($_SESSION['totp_username']); } if (isset($_POST['webinterface_username']) && isset($_POST['webinterface_password'])) { $role = find_role($_POST['webinterface_username'], $_POST['webinterface_password']); if ($role === NULL) { $_SESSION['role'] = ROLE_ANONYMOUS; logger(LOG_WARNING, "session/start", "login", "wrong user data (username: »{$_POST['webinterface_username']}«)"); login_screen('Ihre Anmeldung konnte nicht durchgeführt werden. Vermutlich haben Sie falsche Zugangsdaten eingegeben.'); } else { setup_session($role, $_POST['webinterface_username']); } unset($_POST['webinterface_username']); unset($_POST['webinterface_password']); } elseif (isset($_SESSION['role'])) { /* User ist eingeloggt (aber vielleicht als ROLE_ANONYMOUS!) */ } else { $_SESSION['role'] = ROLE_ANONYMOUS; } // Wenn wir hier sind, ist der Benutzer eingeloggt. Möglicherweise nur als ANONYMOUS DEBUG("Role: ".$_SESSION['role']); ?>