a95ec07a1cdd4046c055ffffabe31e41087b8bc8
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 Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

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

bernd authored 17 years ago

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

Bernd Wurst authored 12 years ago

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

bernd authored 17 years ago

29)   if ($role === NULL)
30)   {
31)     $_SESSION['role'] = ROLE_ANONYMOUS;
bernd Sperre Login für gesperrte...

bernd authored 12 years ago

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

bernd authored 17 years ago

33)     login_screen('Ihre Anmeldung konnte nicht durchgeführt werden. Vermutlich haben Sie falsche Zugangsdaten eingegeben.');
34)   }
35)   else
36)   {
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

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

bernd authored 17 years ago

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

Bernd Wurst authored 12 years ago

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

bernd authored 17 years ago

41) }
42) 
43) elseif (isset($_SESSION['role']))
44) {
45)   /* User ist eingeloggt (aber vielleicht als ROLE_ANONYMOUS!) */
46) }
47) 
48) else
49) {
50)   $_SESSION['role'] = ROLE_ANONYMOUS;
51) }
52) // Wenn wir hier sind, ist der Benutzer eingeloggt. Möglicherweise nur als ANONYMOUS
53) 
bernd Menü-Includes sinnvoller /...

bernd authored 16 years ago

54) 
55) DEBUG("Role: ".$_SESSION['role']);
56)