5b160d086d6d87aefab9a3daec981de08c4bdba8
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 webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

17) {
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

20) }
bernd webinterface => /webinterface

bernd authored 17 years ago

21) 
hanno nochmal entities:specialchars

hanno authored 16 years ago

22) 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

23) 
24) if (isset($_POST['username']) && isset($_POST['password']))
25) {
26)   $role = find_role($_POST['username'], $_POST['password']);
27)   if ($role === NULL)
28)   {
29)     $_SESSION['role'] = ROLE_ANONYMOUS;
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 17 years ago

31)     login_screen('Ihre Anmeldung konnte nicht durchgeführt werden. Vermutlich haben Sie falsche Zugangsdaten eingegeben.');
32)   }
33)   else
34)   {
bernd * Initialisierung der Sessi...

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

52) 
53) DEBUG("Role: ".$_SESSION['role']);
54)