f2550e90ad37215b9d890155806986336bf0170c
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 Umstellung auf Theme-Suppor...

bernd authored 13 years ago

4) require_role(array(ROLE_SYSTEMUSER, ROLE_CUSTOMER));
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)
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)
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 17 years ago

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) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

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

bernd authored 15 years ago

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

bernd authored 17 years ago

53)   <tr>
54)     <td>bisheriges Passwort:</td>  <td><input type="password" name="old_password" value="" /></td>
55)   </tr>
56)   <tr>
57)     <td>neues Passwort:</td>       <td><input type="password" name="password1" value="" /></td>
58)   </tr>
59)   <tr>
bernd Entities repariert

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

63) </table>
64) <p><input type="submit" value="Speichern" /></p>
65) '));
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

66) 
67)