5effc2bd7685822df276c1372dab480cff321941
bernd webinterface => /webinterface

bernd authored 17 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Lizenzinfos in eigenes Modu...

Bernd Wurst authored 10 years ago

5) Written 2008-2014 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
16) 
bernd webinterface => /webinterface

bernd authored 17 years ago

17) require_once('inc/debug.php');
bernd * Passwörter mit cracklib p...

bernd authored 17 years ago

18) require_once('inc/security.php');
bernd Passwort-Ändern geht jetzt...

bernd authored 14 years ago

19) require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER, ROLE_SUBUSER));
bernd webinterface => /webinterface

bernd authored 17 years ago

20) 
bernd Benutze überall title() sta...

bernd authored 14 years ago

21) title("Passwort ändern");
bernd webinterface => /webinterface

bernd authored 17 years ago

22) $error = '';
23) 
24) 
25) 
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 15 years ago

26) if (isset($_POST['password1']))
bernd webinterface => /webinterface

bernd authored 17 years ago

27) {
bernd XSRF-kram fixed

bernd authored 17 years ago

28)   check_form_token('index_chpass');
bernd webinterface => /webinterface

bernd authored 17 years ago

29)   $result = NULL;
bernd * Initialisierung der Sessi...

bernd authored 17 years ago

30)   if ($_SESSION['role'] & ROLE_SYSTEMUSER)
bernd Passwort-Ändern geht jetzt...

bernd authored 14 years ago

31)     if ($_SESSION['role'] & ROLE_SUBUSER)
32)       $result = find_role($_SESSION['subuser'], $_POST['old_password']);
33)     else
34)       $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
bernd * Initialisierung der Sessi...

bernd authored 17 years ago

35)   else
36)     $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
37) 
bernd webinterface => /webinterface

bernd authored 17 years ago

38)   if ($result == NULL)
39)     input_error('Das bisherige Passwort ist nicht korrekt!');
40)   elseif ($_POST['password2'] != $_POST['password1'])
bernd Viele XHTML-Fehler korrigie...

bernd authored 17 years ago

41)     input_error('Die Bestätigung ist nicht identisch mit dem neuen Passwort!');
bernd webinterface => /webinterface

bernd authored 17 years ago

42)   elseif ($_POST['password2'] == '')
bernd Viele XHTML-Fehler korrigie...

bernd authored 17 years ago

43)     input_error('Sie müssen das neue Passwort zweimal eingeben!');
bernd webinterface => /webinterface

bernd authored 17 years ago

44)   elseif ($_POST['old_password'] == '')
45)     input_error('Altes Passwort nicht angegeben!');
bernd * Passwörter mit cracklib p...

bernd authored 17 years ago

46)   elseif (($check = strong_password($_POST['password1'])) !== true)
47)     input_error("Das Passwort ist zu einfach (cracklib sagt: {$check})!");
bernd webinterface => /webinterface

bernd authored 17 years ago

48)   else
49)   {
bernd Viele XHTML-Fehler korrigie...

bernd authored 17 years ago

50)     if ($result & ROLE_SYSTEMUSER)
bernd webinterface => /webinterface

bernd authored 17 years ago

51)       set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']);
bernd Passwort-Ändern geht jetzt...

bernd authored 14 years ago

52)     elseif ($result & ROLE_SUBUSER)
53)       set_subuser_password($_SESSION['subuser'], $_POST['password1']);
bernd Viele XHTML-Fehler korrigie...

bernd authored 17 years ago

54)     elseif ($result & ROLE_CUSTOMER)
bernd webinterface => /webinterface

bernd authored 17 years ago

55)       set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']);
56)     else
bernd * Initialisierung der Sessi...

bernd authored 17 years ago

57)       system_failure("WTF?! (\$result={$result})");
bernd webinterface => /webinterface

bernd authored 17 years ago

58)     
59)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

60)       header('Location: index');
bernd webinterface => /webinterface

bernd authored 17 years ago

61)     else
62)       output('');
63)   }
64) }
65) 
66) 
67) 
bernd Passwort-Ändern geht jetzt...

bernd authored 14 years ago

68) if ($_SESSION['role'] & ROLE_SYSTEMUSER && ! ($_SESSION['role'] & ROLE_SUBUSER))
bernd webinterface => /webinterface

bernd authored 17 years ago

69)   warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
70) 
bernd Benutze überall title() sta...

bernd authored 14 years ago

71) output('<p>Hier können Sie Ihr Passwort ändern.</p>
bernd eliminate .php extensions f...

bernd authored 16 years ago

72) '.html_form('index_chpass', 'chpass', '', '<table>
bernd webinterface => /webinterface

bernd authored 17 years ago

73)   <tr>
74)     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
75)   </tr>
76)   <tr>
77)     <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" /></td>
78)   </tr>
79)   <tr>
bernd Entities repariert

bernd authored 17 years ago

80)     <td>Bestätigung:<br /><span style="font-size: 80%;">(nochmal neues Passwort)</span></td>
bernd webinterface => /webinterface

bernd authored 17 years ago

81)                                    <td><input type="password" name="password2" value="" /></td>
82)   </tr>
bernd Auch mailaccounts können si...

bernd authored 17 years ago

83) </table>
84) <p><input type="submit" value="Speichern" /></p>
85) '));
bernd Viele XHTML-Fehler korrigie...

bernd authored 17 years ago

86) 
87)