d3f65e076fdea6476cda3964ab5764d8d507d79d
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

1) <?php
2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
5) Written 2008-2014 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 
Hanno Böck URLs von http nach https

Hanno Böck authored 8 years ago

12) https://creativecommons.org/publicdomain/zero/1.0/
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

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) 
20) require_once('useraccounts.php');
21) 
22) require_role(ROLE_SYSTEMUSER);
23) 
24) /* diese Datei wird auf der startseite eingebunden */
25) 
26) $acc = get_account_details($_SESSION['userinfo']['uid'], $_SESSION['userinfo']['customerno']);
27) $usedquota = get_used_quota($acc['uid']);
28) $quota = array();
29) $multiserver = count($usedquota) > 1;
Bernd Wurst Zwischenversion

Bernd Wurst authored 7 years ago

30) $need_more_storage = false;
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

31) foreach ($usedquota as $q)
32) {
33)       $mailbar = '';
34)       $mailstring = '';
35)       $mailpercent = round(( $q['mailquota'] / $q["systemquota"]) * 100);
36)       $mailwidth = 2 * min($mailpercent, 100);
37) 
38)       if ($q["mailquota"] > 0) {
39) 	$mailstring = "<br />(davon {$q["mailquota"]} MB für Postfächer reserviert)";
40)         $mailbar = "<div style=\"font-size: 1px; background-color: blue; height: 10px; width: {$mailwidth}px; margin: 0; padding: 0; float: left;\">&#160;</div>";
41)       }  
42) 
43)       $percent = round(( ($q["systemquota_used"]+$q["mailquota"]) / $q["systemquota"] ) * 100 );
Bernd Wurst Zwischenversion

Bernd Wurst authored 7 years ago

44)       if ($percent > 90) {
45)         $need_more_storage = true;
46)       }
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

47)       $color = ( $percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green" ));
48)       $width = 2 * min($percent, 100) - $mailwidth;
49)      
50)       $used_space = $q['systemquota_used'] + $q['mailquota'];
51)       $msg = "";
52)       if ($multiserver) {
53)         $msg = "<p>Server <strong>{$q['server']}</strong><br />";
54)       }
55)       $quota[] = $msg."{$percent}%: {$used_space} MB von {$q['systemquota']} MB belegt{$mailstring}.</p> 
56)         <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>";
57) 
58) }
59) $customer = get_customer_info($_SESSION['userinfo']['customerno']);
60) $quotastring = implode('', $quota);
61) output("<h5>Stammdaten</h5>
62) <div style=\"margin-left: 2em;\">
63) <p>Benutzername: <strong>{$acc['username']}</strong></p>
64) <p>Servername".($multiserver ? " (primär)" : '').": <strong>".get_server_by_id($acc['server'])."</strong></p>
Hanno Böck URLs von http nach https

Hanno Böck authored 8 years ago

65) <p>Tipp: <a href=\"https://wiki.schokokeks.org/Dateizugriff\">Wiki-Anleitung zum Dateizugriff bzw. zum Ändern der Dateien Ihrer Website.</a></p>
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

66) ");
67) output("</div>\n");
68) output("<h5>Speicherplatz</h5><div style=\"margin-left: 2em;\">{$quotastring}</div>");
Bernd Wurst Zwischenversion

Bernd Wurst authored 7 years ago

69) if (have_module('invoice') && $need_more_storage) {
70)    addnew('../invoice/more_storage?section='.$section, 'Mehr Speicherplatz bestellen');
71) }