354c05a4ddd678c49bcbba458bffa7d13482139a
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

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

Bernd Wurst authored 12 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

Hanno Böck authored 2 years ago

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

bernd authored 17 years ago

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

bernd authored 13 years ago

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

bernd authored 17 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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

bernd authored 17 years ago

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

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

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

bernd authored 17 years ago

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

bernd authored 13 years ago

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

Hanno Böck authored 6 months 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>
Hanno Use autocomplete=new-passwo...

Hanno authored 4 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

Hanno authored 4 years ago

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

bernd authored 17 years ago

82)   </tr>