Browse code

Spaces between string concat (.) operator, new PER codingstyle

Hanno Böck authored on 31/10/2023 17:49:30
Showing 1 changed files
... ...
@@ -50,8 +50,8 @@ foreach ($usedquota as $q) {
50 50
 $customer = get_customer_info($_SESSION['userinfo']['customerno']);
51 51
 $realname = $acc['name'] ? $acc['name'] : $customer['name'];
52 52
 $quotastring = implode('', $quota);
53
-output("<h5>Stammdaten</h5><div style=\"margin-left: 2em;\"><p>Benutzername: <strong>{$acc['username']}</strong></p><p>Name: ".filter_output_html($realname)."</p><p>Existiert seit {$acc['erstellungsdatum']}</p><p>Verwendete Shell: {$shell}</p>");
54
-output("<p>".internal_link('edit', other_icon('user_edit.png', 'Bearbeiten').' Daten bearbeiten').'</p>');
53
+output("<h5>Stammdaten</h5><div style=\"margin-left: 2em;\"><p>Benutzername: <strong>{$acc['username']}</strong></p><p>Name: " . filter_output_html($realname) . "</p><p>Existiert seit {$acc['erstellungsdatum']}</p><p>Verwendete Shell: {$shell}</p>");
54
+output("<p>" . internal_link('edit', other_icon('user_edit.png', 'Bearbeiten') . ' Daten bearbeiten') . '</p>');
55 55
 output("</div>\n");
56 56
 output("<h5>Speicherplatz</h5><div style=\"margin-left: 2em;\">{$quotastring}</div>");
57 57
 
Browse code

codingstyle, spaces between operators

Hanno Böck authored on 02/09/2023 07:49:40
Showing 1 changed files
... ...
@@ -39,7 +39,7 @@ foreach ($usedquota as $q) {
39 39
         $mailbar = "<div style=\"font-size: 1px; background-color: blue; height: 10px; width: {$mailwidth}px; margin: 0; padding: 0; float: left;\">&#160;</div>";
40 40
     }
41 41
 
42
-    $percent = round((($q["systemquota_used"]+$q["mailquota"]) / $q["systemquota"]) * 100);
42
+    $percent = round((($q["systemquota_used"] + $q["mailquota"]) / $q["systemquota"]) * 100);
43 43
     $color = ($percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green"));
44 44
     $width = 2 * min($percent, 100) - $mailwidth;
45 45
 
Browse code

Change license from CC0 to 0BSD, all contributors agreed

Hanno Böck authored on 20/08/2022 09:22:23
Showing 1 changed files
... ...
@@ -2,14 +2,11 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2018 by schokokeks.org Hosting, namely
5
+Written by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 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
12
-http://creativecommons.org/publicdomain/zero/1.0/
9
+This code is published under a 0BSD license.
13 10
 
14 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.
15 12
 */
Browse code

Codingstyle PSR12 + array syntax

Hanno Böck authored on 30/10/2021 21:18:17
Showing 1 changed files
... ...
@@ -30,7 +30,7 @@ output("<p>Daten zu Ihrem Benutzeraccount:</p>");
30 30
 $acc = get_account_details($_SESSION['userinfo']['uid'], $_SESSION['userinfo']['customerno']);
31 31
 $shell = $shells[$acc['shell']];
32 32
 $usedquota = get_used_quota($acc['uid']);
33
-$quota = array();
33
+$quota = [];
34 34
 foreach ($usedquota as $q) {
35 35
     $mailbar = '';
36 36
     $mailstring = '';
Browse code

Umstellung von filter_input_general() auf filter_output_html()

Bernd Wurst authored on 21/09/2019 17:07:48
Showing 1 changed files
... ...
@@ -53,7 +53,7 @@ foreach ($usedquota as $q) {
53 53
 $customer = get_customer_info($_SESSION['userinfo']['customerno']);
54 54
 $realname = $acc['name'] ? $acc['name'] : $customer['name'];
55 55
 $quotastring = implode('', $quota);
56
-output("<h5>Stammdaten</h5><div style=\"margin-left: 2em;\"><p>Benutzername: <strong>{$acc['username']}</strong></p><p>Name: {$realname}</p><p>Existiert seit {$acc['erstellungsdatum']}</p><p>Verwendete Shell: {$shell}</p>");
56
+output("<h5>Stammdaten</h5><div style=\"margin-left: 2em;\"><p>Benutzername: <strong>{$acc['username']}</strong></p><p>Name: ".filter_output_html($realname)."</p><p>Existiert seit {$acc['erstellungsdatum']}</p><p>Verwendete Shell: {$shell}</p>");
57 57
 output("<p>".internal_link('edit', other_icon('user_edit.png', 'Bearbeiten').' Daten bearbeiten').'</p>');
58 58
 output("</div>\n");
59 59
 output("<h5>Speicherplatz</h5><div style=\"margin-left: 2em;\">{$quotastring}</div>");
Browse code

remove whitespace in empty lines

Hanno authored on 26/06/2018 23:36:40
Showing 1 changed files
... ...
@@ -45,7 +45,7 @@ foreach ($usedquota as $q) {
45 45
     $percent = round((($q["systemquota_used"]+$q["mailquota"]) / $q["systemquota"]) * 100);
46 46
     $color = ($percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green"));
47 47
     $width = 2 * min($percent, 100) - $mailwidth;
48
-     
48
+
49 49
     $used_space = $q['systemquota_used'] + $q['mailquota'];
50 50
     $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$used_space} MB von {$q['systemquota']} MB belegt{$mailstring}.</p> 
51 51
         <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,5 +57,5 @@ output("<h5>Stammdaten</h5><div style=\"margin-left: 2em;\"><p>Benutzername: <st
57 57
 output("<p>".internal_link('edit', other_icon('user_edit.png', 'Bearbeiten').' Daten bearbeiten').'</p>');
58 58
 output("</div>\n");
59 59
 output("<h5>Speicherplatz</h5><div style=\"margin-left: 2em;\">{$quotastring}</div>");
60
-    
60
+
61 61
 output("<p><sup>*</sup>) Die Werte für den verbrauchten Speicherplatz werden periodisch eingelesen und hier erst verspätet angezeigt!</p>");
Browse code

Fix coding style with php-cs-checker, see https://cs.sensiolabs.org/

Hanno authored on 26/06/2018 13:58:19
Showing 1 changed files
... ...
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely
8 8
 
9 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 10
 
11
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
12 12
 http://creativecommons.org/publicdomain/zero/1.0/
13 13
 
14 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.
... ...
@@ -31,26 +31,24 @@ $acc = get_account_details($_SESSION['userinfo']['uid'], $_SESSION['userinfo']['
31 31
 $shell = $shells[$acc['shell']];
32 32
 $usedquota = get_used_quota($acc['uid']);
33 33
 $quota = array();
34
-foreach ($usedquota as $q)
35
-{
36
-      $mailbar = '';
37
-      $mailstring = '';
38
-      $mailpercent = round(( $q['mailquota'] / $q["systemquota"]) * 100);
39
-      $mailwidth = 2 * min($mailpercent, 100);
40
-
41
-      if ($q["mailquota"] > 0) {
42
-	$mailstring = "<br />(davon {$q["mailquota"]} MB für Postfächer reserviert)";
34
+foreach ($usedquota as $q) {
35
+    $mailbar = '';
36
+    $mailstring = '';
37
+    $mailpercent = round(($q['mailquota'] / $q["systemquota"]) * 100);
38
+    $mailwidth = 2 * min($mailpercent, 100);
39
+
40
+    if ($q["mailquota"] > 0) {
41
+        $mailstring = "<br />(davon {$q["mailquota"]} MB für Postfächer reserviert)";
43 42
         $mailbar = "<div style=\"font-size: 1px; background-color: blue; height: 10px; width: {$mailwidth}px; margin: 0; padding: 0; float: left;\">&#160;</div>";
44
-      }  
43
+    }
45 44
 
46
-      $percent = round(( ($q["systemquota_used"]+$q["mailquota"]) / $q["systemquota"] ) * 100 );
47
-      $color = ( $percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green" ));
48
-      $width = 2 * min($percent, 100) - $mailwidth;
45
+    $percent = round((($q["systemquota_used"]+$q["mailquota"]) / $q["systemquota"]) * 100);
46
+    $color = ($percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green"));
47
+    $width = 2 * min($percent, 100) - $mailwidth;
49 48
      
50
-      $used_space = $q['systemquota_used'] + $q['mailquota'];
51
-      $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$used_space} MB von {$q['systemquota']} MB belegt{$mailstring}.</p> 
49
+    $used_space = $q['systemquota_used'] + $q['mailquota'];
50
+    $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$used_space} MB von {$q['systemquota']} MB belegt{$mailstring}.</p> 
52 51
         <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 52
 }
55 53
 $customer = get_customer_info($_SESSION['userinfo']['customerno']);
56 54
 $realname = $acc['name'] ? $acc['name'] : $customer['name'];
... ...
@@ -61,6 +59,3 @@ output("</div>\n");
61 59
 output("<h5>Speicherplatz</h5><div style=\"margin-left: 2em;\">{$quotastring}</div>");
62 60
     
63 61
 output("<p><sup>*</sup>) Die Werte für den verbrauchten Speicherplatz werden periodisch eingelesen und hier erst verspätet angezeigt!</p>");
64
-
65
-
66
-?>
Browse code

Copyright year update

Bernd Wurst authored on 13/01/2018 06:07:05
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2014 by schokokeks.org Hosting, namely
5
+Written 2008-2018 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Lizenzinfos in eigenes Modul ausgelagert und Copyright auf 2014 angepasst

Bernd Wurst authored on 08/02/2014 05:45:07
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2013 by schokokeks.org Hosting, namely
5
+Written 2008-2014 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Updated copyright notice (2012 => 2013)

Bernd Wurst authored on 19/01/2013 10:49:50
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2012 by schokokeks.org Hosting, namely
5
+Written 2008-2013 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Added license tags for CC0, README and COPYING

Bernd Wurst authored on 11/03/2012 15:40:04
Showing 1 changed files
... ...
@@ -1,4 +1,19 @@
1 1
 <?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting
4
+
5
+Written 2008-2012 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 
12
+http://creativecommons.org/publicdomain/zero/1.0/
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
+
2 17
 require_once('inc/base.php');
3 18
 require_once('inc/icons.php');
4 19
 
Browse code

Quota-Berechnung auch einem nicht-Kunden-User anzeigen

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1991 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 22/04/2011 13:49:10
Showing 1 changed files
... ...
@@ -18,11 +18,24 @@ $usedquota = get_used_quota($acc['uid']);
18 18
 $quota = array();
19 19
 foreach ($usedquota as $q)
20 20
 {
21
-  $percent = round(( $q["used"] / $q["quota"] ) * 100 );
22
-  $color = ( $percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green" ));
23
-  $width = 2 * min($percent, 100);
24
-  $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$q['used']} MB von {$q['quota']} MB belegt.</p> 
25
-  <div style=\"margin: 0; padding: 0; width: 200px; border: 1px solid black;\"><div style=\"font-size: 1px; background-color: {$color}; height: 10px; width: {$width}px; margin: 0; padding: 0;\">&#160;</div></div>";
21
+      $mailbar = '';
22
+      $mailstring = '';
23
+      $mailpercent = round(( $q['mailquota'] / $q["systemquota"]) * 100);
24
+      $mailwidth = 2 * min($mailpercent, 100);
25
+
26
+      if ($q["mailquota"] > 0) {
27
+	$mailstring = "<br />(davon {$q["mailquota"]} MB für Postfächer reserviert)";
28
+        $mailbar = "<div style=\"font-size: 1px; background-color: blue; height: 10px; width: {$mailwidth}px; margin: 0; padding: 0; float: left;\">&#160;</div>";
29
+      }  
30
+
31
+      $percent = round(( ($q["systemquota_used"]+$q["mailquota"]) / $q["systemquota"] ) * 100 );
32
+      $color = ( $percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green" ));
33
+      $width = 2 * min($percent, 100) - $mailwidth;
34
+     
35
+      $used_space = $q['systemquota_used'] + $q['mailquota'];
36
+      $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$used_space} MB von {$q['systemquota']} MB belegt{$mailstring}.</p> 
37
+        <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>";
38
+
26 39
 }
27 40
 $customer = get_customer_info($_SESSION['userinfo']['customerno']);
28 41
 $realname = $acc['name'] ? $acc['name'] : $customer['name'];
Browse code

Systemuser-Modul sollte überall gleich heißen

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1830 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 04/10/2010 16:41:18
Showing 1 changed files
... ...
@@ -7,6 +7,7 @@ require_once('useraccounts.php');
7 7
 require_role(ROLE_SYSTEMUSER);
8 8
 
9 9
 title("Ihr Benutzeraccount");
10
+$section = "systemuser_account";
10 11
 
11 12
 
12 13
 $shells = available_shells();
Browse code

Benutze überall title() statt output("<h3>...</h3>")

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1812 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 18/09/2010 13:35:15
Showing 1 changed files
... ...
@@ -6,11 +6,9 @@ require_once('useraccounts.php');
6 6
 
7 7
 require_role(ROLE_SYSTEMUSER);
8 8
 
9
-$title = "Benutzeraccount";
9
+title("Ihr Benutzeraccount");
10 10
 
11 11
 
12
-output("<h3>System-Benutzeraccount</h3>");
13
-
14 12
 $shells = available_shells();
15 13
 output("<p>Daten zu Ihrem Benutzeraccount:</p>");
16 14
 $acc = get_account_details($_SESSION['userinfo']['uid'], $_SESSION['userinfo']['customerno']);
Browse code

Realname auch bei Nichtkunde korrekt anzeigen

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1725 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 13/04/2010 20:46:42
Showing 1 changed files
... ...
@@ -25,7 +25,8 @@ foreach ($usedquota as $q)
25 25
   $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$q['used']} MB von {$q['quota']} MB belegt.</p> 
26 26
   <div style=\"margin: 0; padding: 0; width: 200px; border: 1px solid black;\"><div style=\"font-size: 1px; background-color: {$color}; height: 10px; width: {$width}px; margin: 0; padding: 0;\">&#160;</div></div>";
27 27
 }
28
-$realname = $acc['name'] ? $acc['name'] : $_SESSION['customerinfo']['name'];
28
+$customer = get_customer_info($_SESSION['userinfo']['customerno']);
29
+$realname = $acc['name'] ? $acc['name'] : $customer['name'];
29 30
 $quotastring = implode('', $quota);
30 31
 output("<h5>Stammdaten</h5><div style=\"margin-left: 2em;\"><p>Benutzername: <strong>{$acc['username']}</strong></p><p>Name: {$realname}</p><p>Existiert seit {$acc['erstellungsdatum']}</p><p>Verwendete Shell: {$shell}</p>");
31 32
 output("<p>".internal_link('edit', other_icon('user_edit.png', 'Bearbeiten').' Daten bearbeiten').'</p>');
Browse code

Erlaube Änderung von Name und Shell auch bei einem Nicht-Kunden

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1722 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 13/04/2010 10:34:13
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,38 @@
1
+<?php
2
+require_once('inc/base.php');
3
+require_once('inc/icons.php');
4
+
5
+require_once('useraccounts.php');
6
+
7
+require_role(ROLE_SYSTEMUSER);
8
+
9
+$title = "Benutzeraccount";
10
+
11
+
12
+output("<h3>System-Benutzeraccount</h3>");
13
+
14
+$shells = available_shells();
15
+output("<p>Daten zu Ihrem Benutzeraccount:</p>");
16
+$acc = get_account_details($_SESSION['userinfo']['uid'], $_SESSION['userinfo']['customerno']);
17
+$shell = $shells[$acc['shell']];
18
+$usedquota = get_used_quota($acc['uid']);
19
+$quota = array();
20
+foreach ($usedquota as $q)
21
+{
22
+  $percent = round(( $q["used"] / $q["quota"] ) * 100 );
23
+  $color = ( $percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green" ));
24
+  $width = 2 * min($percent, 100);
25
+  $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$q['used']} MB von {$q['quota']} MB belegt.</p> 
26
+  <div style=\"margin: 0; padding: 0; width: 200px; border: 1px solid black;\"><div style=\"font-size: 1px; background-color: {$color}; height: 10px; width: {$width}px; margin: 0; padding: 0;\">&#160;</div></div>";
27
+}
28
+$realname = $acc['name'] ? $acc['name'] : $_SESSION['customerinfo']['name'];
29
+$quotastring = implode('', $quota);
30
+output("<h5>Stammdaten</h5><div style=\"margin-left: 2em;\"><p>Benutzername: <strong>{$acc['username']}</strong></p><p>Name: {$realname}</p><p>Existiert seit {$acc['erstellungsdatum']}</p><p>Verwendete Shell: {$shell}</p>");
31
+output("<p>".internal_link('edit', other_icon('user_edit.png', 'Bearbeiten').' Daten bearbeiten').'</p>');
32
+output("</div>\n");
33
+output("<h5>Speicherplatz</h5><div style=\"margin-left: 2em;\">{$quotastring}</div>");
34
+    
35
+output("<p><sup>*</sup>) Die Werte für den verbrauchten Speicherplatz werden periodisch eingelesen und hier erst verspätet angezeigt!</p>");
36
+
37
+
38
+?>