7da094bcb55a7e03bb016cadfabbcbe13f54d6f0
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'])
23)     input_error('Die Best&auml;tigung ist nicht identisch mit dem neuen Passwort!');
24)   elseif ($_POST['password2'] == '')
25)     input_error('Sie m&uuml;ssen das neue Passwort zweimal eingeben!');
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 * Passwörter mit cracklib p...

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 * Passwörter mit cracklib p...

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>
53) <form method="post" action="'.($debugmode ? '?debug' : '').'">
bernd XSRF-kram fixed

bernd authored 16 years ago

54) '.generate_form_token('index_chpass').'