3d226dfeb89424af34c423264628eb2b4dfbe6b2
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 Passwort-Ändern geht jetzt...

bernd authored 13 years ago

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

bernd authored 17 years ago

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

bernd authored 13 years ago

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

bernd authored 17 years ago

7) $error = '';
8) 
9) 
10) 
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 17 years ago

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)
bernd Passwort-Ändern geht jetzt...

bernd authored 13 years ago

16)     if ($_SESSION['role'] & ROLE_SUBUSER)
17)       $result = find_role($_SESSION['subuser'], $_POST['old_password']);
18)     else
19)       $result = find_role($_SESSION['userinfo']['uid'], $_POST['old_password']);
bernd * Initialisierung der Sessi...

bernd authored 16 years ago

20)   else
21)     $result = find_role($_SESSION['customerinfo']['customerno'], $_POST['old_password']);
22) 
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

33)   else
34)   {
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 13 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 17 years ago

43)     
44)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 17 years ago

46)     else
47)       output('');
48)   }
49) }
50) 
51) 
52) 
bernd Passwort-Ändern geht jetzt...

bernd authored 13 years ago

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

bernd authored 17 years ago

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

bernd authored 13 years ago

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

bernd authored 15 years ago

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

bernd authored 17 years ago

58)   <tr>
59)     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
60)   </tr>
61)   <tr>
62)     <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" /></td>
63)   </tr>
64)   <tr>
bernd Entities repariert

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

68) </table>
69) <p><input type="submit" value="Speichern" /></p>
70) '));
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

71) 
72)