9086c9ad77db90633e0629e9e86a88366265ded0
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) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

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) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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 7 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;
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

31) foreach ($usedquota as $q) {
32)     $mailbar = '';
33)     $mailstring = '';
34)     $mailpercent = round(($q['mailquota'] / $q["systemquota"]) * 100);
35)     $mailwidth = 2 * min($mailpercent, 100);
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

36) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

37)     if ($q["mailquota"] > 0) {
38)         $mailstring = "<br />(davon {$q["mailquota"]} MB für Postfächer reserviert)";
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

39)         $mailbar = "<div style=\"font-size: 1px; background-color: blue; height: 10px; width: {$mailwidth}px; margin: 0; padding: 0; float: left;\">&#160;</div>";
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

40)     }
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

41) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

42)     $percent = round((($q["systemquota_used"]+$q["mailquota"]) / $q["systemquota"]) * 100);
43)     if ($percent > 90) {
Bernd Wurst Zwischenversion

Bernd Wurst authored 7 years ago

44)         $need_more_storage = true;
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

45)     }
46)     $color = ($percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green"));
47)     $width = 2 * min($percent, 100) - $mailwidth;
Hanno remove whitespace in empty...

Hanno authored 5 years ago

48) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

49)     $used_space = $q['systemquota_used'] + $q['mailquota'];
50)     $msg = "";
51)     if ($multiserver) {
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

52)         $msg = "<p>Server <strong>{$q['server']}</strong><br />";
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

53)     }
54)     $quota[] = $msg."{$percent}%: {$used_space} MB von {$q['systemquota']} MB belegt{$mailstring}.</p> 
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

55)         <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>";
56) }
57) $customer = get_customer_info($_SESSION['userinfo']['customerno']);
58) $quotastring = implode('', $quota);
59) output("<h5>Stammdaten</h5>
60) <div style=\"margin-left: 2em;\">
61) <p>Benutzername: <strong>{$acc['username']}</strong></p>
62) <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 7 years ago

63) <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

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

Bernd Wurst authored 7 years ago

67) if (have_module('invoice') && $need_more_storage) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

68)     addnew('../invoice/more_storage?section='.$section, 'Mehr Speicherplatz bestellen');
Bernd Wurst Zwischenversion

Bernd Wurst authored 7 years ago

69) }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

70)