fbb3a834e4667961605b2d25c5efd592f302049c
bernd webinterface => /webinterface

bernd authored 17 years ago

1) <?php
2) require_once('inc/debug.php');
bernd * Passwörter mit cracklib p...

bernd authored 16 years ago

3) require_once('inc/security.php');
bernd webinterface => /webinterface

bernd authored 17 years ago

4) 
5) $title = "Passwort &auml;ndern";
6) $error = '';
7) 
8) require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
9) 
10) 
11) if ($_POST['password1'] != '')
12) {
bernd XSRF-kram fixed

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

15)   if ($_SESSION['role'] & ROLE_SYSTEMUSER)
16)     $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
17)   else
18)     $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
19) 
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

30)   else
31)   {
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

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

bernd authored 17 years ago

33)       set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']);
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

38)     
39)     if (! $debugmode)
40)       header('Location: index.php');
41)     else
42)       output('');
43)   }
44) }
45) 
46) 
47) 
bernd * Initialisierung der Sessi...

bernd authored 16 years ago

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

bernd authored 17 years ago

49)   warning('Beachten Sie: Wenn Sie hier Ihr Passwort ändern, betrifft dies auch Ihr Anmelde-Passwort am Server (SSH).');
50) 
51) output('<h3>Passwort &auml;ndern</h3>
52) <p>Hier k&ouml;nnen Sie Ihr Passwort &auml;ndern.</p>
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

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

bernd authored 17 years ago

54)   <tr>
55)     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
56)   </tr>
57)   <tr>
58)     <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" /></td>
59)   </tr>
60)   <tr>
61)     <td>Best&auml;tigung:<br /><span style="font-size: 80%;">(nochmal neues Passwort)</span></td>
62)                                    <td><input type="password" name="password2" value="" /></td>
63)   </tr>
64)   <tr>
65)     <td>&nbsp;</td><td><input type="submit" value="Speichern" /></td>
66)   </tr>
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

67) </table>'));
68) 
69)