7cd93137ebb41489a66f0e023e26343e8caf0d3d
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) {
bernd Warnings und Success-Meldun...

bernd authored 13 years ago

28)   if (!isset($_SESSION['warning']))
29)     $_SESSION['warning'] = array();
30)   array_push($_SESSION['warning'], $msg);
bernd webinterface => /webinterface

bernd authored 17 years ago

31) }
32) 
33) function success_msg($msg)
34) {
bernd Warnings und Success-Meldun...

bernd authored 13 years ago

35)   if (!isset($_SESSION['success_msg']))
36)     $_SESSION['success_msg'] = array();
37)   array_push($_SESSION['success_msg'], $msg);
bernd webinterface => /webinterface

bernd authored 17 years ago

38) }
39) 
40) 
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

41) function we_have_an_error()
42) {
43)   global $input_error;
44) 
bernd Warnings und Success-Meldun...

bernd authored 13 years ago

45)   return ((count($input_error) + count($_SESSION['warning'])) > 0);
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

46) 
47) }
48) 
49) 
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

63)     }
64)     echo '</ul>
65)     </div>';
66)   }
bernd Warnings und Success-Meldun...

bernd authored 13 years ago

67)   if (isset($_SESSION['warning']))
bernd webinterface => /webinterface

bernd authored 17 years ago

68)   {
69)     echo '<div class="error">
70)     <ul>
71)     ';
bernd Warnings und Success-Meldun...

bernd authored 13 years ago

72)     foreach ($_SESSION['warning'] as $msg)
bernd webinterface => /webinterface

bernd authored 17 years ago

73)     {
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

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

bernd authored 17 years ago

75)     }
76)     echo '</ul>
77)     </div>';
bernd Warnings und Success-Meldun...

bernd authored 13 years ago

78)     unset($_SESSION['warning']);
bernd webinterface => /webinterface

bernd authored 17 years ago

79)   }
bernd Warnings und Success-Meldun...

bernd authored 13 years ago

80)   if (isset($_SESSION['success_msg']))
bernd webinterface => /webinterface

bernd authored 17 years ago

81)   {
82)     echo '<div class="success">
83)     <ul>
84)     ';
bernd Warnings und Success-Meldun...

bernd authored 13 years ago

85)     foreach ($_SESSION['success_msg'] as $msg)
bernd webinterface => /webinterface

bernd authored 17 years ago

86)     {
bernd Erste Version des vmail-Modul

bernd authored 16 years ago

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

bernd authored 17 years ago

88)     }
89)     echo '</ul>
90)     </div>';
bernd Warnings und Success-Meldun...

bernd authored 13 years ago

91)     unset($_SESSION['success_msg']);
bernd webinterface => /webinterface

bernd authored 17 years ago

92)   }
93) }
94) 
95) 
96) function require_role($roles)
97) {
98)   if (! is_array($roles))
99)     $roles = array($roles);
100)   $allow = false;
101)   foreach ($roles as $role)
bernd Nachtrag zum vorigen

bernd authored 16 years ago

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

bernd authored 17 years ago

103)       $allow = true;
104)   if (! $allow)
bernd Nachtrag zum vorigen

bernd authored 16 years ago

105)     if ($_SESSION['role'] == ROLE_ANONYMOUS)
106)       login_screen("Diese Seite können Sie erst benutzen, wenn Sie sich mit Ihren Zugangsdaten anmelden.");
107)     else
108)       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

109) }
110) 
111) 
112) function login_screen($why)
113) {
bernd Ermögliche Cert-Login auf d...

bernd authored 14 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

123) 	else
124) 	{
125) 		// der User hat die Startseite aufgerufen
bernd Mehr config-optionen und co...

bernd authored 14 years ago

126) 	        echo '<h3>'.config('company_name').' Webinterface</h3>';
127) 		echo '<p>Auf dieser Seite können Sie diverse Einstellungen Ihres Accounts auf '.config('company_name').' festlegen. Sofern Sie noch kein Kunde von '.config('company_name').' sind, können Sie diese Seite nicht benutzen. Besuchen Sie in diesem Fall bitte unsere <a href="'.config('company_url').'">öffentliche Seite</a>.</p>';
bernd Info-Text auf Startseite

bernd authored 16 years ago

128) 	}
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 14 years ago

134)         <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>
bernd Passwort-vergessen-Hinweis...

bernd authored 14 years ago

135)         <p>Sollten Sie Ihr Passwort nicht mehr kennen, wenden Sie sich bitte unter Angabe Ihres Benutzernamens und/oder Ihrer Kundennummer an den Support. Passwörter für E-Mail-Konten kann der Eigentümer des Benutzeraccounts neu setzen.</p>
bernd Ermögliche Cert-Login auf d...

bernd authored 14 years ago

136) 
137)         <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 15 years ago

138) 	/*
139) 	<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

140)         <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 15 years ago

141) 	*/