3ef995c2108fe77d22c0b556fb9717cb848bc48f
bernd webinterface => /webinterface

bernd authored 19 years ago

1) <?php
Hanno Böck Add newlines before comment...

Hanno Böck authored 1 year ago

2) 
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 14 years ago

3) /*
4) This file belongs to the Webinterface of schokokeks.org Hosting
5) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

6) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 14 years ago

7)   Bernd Wurst <bernd@schokokeks.org>
8)   Hanno Böck <hanno@schokokeks.org>
9) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

10) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 14 years ago

11) 
12) 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.
13) */
14) 
bernd webinterface => /webinterface

bernd authored 19 years ago

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

bernd authored 18 years ago

16) require_once('inc/security.php');
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 4 years ago

17) require_role([ROLE_SYSTEMUSER, ROLE_CUSTOMER, ROLE_SUBUSER]);
bernd webinterface => /webinterface

bernd authored 19 years ago

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

bernd authored 15 years ago

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

bernd authored 19 years ago

20) $error = '';
21) 
22) 
23) 
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

24) if (isset($_POST['password1'])) {
25)     check_form_token('index_chpass');
26)     $result = null;
27)     if ($_SESSION['role'] & ROLE_SYSTEMUSER) {
28)         if ($_SESSION['role'] & ROLE_SUBUSER) {
29)             $result = find_role($_SESSION['subuser'], $_POST['old_password']);
30)         } else {
31)             $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
32)         }
33)     } else {
34)         $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
35)     }
36) 
37)     if ($result == null) {
38)         input_error('Das bisherige Passwort ist nicht korrekt!');
39)     } elseif ($_POST['password2'] != $_POST['password1']) {
40)         input_error('Die Bestätigung ist nicht identisch mit dem neuen Passwort!');
41)     } elseif ($_POST['password2'] == '') {
42)         input_error('Sie müssen das neue Passwort zweimal eingeben!');
43)     } elseif ($_POST['old_password'] == '') {
44)         input_error('Altes Passwort nicht angegeben!');
45)     } elseif (($check = strong_password($_POST['password1'])) !== true) {
46)         input_error("Das Passwort ist zu einfach ({$check})!");
47)     } else {
48)         if ($result & ROLE_SYSTEMUSER) {
49)             set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']);
50)         } elseif ($result & ROLE_SUBUSER) {
51)             set_subuser_password($_SESSION['subuser'], $_POST['password1']);
52)         } elseif ($result & ROLE_CUSTOMER) {
53)             set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']);
54)         } else {
55)             system_failure("WTF?! (\$result={$result})");
56)         }
Hanno remove whitespace in empty...

Hanno authored 7 years ago

57) 
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

58)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

59)             header('Location: index');
60)         } else {
61)             output('');
62)         }
63)     }
bernd webinterface => /webinterface

bernd authored 19 years ago

64) }
65) 
66) 
67) 
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

68) if ($_SESSION['role'] & ROLE_SYSTEMUSER && !($_SESSION['role'] & ROLE_SUBUSER)) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

69)     warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
70) }
bernd webinterface => /webinterface

bernd authored 19 years ago

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

bernd authored 15 years ago

72) output('<p>Hier können Sie Ihr Passwort ändern.</p>
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

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

bernd authored 19 years ago

74)   <tr>
75)     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
76)   </tr>
77)   <tr>
Hanno Use autocomplete=new-passwo...

Hanno authored 6 years ago

78)     <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" autocomplete="new-password" /></td>
bernd webinterface => /webinterface

bernd authored 19 years ago

79)   </tr>
80)   <tr>
bernd Entities repariert

bernd authored 18 years ago

81)     <td>Bestätigung:<br /><span style="font-size: 80%;">(nochmal neues Passwort)</span></td>
Hanno Use autocomplete=new-passwo...

Hanno authored 6 years ago

82)                                    <td><input type="password" name="password2" value="" autocomplete="new-password" /></td>
bernd webinterface => /webinterface

bernd authored 19 years ago

83)   </tr>