2626dd47daad110c63a82c0560b134e2364eeac3
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php    1) <?php
modules/googleauth/overview.php    2) /*
modules/googleauth/overview.php    3) This file belongs to the Webinterface of schokokeks.org Hosting
modules/googleauth/overview.php    4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

modules/webmailtotp/overview.php   5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php    6)   Bernd Wurst <bernd@schokokeks.org>
modules/googleauth/overview.php    7)   Hanno Böck <hanno@schokokeks.org>
modules/googleauth/overview.php    8) 
modules/googleauth/overview.php    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.
modules/googleauth/overview.php   10) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   12) http://creativecommons.org/publicdomain/zero/1.0/
modules/googleauth/overview.php   13) 
modules/googleauth/overview.php   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.
modules/googleauth/overview.php   15) */
modules/googleauth/overview.php   16) 
Bernd Wurst Umbenennung Google-Auth nac...

Bernd Wurst authored 11 years ago

modules/webmailtotp/overview.php  17) require_once('totp.php');
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   18) require_role(ROLE_SYSTEMUSER);
modules/googleauth/overview.php   19) 
Bernd Wurst Umbenennung Google-Auth nac...

Bernd Wurst authored 11 years ago

modules/webmailtotp/overview.php  20) title("Zwei-Faktor-Anmeldung am Webmailer");
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   21) 
modules/googleauth/overview.php   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>
modules/googleauth/overview.php   23) <p>Dieses System schützt Sie vor mitgelesenen Tastatureingaben in nicht vertrauenswürdiger Umgebung z.B. in einem Internet-Café.</p>
Bernd Wurst Umbenennung Google-Auth nac...

Bernd Wurst authored 11 years ago

