POST-DATA: ".htmlspecialchars(print_r($_POST, true))."\nSESSION_DATA: ".htmlspecialchars(print_r($_SESSION, true)).""); if (have_module('googleauth') && isset($_POST['webinterface_googlecode']) && isset($_SESSION['googleauth']) && isset($_SESSION['googleauth_username'])) { require_once('modules/googleauth/include/googleauth.php'); $role = NULL; if (check_googleauth($_SESSION['googleauth_username'], $_POST['webinterface_googlecode'])) { $role = find_role($_SESSION['googleauth_username'], '', true); } if ($role === NULL) { $_SESSION['role'] = ROLE_ANONYMOUS; logger(LOG_WARNING, "session/start", "login", "wrong googleauth code (username: »{$_SESSION['googleauth_username']}«)"); warning('Ihre Anmeldung konnte nicht durchgeführt werden. Geben Sie bitte einen neuen Code ein.'); show_page('googleauth-login'); die(); } else { setup_session($role, $_SESSION['googleauth_username']); } unset($_POST['webinterface_googlecode']); unset($_SESSION['googleauth']); unset($_SESSION['googleauth_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']); ?>