3dd67d84909596d7021ab543b0cd1437163462df
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 Cookie einen eindeutigen Na...

bernd authored 16 years ago

14) session_name('CONFIG_SCHOKOKEKS_ORG');
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 eliminate .php extensions f...

bernd authored 15 years ago

20)         logger("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) 
26) if (isset($_POST['username']) && isset($_POST['password']))
27) {
28)   $role = find_role($_POST['username'], $_POST['password']);
29)   if ($role === NULL)
30)   {
31)     $_SESSION['role'] = ROLE_ANONYMOUS;
bernd eliminate .php extensions f...

bernd authored 15 years ago

32)     logger("session/start", "login", "wrong user data (username: »{$_POST['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 * Initialisierung der Sessi...

bernd authored 16 years ago

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

bernd authored 17 years ago

38)   }
39)   unset($_POST['username']);
40)   unset($_POST['password']);
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)