1d76d27b509447782df9a6bec02357110bd3c44a
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)   
Bernd Wurst Füge Masterdomain automatis...

Bernd Wurst authored 11 years ago

31)   if (! strstr($username, '@')) {
32)     // Default-Domainname
33)     $username = $username.'@'.config('masterdomain');
34)   }
35) 
Bernd Wurst löschen der OTP-Authentifiz...

Bernd Wurst authored 11 years ago

36)   $success = true;
37)   
38)   if (! check_webmail_password($username, $webmailpw)) {
39)     input_error('Das Webmail-Passwort hat nicht gestimmt.');
40)     $success = false;
41)   }
42) 
Bernd Wurst blacklist für eingegebene C...

Bernd Wurst authored 11 years ago

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

Bernd Wurst authored 11 years ago

47)     input_error('Der Google-Authenticator-Code wurde nicht akzeptiert.');
48)     $success = false;
49)   }
50) 
Bernd Wurst blacklist für eingegebene C...

Bernd Wurst authored 11 years ago

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

Bernd Wurst authored 11 years ago

52)   if ($success) {
53)     output('<p>'.icon_ok().' Der Test war erfolgreich!');
54)   } else {
55)     output('<p>'.icon_error().' Der Test war leider nicht erfolgreich.');
56)   }
57) 
58) 
59)   output('<h3>Weiterer Test</h3>');
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

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

Bernd Wurst authored 11 years ago

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