f12aba6daa6e2848a8ed60ea57b26874d6675f52
bernd webinterface => /webinterface

bernd authored 17 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Updated copyright notice (2...

Bernd Wurst authored 11 years ago

5) Written 2008-2013 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
16) 
bernd Benutze überall title() sta...

bernd authored 14 years ago

17) title("Passwort setzen");
bernd webinterface => /webinterface

bernd authored 17 years ago

18) 
19) $show = 'token';
20) 
21) if (isset($_REQUEST['customerno']) and isset($_REQUEST['token']))
22) {
23)   $customerno = (int) $_REQUEST['customerno'];
24)   $token = $_REQUEST['token'];
25)   
26)   require_once('newpass.php');
bernd * Passwörter mit cracklib p...

bernd authored 17 years ago

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

bernd authored 17 years ago

28)   if (validate_token($customerno, $token))
29)   {
30)     $show = 'password';
31)     if (isset($_POST['password']))
32)     {
33)       if ($_POST['password'] != $_POST['password2'])
34)         input_error("Die beiden Passwort-Eingaben stimmen nicht überein.");
35)       elseif ($_POST['password'] == '')
36)         input_error("Es kann kein leeres Passwort gesetzt werden");
bernd * Passwörter mit cracklib p...

bernd authored 17 years ago

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

bernd authored 17 years ago

39)       else
40)       {
41)         require_once('session/checkuser.php');
bernd Logging aktiviert

bernd authored 17 years ago

42)         require_once('inc/base.php');
bernd Logger mit Logleveln

bernd authored 15 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

46)         set_customer_verified($customerno);
47)         set_customer_lastlogin($customerno);
bernd webinterface => /webinterface

bernd authored 17 years ago

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

bernd authored 17 years ago

49)         $_SESSION['role'] = ROLE_CUSTOMER;
50)         $_SESSION['customerinfo'] = get_customer_info($customerno);
bernd Benutze überall title() sta...

bernd authored 14 years ago

51) 	title("Passwort gesetzt");
52)         output('<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

53)         $show = NULL;
54)       }
55)     }
56)   }
57)   else
58)   {
bernd Token -> Code

bernd authored 17 years ago

59)     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

60)   }
61) }
62) 
63) if ($show == 'password')
64) {
bernd Benutze überall title() sta...

bernd authored 14 years ago

65)   output('<p>Bitte legen Sie jetzt Ihr neues Kunden-Passwort fest.</p>
bernd webinterface => /webinterface

bernd authored 17 years ago

66)   <form action="" method="post">
bernd Noch ein XHTML-Fehler

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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

bernd authored 17 years ago

72)   </form>');
73) }
74) elseif ($show == 'token')
75) {
bernd Benutze überall title() sta...

bernd authored 14 years ago

76)   output('<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

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

bernd authored 17 years ago

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

bernd authored 17 years ago

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