modules/email/vmailoverview.php
aa811d39
 <?php
c208bd90
 /*
 This file belongs to the Webinterface of schokokeks.org Hosting
 
cf54502a
 Written 2008-2018 by schokokeks.org Hosting, namely
c208bd90
   Bernd Wurst <bernd@schokokeks.org>
   Hanno Böck <hanno@schokokeks.org>
 
 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.
 
2626dd47
 You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
c208bd90
 http://creativecommons.org/publicdomain/zero/1.0/
 
 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.
 */
aa811d39
 
 require_once('inc/base.php');
 require_once('inc/icons.php');
 require_once('inc/security.php');
 require_role(ROLE_VMAIL_ACCOUNT);
 
 require_once('include/vmail.php');
 
 $id = get_vmail_id_by_emailaddr($_SESSION['mailaccount']);
 $acc = get_account_details($id, false);
 $actions = array();
 DEBUG($acc);
 
 $content = '<h3>Aktueller Speicherplatzverbrauch</h3>';
 
2626dd47
 $percent = round(($acc["quota_used"] / $acc["quota"]) * 100);
 $color = ($percent > 95 ? 'red' : ($percent > 75 ? "yellow" : "green"));
aa811d39
 $width = 2 * min($percent, 100);
 $content .= "<div><div style=\"margin: 2px 0; padding: 0; width: 200px; border: 1px solid black;\"><div style=\"font-size: 1px; background-color: {$color}; height: 10px; width: {$width}px; margin: 0; padding: 0;\">&#160;</div></div> {$acc['quota_used']} MB von {$acc['quota']} MB belegt</div>";
 
 $content .= '<h3>Einstellungen</h3>
 <p>Eingehende E-Mails für Ihre Adresse werden wie folgt verarbeitet:</p>';
 
63251bca
 $content .= '<p>'.other_icon('go.png')." Ablegen in Ihrer Mailbox</p>";
aa811d39
 
 
 if ($acc['autoresponder']) {
2626dd47
     $now = date('Y-m-d H:i:s');
     $valid_from = $acc['autoresponder']['valid_from'];
     $valid_from_string = date('d.m.Y', strtotime($acc['autoresponder']['valid_from']));
     $valid_until = $acc['autoresponder']['valid_until'];
     $valid_until_string = date('d.m.Y', strtotime($acc['autoresponder']['valid_until']));
     if ($valid_from == null) {
         // Autoresponder abgeschaltet
     //$content .= '<p>'.other_icon('go.png')." Es wird keine automatische Antwort versendet</p>";
     } elseif ($valid_from > $now) {
         $content .= '<p>'.other_icon('go.png')." Es wird ab dem {$valid_from_string} eine automatische Antwort versendet</p>";
     } elseif ($valid_until == null) {
         $content .= '<p>'.other_icon('go.png')." Es wird eine automatische Antwort versendet</p>";
     } elseif ($valid_until > $now) {
         $content .= '<p>'.other_icon('go.png')." Es wird eine automatische Antwort versendet, jedoch nicht mehr ab dem {$valid_until_string}</p>";
     } elseif ($valid_until < $now) {
         $content .= '<p>'.other_icon('go.png')." Es wird seit dem {$valid_until_string} keine automatische Antwort mehr versendet</p>";
     }
aa811d39
 }
 
2626dd47
 foreach ($acc['forwards'] as $fwd) {
     $fwd['destination'] = filter_input_general($fwd['destination']);
     $content .= '<p>'.other_icon('go.png')." Weiterleitung an <strong>{$fwd['destination']}</strong></p>";
aa811d39
 }
 
a12281a9
 
 $content .= '<h3>Nachrichten-Abruf</h3>
 <p>'.internal_link('/go/email/logindata', 'Zugangsdaten für E-Mail-Abruf anzeigen', 'server='.get_server_by_id($acc['server']).'&type=vmail').'</p>';