dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
bernd one-time-URLs für systemuser

bernd authored 15 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

10) 
11) 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.
12) */
13) 
Bernd Wurst Erlaube Useraccount-Initial...

Bernd Wurst authored 11 years ago

14) require_once('newpass.php');
15) require_once('inc/security.php');
16) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

17) title("Passwort setzen");
bernd one-time-URLs für systemuser

bernd authored 15 years ago

18) $show = 'token';
19) 
Bernd Wurst destroy session when init-l...

Bernd Wurst authored 7 years ago

20) if (isset($_SESSION['role']) && $_SESSION['role'] != ROLE_ANONYMOUS) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

21)     @session_destroy();
Hanno remove whitespace in empty...

Hanno authored 5 years ago

22) 
Hanno PHP_SELF über array

Hanno authored 5 years ago

23)     header('Location: '.$_SERVER['PHP_SELF']);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

24)     die();
Bernd Wurst destroy session when init-l...

Bernd Wurst authored 7 years ago

25) }
26) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

27) if (isset($_REQUEST['token'])) {
28)     $token = $_REQUEST['token'];
29)     $uid = get_uid_for_token($token);
Hanno remove whitespace in empty...

Hanno authored 5 years ago

30) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

31)     if ($uid != null && validate_uid_token($uid, $token)) {
32)         $show = 'agb';
33)         if (isset($_REQUEST['agb']) && $_REQUEST['agb'] == '1') {
34)             $show = 'password';
35)         }
36)         if (isset($_POST['password'])) {
37)             if ($_POST['password'] != $_POST['password2']) {
38)                 input_error("Die beiden Passwort-Eingaben stimmen nicht überein.");
39)             } elseif ($_POST['password'] == '') {
40)                 input_error("Es kann kein leeres Passwort gesetzt werden");
41)             } elseif (preg_match('/["\'\\\\]/', $_POST['password']) === 1) {
42)                 input_error("Das Passwort enthält problematische Zeichen. Bitte keine Anführungszeichen und kein Backslash benutzen.");
43)             } elseif (($result = strong_password($_POST['password'])) !== true) {
44)                 input_error("Das Passwort ist zu einfach ({$result})!");
45)             } else {
46)                 require_once('session/checkuser.php');
47)                 require_once('inc/base.php');
48)                 logger(LOG_INFO, "modules/index/initialize_useraccount", "initialize", "uid »{$uid}« set a new password");
49)                 set_systemuser_password($uid, $_POST['password']);
50)                 invalidate_systemuser_token($uid);
51)                 $_SESSION['role'] = find_role($uid, '', true);
52)                 ;
53)                 setup_session($_SESSION['role'], $uid);
54)                 success_msg('Das Passwort wurde gesetzt!');
55)                 redirect('index');
56)             }
57)         }
58)     } else {
59)         input_error("Der eingegebene Code war nicht korrekt. Eventuell haben Sie die Adresse nicht vollständig übernommen oder die Gültigkeit des Sicherheitscodes ist abgelaufen.");
bernd AGB bestätigen lassen

bernd authored 15 years ago

60)     }
bernd one-time-URLs für systemuser

bernd authored 15 years ago

61) }
62) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

63) if ($show == 'password') {
64)     $username = get_username_for_uid($uid);
65)     title("Neues Passwort setzen");
66)     output('<p>Bitte legen Sie jetzt Ihr neues Passwort fest.</p>'.
bernd one-time-URLs für systemuser

bernd authored 15 years ago

67)   html_form('initialize_useraccount', '', '', '<p style="display: none"><input type="hidden" name="uid" value="'.$uid.'" />
bernd AGB bestätigen lassen

bernd authored 15 years ago

68)   <input type="hidden" name="token" value="'.$token.'" /><input type="hidden" name="agb" value="1" /></p>
Bernd Wurst Zeige Username beim Passwor...

Bernd Wurst authored 11 years ago

69)   <p><span class="login_label">Ihr Benutzername:</span> <strong>'.$username.'</strong></p>
bernd one-time-URLs für systemuser

bernd authored 15 years ago

70)   <p><span class="login_label">Neues Passwort:</span> <input type="password" name="password" size="30" /></p>
71)   <p><span class="login_label">Bestätigung:</span> <input type="password" name="password2" size="30" /></p>
72)   <p><span class="login_label">&#160;</span> <input type="submit" value="Passwort setzen" /></p>
73)   '));
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

74) } elseif ($show == 'agb') {
75)     title("Bestätigung unserer AGB");
76)     output('<p>Die Nutzung unseres Angebots ist an unsere <a href="https://schokokeks.org/agb">Allgemeinen Geschäftsbedingungen</a> gebunden. Bitte lesen Sie diese Bedingungen und bestätigen Sie Ihr Einverständnis. Sollten Sie diese Bedingungen nicht akzeptieren, setzen Sie sich bitte mit uns in Verbindung.</p>'.
bernd AGB bestätigen lassen

bernd authored 15 years ago

77)   html_form('initialize_useraccount_agb', '', '', '<p style="display: none"><input type="hidden" name="uid" value="'.$uid.'" />
78)   <input type="hidden" name="token" value="'.$token.'" /></p>
79)   <p><span class="login_label">&#160;</span><input type="checkbox" name="agb" value="1" /> Ja, ich akzeptiere die AGB.<p>
80)   <p><span class="login_label">&#160;</span> <input type="submit" value="Weiter" /></p>
81)   '));
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

82) } elseif ($show == 'token') {
83)     title("Neues Passwort setzen");
84)     output('<p>Bitte rufen Sie die Adresse aus Ihrer Begrüßungs-E-Mail auf um ein neues Passwort zu setzen.');