ad79a02ef2515c9ec636ce24790e8e4c2205cf22
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 Böck codingstyle, spaces between...

Hanno Böck authored 8 months ago

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

Hanno authored 5 years ago

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)     }
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

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);
Bernd Wurst Warnung auf der Startseite,...

Bernd Wurst authored 4 months ago

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

Bernd Wurst authored 4 months ago

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

Bernd Wurst authored 4 months ago

59)     $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>';
60) }
61) 
Bernd Wurst Zeige Benutzeraccount-Stamm...

Bernd Wurst authored 10 years ago

62) output("<h5>Stammdaten</h5>
63) <div style=\"margin-left: 2em;\">
64) <p>Benutzername: <strong>{$acc['username']}</strong></p>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

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

Bernd Wurst authored 4 months ago

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

Hanno Böck authored 7 years ago

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

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

Bernd Wurst authored 7 years ago

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

Hanno Böck authored 6 months ago

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

Bernd Wurst authored 7 years ago

73) }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

74)