f12aba6daa6e2848a8ed60ea57b26874d6675f52
bernd webinterface => /webinterface

bernd authored 17 years ago

1) <?php
2) /*
3) 
4)   Session-Start-Script wird vom dispatcher eingebunden
5) 
6) */
7) 
8) require_once('session/checkuser.php');
9) require_once('inc/error.php');
10) require_once('inc/debug.php');
11) 
bernd Logging aktiviert

bernd authored 16 years ago

12) require_once('inc/base.php');
13) 
bernd Session-Name aus einer Conf...

bernd authored 13 years ago

14) session_name(config('session_name'));
bernd Cookie einen eindeutigen Na...

bernd authored 16 years ago

15) 
bernd sichere cookies

bernd authored 15 years ago

16) if ($_SERVER['HTTPS']) session_set_cookie_params( 0, '/', '', true, true );
17) 
bernd webinterface => /webinterface

bernd authored 17 years ago

18) if (!session_start())
bernd Logging aktiviert

bernd authored 16 years ago

19) {
bernd Logger mit Logleveln

bernd authored 14 years ago

20)         logger(LOG_ERR, "session/start", "session", "Die session konnte nicht gestartet werden!");
bernd webinterface => /webinterface

bernd authored 17 years ago

21)         system_failure('Die Sitzung konnte nicht gestartet werden, bitte benachrichtigen Sie den Administrator!');
bernd Logging aktiviert

bernd authored 16 years ago

22) }
bernd webinterface => /webinterface

bernd authored 17 years ago

23) 
hanno nochmal entities:specialchars

hanno authored 16 years ago

24) DEBUG("<pre>POST-DATA: ".htmlspecialchars(print_r($_POST, true))."\nSESSION_DATA: ".htmlspecialchars(print_r($_SESSION, true))."</pre>");
bernd webinterface => /webinterface

bernd authored 17 years ago

25) 
Bernd Wurst Umbenennung Google-Auth nac...

Bernd Wurst authored 11 years ago

26) if (have_module('webmailtotp') && isset($_POST['webinterface_totpcode']) && isset($_SESSION['totp']) && isset($_SESSION['totp_username'])) {
27)   require_once('modules/webmailtotp/include/totp.php');
Bernd Wurst Login am Webiterface mit Go...

Bernd Wurst authored 11 years ago

28)   $role = NULL;
Bernd Wurst Umbenennung Google-Auth nac...

Bernd Wurst authored 11 years ago

29)   if (check_totp($_SESSION['totp_username'], $_POST['webinterface_totpcode'])) {
30)     $role = find_role($_SESSION['totp_username'], '', true);
Bernd Wurst Login am Webiterface mit Go...

Bernd Wurst authored 11 years ago

31)   }
32)   if ($role === NULL)
33)   {
34)     $_SESSION['role'] = ROLE_ANONYMOUS;
Bernd Wurst Umbenennung Google-Auth nac...

Bernd Wurst authored 11 years ago

35)     logger(LOG_WARNING, "session/start", "login", "wrong totp code (username: »{$_SESSION['totp_username']}«)");
Bernd Wurst Login am Webiterface mit Go...

Bernd Wurst authored 11 years ago

36)     warning('Ihre Anmeldung konnte nicht durchgeführt werden. Geben Sie bitte einen neuen Code ein.');
Bernd Wurst Umbenennung Google-Auth nac...

Bernd Wurst authored 11 years ago

37)     show_page('webmailtotp-login');
Bernd Wurst Login am Webiterface mit Go...

Bernd Wurst authored 11 years ago

38)     die();
39)   }
40)   else
41)   {
Bernd Wurst Umbenennung Google-Auth nac...

Bernd Wurst authored 11 years ago

42)     setup_session($role, $_SESSION['totp_username']);
Bernd Wurst Login am Webiterface mit Go...

Bernd Wurst authored 11 years ago

43)   }
Bernd Wurst Umbenennung Google-Auth nac...

Bernd Wurst authored 11 years ago

44)   unset($_POST['webinterface_totpcode']);
45)   unset($_SESSION['totp']);
46)   unset($_SESSION['totp_username']);
Bernd Wurst Login am Webiterface mit Go...

Bernd Wurst authored 11 years ago

47) }
48) 
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

49) if (isset($_POST['webinterface_username']) && isset($_POST['webinterface_password']))
bernd webinterface => /webinterface

bernd authored 17 years ago

50) {
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

51)   $role = find_role($_POST['webinterface_username'], $_POST['webinterface_password']);
bernd webinterface => /webinterface

bernd authored 17 years ago

52)   if ($role === NULL)
53)   {
54)     $_SESSION['role'] = ROLE_ANONYMOUS;
bernd Sperre Login für gesperrte...

bernd authored 12 years ago

55)     logger(LOG_WARNING, "session/start", "login", "wrong user data (username: »{$_POST['webinterface_username']}«)");
bernd webinterface => /webinterface

bernd authored 17 years ago

56)     login_screen('Ihre Anmeldung konnte nicht durchgeführt werden. Vermutlich haben Sie falsche Zugangsdaten eingegeben.');
57)   }
58)   else
59)   {
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

60)     setup_session($role, $_POST['webinterface_username']);
bernd webinterface => /webinterface

bernd authored 17 years ago

61)   }
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

62)   unset($_POST['webinterface_username']);
63)   unset($_POST['webinterface_password']);
bernd webinterface => /webinterface

bernd authored 17 years ago

64) }
65) 
66) elseif (isset($_SESSION['role']))
67) {
68)   /* User ist eingeloggt (aber vielleicht als ROLE_ANONYMOUS!) */
69) }
70) 
71) else
72) {
73)   $_SESSION['role'] = ROLE_ANONYMOUS;
74) }
75) // Wenn wir hier sind, ist der Benutzer eingeloggt. Möglicherweise nur als ANONYMOUS
76) 
bernd Menü-Includes sinnvoller /...

bernd authored 16 years ago

77) 
78) DEBUG("Role: ".$_SESSION['role']);
79)