6e6b6d2f074d7b478a3e6b19c3aa6df1ecdea586
bernd webinterface => /webinterface

bernd authored 17 years ago

1) <?php
2) $title = "Passwort beantragen";
3) 
4) $show = 'token';
5) 
6) if (isset($_REQUEST['customerno']) and isset($_REQUEST['token']))
7) {
8)   $customerno = (int) $_REQUEST['customerno'];
9)   $token = $_REQUEST['token'];
10)   
11)   require_once('newpass.php');
bernd * Passwörter mit cracklib p...

bernd authored 16 years ago

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

bernd authored 17 years ago

13)   if (validate_token($customerno, $token))
14)   {
15)     $show = 'password';
16)     if (isset($_POST['password']))
17)     {
18)       if ($_POST['password'] != $_POST['password2'])
19)         input_error("Die beiden Passwort-Eingaben stimmen nicht überein.");
20)       elseif ($_POST['password'] == '')
21)         input_error("Es kann kein leeres Passwort gesetzt werden");
bernd * Passwörter mit cracklib p...

bernd authored 16 years ago

22)       elseif (($result = strong_password($_POST['password'])) !== true)
23)         input_error("Das Passwort ist zu einfach (cracklib sagt: {$result})!");
bernd webinterface => /webinterface

bernd authored 17 years ago

24)       else
25)       {
26)         require_once('session/checkuser.php');
bernd Logging aktiviert

bernd authored 16 years ago

27)         require_once('inc/base.php');
bernd eliminate .php extensions f...

bernd authored 15 years ago

28)         logger("modules/index/validate_token", "pwrecovery", "customer »{$customerno}« set a new password");
bernd webinterface => /webinterface

bernd authored 17 years ago

29)         set_customer_password($customerno, $_POST['password']);
30)         success_msg('Das Passwort wurde gesetzt!');
bernd Kunden-Status wird benutzt...

bernd authored 16 years ago

31)         set_customer_verified($customerno);
32)         set_customer_lastlogin($customerno);
bernd webinterface => /webinterface

bernd authored 17 years ago

33)         invalidate_customer_token($customerno);
bernd Nach Passwort-Setzen ist ma...

bernd authored 16 years ago

34)         $_SESSION['role'] = ROLE_CUSTOMER;
35)         $_SESSION['customerinfo'] = get_customer_info($customerno);
bernd webinterface => /webinterface

bernd authored 17 years ago

36)         output('<h3>Passwort gesetzt</h3>
bernd eliminate .php extensions f...

bernd authored 15 years ago

37)         <p>Ihr neues Passwort wurde gesetzt, Sie können jetzt '.internal_link("index", "die Web-Oberfläche sofort benutzen").'.</p>');
bernd webinterface => /webinterface

bernd authored 17 years ago

38)         $show = NULL;
39)       }
40)     }
41)   }
42)   else
43)   {
bernd Token -> Code

bernd authored 16 years ago

44)     input_error("Der eingegebene Code war nicht korrekt. Bitte benutzen Sie die Kopieren &amp; Einfügen-Operation!");
bernd webinterface => /webinterface

bernd authored 17 years ago

45)   }
46) }
47) 
48) if ($show == 'password')
49) {
50)   output('<h3>Neues Passwort setzen</h3>
51)   <p>Bitte legen Sie jetzt Ihr neues Kunden-Passwort fest.</p>
52)   <form action="" method="post">
bernd Noch ein XHTML-Fehler

bernd authored 16 years ago

53)   <p style="display: none"><input type="hidden" name="customerno" value="'.$customerno.'" />
54)   <input type="hidden" name="token" value="'.$token.'" /></p>
bernd webinterface => /webinterface

bernd authored 17 years ago

55)   <p><span class="login_label">Neues Passwort:</span> <input type="password" name="password" size="30" /></p>
56)   <p><span class="login_label">Bestätigung:</span> <input type="password" name="password2" size="30" /></p>
bernd Entities repariert

bernd authored 16 years ago

57)   <p><span class="login_label">&#160;</span> <input type="submit" value="Passwort setzen" /></p>
bernd webinterface => /webinterface

bernd authored 17 years ago

58)   </form>');
59) }
60) elseif ($show == 'token')
61) {
62)   output('<h3>Neues Passwort setzen</h3>
bernd Token -> Code

bernd authored 16 years ago

63)   <p>Bitte geben Sie Ihre Kundennummer und den per E-Mail zugeschickten Code ein. Alternativ können sie den Link aus der E-Mail direkt aufrufen.</p>
bernd webinterface => /webinterface

bernd authored 17 years ago

64)   <form action="" method="post">
65)   <p><span class="login_label">Kundennummer:</span> <input type="text" name="customerno" size="30" /></p>
bernd Token -> Code

bernd authored 16 years ago

66)   <p><span class="login_label">Code:</span> <input type="text" name="token" size="30" /></p>
bernd Entities repariert

bernd authored 16 years ago

67)   <p><span class="login_label">&#160;</span> <input type="submit" value="Überprüfen" /></p>