63a0529b21bfd97a4ef395e8d3d3f513526357c6
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) 
bernd Entities repariert

bernd authored 16 years ago

5) $title = "Passwort ändern";
bernd webinterface => /webinterface

bernd authored 17 years ago

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)
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 Entities repariert

bernd authored 16 years ago

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

bernd authored 15 years ago

53) '.html_form('index_chpass', 'chpass', '', '<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>
bernd Entities repariert

bernd authored 16 years ago

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

bernd authored 17 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

67) 
68)