5fae5f1047cc1560b7ceb483ad1d16cc1b55143a
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

1) <?php
2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
5) Written 2008-2012 by schokokeks.org Hosting, namely
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) 
17) require_once('inc/base.php');
18) require_once('inc/icons.php');
19) require_role(ROLE_SYSTEMUSER);
20) 
21) require_once('googleauth.php');
22) 
Bernd Wurst löschen der OTP-Authentifiz...

Bernd Wurst authored 11 years ago

23) $section='googleauth_overview';
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

24) title('Test der Zwei-Faktor-authentifizierung');
25) 
Bernd Wurst löschen der OTP-Authentifiz...

Bernd Wurst authored 11 years ago

26) if (isset($_REQUEST['username'])) {
27)   $username = $_REQUEST['username'];
28)   $webmailpw = $_REQUEST['webmailpass'];
29)   $ga_code = $_REQUEST['ga_code'];
30)   
31)   $success = true;
32)   
33)   if (! check_webmail_password($username, $webmailpw)) {
34)     input_error('Das Webmail-Passwort hat nicht gestimmt.');
35)     $success = false;
36)   }
37) 
Bernd Wurst blacklist für eingegebene C...

Bernd Wurst authored 11 years ago

38)   if (check_locked($username)) {
39)     input_error('Aufgrund einiger Fehlversuche wurde dieses Konto übergangsweise deaktiviert. Bitte warten Sie ein paar Minuten.');
40)     $success = false;
41)   } elseif (! check_googleauth($username, $ga_code)) {
Bernd Wurst löschen der OTP-Authentifiz...

Bernd Wurst authored 11 years ago

42)     input_error('Der Google-Authenticator-Code wurde nicht akzeptiert.');
43)     $success = false;
44)   }
45) 
Bernd Wurst blacklist für eingegebene C...

Bernd Wurst authored 11 years ago

46) 
Bernd Wurst löschen der OTP-Authentifiz...

Bernd Wurst authored 11 years ago

47)   if ($success) {
48)     output('<p>'.icon_ok().' Der Test war erfolgreich!');
49)   } else {
50)     output('<p>'.icon_error().' Der Test war leider nicht erfolgreich.');
51)   }
52) 
53) 
54)   output('<h3>Weiterer Test</h3>');
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

55) } else {
Bernd Wurst löschen der OTP-Authentifiz...

Bernd Wurst authored 11 years ago

56)   $username = '';
57)   output('<p>Geben Sie hier die Login-Daten ein um Ihren Zugang zu testen.</p>');