Quota-Berechnung auch einem nicht-Kunden-User anzeigen
bernd

bernd commited on 2011-04-22 13:49:10
Zeige 1 geänderte Dateien mit 17 Einfügungen und 4 Löschungen.


git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1991 87cf0b9e-d624-0410-a070-f6ee81989793
... ...
@@ -18,11 +18,24 @@ $usedquota = get_used_quota($acc['uid']);
18 18
 $quota = array();
19 19
 foreach ($usedquota as $q)
20 20
 {
21
-  $percent = round(( $q["used"] / $q["quota"] ) * 100 );
21
+      $mailbar = '';
22
+      $mailstring = '';
23
+      $mailpercent = round(( $q['mailquota'] / $q["systemquota"]) * 100);
24
+      $mailwidth = 2 * min($mailpercent, 100);
25
+
26
+      if ($q["mailquota"] > 0) {
27
+	$mailstring = "<br />(davon {$q["mailquota"]} MB für Postfächer reserviert)";
28
+        $mailbar = "<div style=\"font-size: 1px; background-color: blue; height: 10px; width: {$mailwidth}px; margin: 0; padding: 0; float: left;\">&#160;</div>";
29
+      }  
30
+
31
+      $percent = round(( ($q["systemquota_used"]+$q["mailquota"]) / $q["systemquota"] ) * 100 );
22 32
       $color = ( $percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green" ));
23
-  $width = 2 * min($percent, 100);
24
-  $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$q['used']} MB von {$q['quota']} MB belegt.</p> 
25
-  <div style=\"margin: 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>";
33
+      $width = 2 * min($percent, 100) - $mailwidth;
34
+     
35
+      $used_space = $q['systemquota_used'] + $q['mailquota'];
36
+      $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$used_space} MB von {$q['systemquota']} MB belegt{$mailstring}.</p> 
37
+        <div style=\"margin: 0; padding: 0; width: 200px; border: 1px solid black;\">{$mailbar}<div style=\"font-size: 1px; background-color: {$color}; height: 10px; width: {$width}px; margin: 0; margin-left: {$mailwidth}px; padding: 0;\">&#160;</div></div>";
38
+
26 39
 }
27 40
 $customer = get_customer_info($_SESSION['userinfo']['customerno']);
28 41
 $realname = $acc['name'] ? $acc['name'] : $customer['name'];
29 42