dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

9) This code is published under a 0BSD license.
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

10) 
11) 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.
12) */
13) 
14) require_once('inc/base.php');
15) require_once('inc/icons.php');
16) 
17) require_once('useraccounts.php');
18) 
19) require_role(ROLE_SYSTEMUSER);
20) 
21) /* diese Datei wird auf der startseite eingebunden */
22) 
23) $acc = get_account_details($_SESSION['userinfo']['uid'], $_SESSION['userinfo']['customerno']);
24) $usedquota = get_used_quota($acc['uid']);
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

25) $quota = [];
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

26) $multiserver = count($usedquota) > 1;
Bernd Wurst Zwischenversion

Bernd Wurst authored 7 years ago

27) $need_more_storage = false;
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

36)         $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

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 7 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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

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

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

Bernd Wurst authored 7 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 7 years ago

66) }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

67)