modules/webmailtotp/overview.php  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>TOTP-Einmalcodes nach RFC 6238</strong> erzeugt. Beispiele dafür sind <a href="https://code.google.com/p/google-authenticator/">Google-Authenticator</a> oder <a href="http://f-droid.org/repository/browse/?fdfilter=motp&fdid=org.cry.otp&fdpage=1">mOTP</a>. Meist ist dies ein Smartphone mit einer entsprechenden App.</p>
modules/webmailtotp/overview.php  25) <p><strong>Beachten Sie:</strong> Die Zwei-Faktor-Anmeldung 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-Anmeldung unbedingt ein separates Passwort festlegen.</p>
modules/webmailtotp/overview.php  26) <h3>Fügen Sie Zwei-Faktor-Anmeldung zu Ihren bestehenden Postfächern hinzu</h3>
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   27) ');
modules/googleauth/overview.php   28) 
modules/googleauth/overview.php   29) 
modules/googleauth/overview.php   30) require_once('modules/email/include/hasaccount.php');
modules/googleauth/overview.php   31) require_once('modules/email/include/vmail.php');
modules/googleauth/overview.php   32) 
modules/googleauth/overview.php   33) if (! (user_has_accounts() || count(get_vmail_accounts())>0)) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  34)     output('<p><em>Bisher haben Sie kein Postfach. Bitte erstellen sie zunächst ein Postfach.</em></p>');
modules/webmailtotp/overview.php  35) } else {
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   36) 
modules/googleauth/overview.php   37) /* VMAIL */
modules/googleauth/overview.php   38) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  39)     $domains = get_vmail_domains();
modules/webmailtotp/overview.php  40)     $vmail_accounts = get_vmail_accounts();
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   41) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  42)     $sorted_by_domains = array();
modules/webmailtotp/overview.php  43)     foreach ($vmail_accounts as $account) {
modules/webmailtotp/overview.php  44)         if ($account['password'] == '') {
modules/webmailtotp/overview.php  45)             continue;
modules/webmailtotp/overview.php  46)         }
modules/webmailtotp/overview.php  47)         if (array_key_exists($account['domain'], $sorted_by_domains)) {
modules/webmailtotp/overview.php  48)             array_push($sorted_by_domains[$account['domain']], $account);
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   49)         } else {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  50)             $sorted_by_domains[$account['domain']] = array($account);
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   51)         }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  52)     }
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   53) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  54)     DEBUG($sorted_by_domains);
modules/webmailtotp/overview.php  55) 
modules/webmailtotp/overview.php  56)     if (count($sorted_by_domains) > 0) {
modules/webmailtotp/overview.php  57)         foreach ($sorted_by_domains as $accounts_on_domain) {
modules/webmailtotp/overview.php  58)             if (count($sorted_by_domains) > 2) {
modules/webmailtotp/overview.php  59)                 output('<h4>'.$accounts_on_domain[0]['domainname'].'</h4>');
modules/webmailtotp/overview.php  60)             }
modules/webmailtotp/overview.php  61) 
modules/webmailtotp/overview.php  62)             foreach ($accounts_on_domain as $this_account) {
modules/webmailtotp/overview.php  63)                 $username = $this_account['local'].'@'.$this_account['domainname'];
modules/webmailtotp/overview.php  64)                 output('<div style="margin-left: 2em;"><p style="margin-left: -2em;"><strong>'.$username.'</strong></p>');
modules/webmailtotp/overview.php  65)                 $id = account_has_totp($username);
modules/webmailtotp/overview.php  66)                 if ($id) {
modules/webmailtotp/overview.php  67)                     output(addnew('delete', 'Zwei-Faktor-Anmeldung für dieses Postfach abschalten', 'id='.$id, 'style="background-image: url('.$prefix.'images/delete.png); color: red;"'));
modules/webmailtotp/overview.php  68)                 } else {
modules/webmailtotp/overview.php  69)                     output(addnew('setup', 'Zwei-Faktor-Anmeldung für dieses Postfach aktivieren', 'username='.urlencode($username)));
modules/webmailtotp/overview.php  70)                 }
modules/webmailtotp/overview.php  71)                 output('</div>');
modules/webmailtotp/overview.php  72)             }
modules/webmailtotp/overview.php  73)         }
modules/webmailtotp/overview.php  74)     }
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   75) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  76)     /* Mailaccounts */
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   77) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  78)     require_once('modules/email/include/mailaccounts.php');
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   79) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  80)     $accounts = mailaccounts($_SESSION['userinfo']['uid']);
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   81) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  82)     if (count($accounts) > 0) {
modules/webmailtotp/overview.php  83)         if (count($sorted_by_domains) > 0) {
modules/webmailtotp/overview.php  84)             output('<h3>IMAP/POP3-Accounts</h3>');
modules/webmailtotp/overview.php  85)         }
Bernd Wurst Google-Auth-Token setzen un...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php   86) 
modules/googleauth/overview.php   87) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

modules/webmailtotp/overview.php  88)         foreach ($accounts as $acc) {
modules/webmailtotp/overview.php  89)             if ($acc['mailbox']) {
modules/webmailtotp/overview.php  90)                 output('<div style="margin-left: 2em;"><p style="margin-left: -2em;"><strong>'.$acc['account'].'</strong></p>');
modules/webmailtotp/overview.php  91)                 $username = $acc['account'];
modules/webmailtotp/overview.php  92)                 $id = account_has_totp($username);
modules/webmailtotp/overview.php  93)                 if ($id) {
modules/webmailtotp/overview.php  94)                     output(addnew('delete', 'Zwei-Faktor-Anmeldung für dieses Postfach abschalten', 'id='.$id, 'style="background-image: url('.$prefix.'images/delete.png); color: red;"'));
modules/webmailtotp/overview.php  95)                 } else {
modules/webmailtotp/overview.php  96)                     output(addnew('setup', 'Zwei-Faktor-Anmeldung für dieses Postfach aktivieren', 'username='.urlencode($username)));
modules/webmailtotp/overview.php  97)                 }
modules/webmailtotp/overview.php  98)                 output('</div>');
modules/webmailtotp/overview.php  99)             }
modules/webmailtotp/overview.php 100)         }
Bernd Wurst Attribution für die externe...

Bernd Wurst authored 11 years ago

modules/googleauth/overview.php  101)     }