a097ceda307a23b34f3881dcc1531fd27f3a9bc2
bernd webinterface => /webinterface

bernd authored 17 years ago

1) <?php
2) 
bernd XSS/CSRF-Bugs behoben

bernd authored 16 years ago

3) require_once("inc/security.php");
4) 
bernd webinterface => /webinterface

bernd authored 17 years ago

5) function system_failure($reason)
6) {
7)         include('inc/top.php');
bernd Fehlermeldungen hübscher

bernd authored 16 years ago

8)         echo '
bernd webinterface => /webinterface

bernd authored 17 years ago

9)         <h3>Fehler</h3>
bernd Fehlermeldungen hübscher

bernd authored 16 years ago

10)         <div class="error">
11)           <p>Es ist ein Fehler aufgetreten:<br /> '.filter_input_general($reason).'</p>
bernd webinterface => /webinterface

bernd authored 17 years ago

12)         </div>';
13)         include('inc/bottom.php');
14)         die();
15) }
16) 
17) 
18) function input_error($reason)
19) {
20)   global $input_error;
21)   if (!isset($input_error))
22)     $input_error = array();
23)   array_push($input_error, $reason);
24) }
25) 
26) function warning($msg)
27) {
28)   global $warning;
29)   if (!isset($warning))
30)     $warning = array();
31)   array_push($warning, $msg);
32) }
33) 
34) function success_msg($msg)
35) {
36)   global $success_msg;
37)   if (!isset($success_msg))
38)     $success_msg = array();
39)   array_push($success_msg, $msg);
40) }
41) 
42) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

43) function we_have_an_error()
44) {
45)   global $input_error;
46)   global $warning;
47) 
48)   return ((count($input_error) + count($warning)) > 0);
49) 
50) }
51) 
52) 
bernd webinterface => /webinterface

bernd authored 17 years ago

53) function show_messages()
54) {
55)   global $input_error;
56)   global $success_msg;
57)   global $warning;
58)   if (isset($input_error))
59)   {
60)     echo '<div class="error">
61)     <h3>Fehler</h3>
62)     <p>Folgende Fehler wurden festgestellt: </p>
63)     <ul>
64)     ';
65)     foreach ($input_error as $error)
66)     {
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

67)       echo '<li>'.nl2br(filter_input_general($error))."</li>\n";
bernd webinterface => /webinterface

bernd authored 17 years ago

68)     }
69)     echo '</ul>
70)     </div>';
71)   }
72)   if (isset($warning))
73)   {
74)     echo '<div class="error">
75)     <ul>
76)     ';
77)     foreach ($warning as $msg)
78)     {
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

79)       echo '<li>'.nl2br(filter_input_general($msg))."</li>\n";
bernd webinterface => /webinterface

bernd authored 17 years ago

80)     }
81)     echo '</ul>
82)     </div>';
83)   }
84)   if (isset($success_msg))
85)   {
86)     echo '<div class="success">
87)     <ul>
88)     ';
89)     foreach ($success_msg as $msg)
90)     {
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

91)       echo '<li>'.nl2br(filter_input_general($msg))."</li>\n";
bernd webinterface => /webinterface

bernd authored 17 years ago

92)     }
93)     echo '</ul>
94)     </div>';
95)   }
96) }
97) 
98) 
99) function require_role($roles)
100) {
101)   if (! is_array($roles))
102)     $roles = array($roles);
103)   $allow = false;
104)   foreach ($roles as $role)
bernd Nachtrag zum vorigen

bernd authored 16 years ago

105)     if ($role & $_SESSION['role'])
bernd webinterface => /webinterface

bernd authored 17 years ago

106)       $allow = true;
107)   if (! $allow)
bernd Nachtrag zum vorigen

bernd authored 16 years ago

108)     if ($_SESSION['role'] == ROLE_ANONYMOUS)
109)       login_screen("Diese Seite können Sie erst benutzen, wenn Sie sich mit Ihren Zugangsdaten anmelden.");
110)     else
111)       login_screen("Diese Seite können Sie mit Ihren aktuellen Zugriffsrechten nicht benutzen, bitte melden Sie sich mit den benötigten Zugriffsrechten an!");
bernd webinterface => /webinterface

bernd authored 17 years ago

112) }
113) 
114) 
115) function login_screen($why)
116) {
bernd Ermögliche Cert-Login auf d...

bernd authored 14 years ago

117)   global $go;
bernd webinterface => /webinterface

bernd authored 17 years ago

118)         $title = 'Login';
119)         include('inc/top.php');
120)         if ($why != "")
121)         {
bernd Info-Text auf Startseite

bernd authored 16 years ago

122) 		// Der User hat einen deeplink benutzt (-> weiß was er tut)
123)         	echo '<h3>Sie sind nicht am System angemeldet!</h3>';
bernd webinterface => /webinterface

bernd authored 17 years ago

124)                 echo '<p class="warning"><b>Fehler:</b> '.$why.'</p>';
125)         }
bernd Info-Text auf Startseite

bernd authored 16 years ago

126) 	else
127) 	{
128) 		// der User hat die Startseite aufgerufen
bernd database config options

bernd authored 15 years ago

129) 	        echo '<h3>'.$config['brand'].' Webinterface</h3>';
bernd Info-Text auf Startseite

bernd authored 16 years ago

130) 		echo '<p>Auf dieser Seite können Sie diverse Einstellungen Ihres Accounts auf schokokeks.org festlegen. Sofern Sie noch kein Kunde von schokokeks.org sind, können Sie diese Seite nicht benutzen. Besuchen Sie in diesem Fall bitte unsere <a href="http://www.schokokeks.org/">öffentliche Seite</a>.</p>';
131) 	}
bernd webinterface => /webinterface

bernd authored 17 years ago

132)         echo '<form action="" method="post">
133)         <p><span class="login_label">Benutzer<sup>*</sup>:</span> <input type="text" name="username" size="30" /></p>
134)         <p><span class="login_label">Passwort:</span> <input type="password" name="password" size="30" /></p>
bernd Entities repariert

bernd authored 16 years ago

135)         <p><span class="login_label">&#160;</span> <input type="submit" value="Anmelden" /></p>
bernd webinterface => /webinterface

bernd authored 17 years ago

136)         </form>
bernd Ermögliche Cert-Login auf d...

bernd authored 14 years ago

137)         <p><sup>*</sup> Sie können sich hier mit Ihrem System-Benutzernamen, Ihrem IMAP-Account oder Ihrer Kundennummer (jeweils mit zugehörigem Passwort) anmelden. Je nach gewählten Daten erhalten Sie unterschiedliche Zugriffsrechte.</p>
138) 
139)         <p><em>'.internal_link('/certlogin?destination=go/'.$go, 'Mit einem Client-Zertifikat anmelden').'</em> ('.internal_link('/go/index/certinfo', 'Wie geht das?').')</p>';
bernd Passwort anfordern ist obsolet

bernd authored 16 years ago

140) 	/*
141) 	<p>Sofern Sie für Ihren Kundenaccount noch kein Passwort festgelegt haben oder Ihres vergessen haben, klicken Sie bitte <a href="new_password.php">hier</a></p>
bernd webinterface => /webinterface

bernd authored 17 years ago

142)         <p>Sollten Sie als Benutzer Ihr Passwort vergessen haben, wenden Sie sich bitte an den Inhaber des Kundenaccounts.</p>';
bernd Passwort anfordern ist obsolet

bernd authored 16 years ago

143) 	*/