9086c9ad77db90633e0629e9e86a88366265ded0
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 Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 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) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

Hanno authored 6 years ago

59) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

60)         if (! $debugmode) {
61)             header('Location: index');
62)         } else {
63)             output('');
64)         }
65)     }
bernd webinterface => /webinterface

bernd authored 17 years ago

66) }
67) 
68) 
69) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

70) if ($_SESSION['role'] & ROLE_SYSTEMUSER && ! ($_SESSION['role'] & ROLE_SUBUSER)) {
71)     warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
72) }
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

84)                                    <td><input type="password" name="password2" value="" /></td>
85)   </tr>