0efeb504d24a02cca9abc696b0022f58fb1f435d
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('googleauth.php');
18) require_role(ROLE_SYSTEMUSER);
19) 
20) title("Sicherer Zugang zum Webmailer");
21) 
22) output('<p>Sie können bei '.config('company_name').' den Zugang zum Webmailer mit einem Zwei-Faktor-Prozess mit abweichendem Passwort schützen.</p>
23) <p>Dieses System schützt Sie vor mitgelesenen Tastatureingaben in nicht vertrauenswürdiger Umgebung z.B. in einem Internet-Café.</p>
24) <p>Beim Zwei-Faktor-Prozess müssen Sie zum Login ein festes Webmail-Passwort und zusätzlich ein variabler Code, den beispielsweise Ihr Smartphone erzeugen kann, eingeben. Da sich dieser Code alle 30 Sekunden ändert, kann ein Angreifer sich nicht später mit einem abgehörten Passwort noch einmal anmelden. Zum Erzeugen des Einmal-Codes benötigen Sie ein Gerät, das <strong>Google-Authenticator</strong>-Codes erzeugen kann. Meist ist dies ein Smartphne mit einer entsprechenden App.</p>
25) <p><strong>Beachten Sie:</strong> Die Zwei-Faktor-Authentifizierung funktioniert nur für Webmail, beim Login via IMAP wird weiterhin nur das Passwort Ihres Postfachs benötigt. Damit dieses Passwort von einem Angreifer nicht mitgelesen werden kann, müssen Sie zur Zwei-Faktor-Authentifizierung unbedingt ein separates Passwort festlegen.</p>
26) <h3>Fügen Sie Zwei-Faktor-Authentifizierung zu Ihren bestehenden Postfächern hinzu</h3>
27) ');
28) 
29) 
30) require_once('modules/email/include/hasaccount.php');
31) require_once('modules/email/include/vmail.php');
32) 
33) if (! (user_has_accounts() || count(get_vmail_accounts())>0)) {
34)   
35)   output('<p><em>Bisher haben Sie kein Postfach. Bitte erstellen sie zunächst ein Postfach.</em></p>');
36) }
37) else
38) {
39) 
40) /* VMAIL */
41) 
42) $domains = get_vmail_domains();
43) $vmail_accounts = get_vmail_accounts();
44) 
45) $sorted_by_domains = array();
46) foreach ($vmail_accounts AS $account)
47) {
48)   if ($account['password'] == '') {
49)     continue;
50)   }
51)   if (array_key_exists($account['domain'], $sorted_by_domains))
52)     array_push($sorted_by_domains[$account['domain']], $account);
53)   else
54)     $sorted_by_domains[$account['domain']] = array($account);
55) }
56) 
57) DEBUG($sorted_by_domains);
58) 
59) if (count($sorted_by_domains) > 0)
60) {
61)   foreach ($sorted_by_domains as $accounts_on_domain)
62)   {
63)       if (count($sorted_by_domains) > 2) {
64) 	      output('<h4>'.$accounts_on_domain[0]['domainname'].'</h4>');
65)       }
66) 
67) 	    foreach ($accounts_on_domain AS $this_account)
68) 	    {
69)         $username = $this_account['local'].'@'.$this_account['domainname'];  
70)         output('<div style="margin-left: 2em;"><p style="margin-left: -2em;"><strong>'.$username.'</strong></p>');
71)         $id = account_has_googleauth($username);
72)         if ($id) {
Bernd Wurst löschen der OTP-Authentifiz...

Bernd Wurst authored 11 years ago

73)           output(addnew('delete', 'Sicheren Zugang für dieses Postfach abschalten', 'id='.$id, 'style="background-image: url('.$prefix.'images/delete.png); color: red;"'));