df4393ed3a05f97cf243500eb36be872679284e6
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 11 years ago

1) <?php
Hanno Böck Add newlines before comment...

Hanno Böck authored 10 months ago

2) 
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 11 years ago

3) /*
4) This file belongs to the Webinterface of schokokeks.org Hosting
5) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

6) Written by schokokeks.org Hosting, namely
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 11 years ago

7)   Bernd Wurst <bernd@schokokeks.org>
8)   Hanno Böck <hanno@schokokeks.org>
9) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

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

Bernd Wurst authored 11 years ago

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

Hanno Böck authored 4 years ago

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

Bernd Wurst authored 11 years ago

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

Bernd Wurst authored 8 years ago

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

Hanno authored 7 years ago

29) foreach ($usedquota as $q) {
30)     $mailbar = '';
31)     $mailstring = '';
Hanno Böck update codingstyle

Hanno Böck authored 1 year ago

32)     $mailpercent = round(($q['mailquota'] / max($q["systemquota"], 1)) * 100);
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

33)     $mailwidth = 2 * min($mailpercent, 100);
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 11 years ago

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

Hanno authored 7 years ago

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

Bernd Wurst authored 11 years ago

37)         $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 7 years ago

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

Bernd Wurst authored 11 years ago

39) 
Hanno Böck update codingstyle

Hanno Böck authored 1 year ago

40)     $percent = round((($q["systemquota_used"] + $q["mailquota"]) / max($q["systemquota"], 1)) * 100);
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

41)     if ($percent > 90) {
Bernd Wurst Zwischenversion

Bernd Wurst authored 8 years ago

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

Hanno authored 7 years ago

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

Hanno authored 7 years ago

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

Hanno authored 7 years ago

47)     $used_space = $q['systemquota_used'] + $q['mailquota'];
48)     $msg = "";
49)     if ($multiserver) {
Bernd Wurst Set translate=no to several...

Bernd Wurst authored 8 months ago

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

Hanno authored 7 years ago

51)     }
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

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

Bernd Wurst authored 11 years ago

53)         <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>";
54) }
55) $customer = get_customer_info($_SESSION['userinfo']['customerno']);
56) $quotastring = implode('', $quota);
Bernd Wurst Warnung auf der Startseite,...

Bernd Wurst authored 2 years ago

57) 
58) $passwordlogin = '';
Bernd Wurst toleriere, wenn die Loginme...

Bernd Wurst authored 2 years ago

59) if (isset($_SESSION['loginmethod']) && $_SESSION['loginmethod'] == 'passkey' && $acc['passwordlogin'] == 1) {
Bernd Wurst Warnung auf der Startseite,...

Bernd Wurst authored 2 years ago

60)     $passwordlogin = '<p class=warning>Die Anmeldung per SSH ist noch mit Passwort möglich. Das können Sie ' . internal_link($prefix . 'go/systemuser/edit', 'hier ändern') . '!</p>';
61) }
62) 
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 11 years ago

63) output("<h5>Stammdaten</h5>
64) <div style=\"margin-left: 2em;\">
65) <p>Benutzername: <strong>{$acc['username']}</strong></p>
Bernd Wurst Set translate=no to several...

Bernd Wurst authored 8 months ago

66) <p>Servername" . ($multiserver ? " (primär)" : '') . ": <strong translate=\"no\">" . get_server_by_id($acc['server']) . "</strong></p>
Bernd Wurst Warnung auf der Startseite,...

Bernd Wurst authored 2 years ago

67) {$passwordlogin}
Hanno Böck URLs von http nach https

Hanno Böck authored 9 years ago

68) <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 11 years ago

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

Bernd Wurst authored 8 years ago

72) if (have_module('invoice') && $need_more_storage) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

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

Bernd Wurst authored 8 years ago

74) }
Hanno remove whitespace in empty...

Hanno authored 7 years ago

75)