4c630eb1d90ef9c268aeff3700814575bdf24ed6
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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 Added license tags for CC0,...

Bernd Wurst authored 12 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
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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) */
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

16) 
17) require_once("inc/icons.php");
18) 
19) require_once("vhosts.php");
20) 
21) require_role(ROLE_SYSTEMUSER);
22) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

23) title("Zugriffs-Statistiken");
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

24) 
Bernd Wurst warning about shutdown of t...

Bernd Wurst authored 4 years ago

25) warning('Diese Statistiken werden in Kürze abgeschafft. Wenn Sie eine solche Funktion weiterhin nutzen möchten, können Sie mit dem Programm "webalizer" selbst solche Statistiken erstellen lassen. Auf Anfrage können wir Ihnen die bestehenden Daten verfügbar machen um die rückblickenden Auswertungen zu erhalten.');
26) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

27) if (isset($_REQUEST['vhost'])) {
28)     $v = get_vhost_details($_REQUEST['vhost']);
29) 
30)     if (isset($_REQUEST['public'])) {
31)         $v['stats'] = ($_REQUEST['public'] == 1) ? 'public' : 'private';
32)     }
33)     if (isset($_REQUEST['action'])) {
34)         if ($_REQUEST['action'] == 'delete') {
35)             $v['stats'] = null;
36)         } elseif ($_REQUEST['action'] == 'new') {
37)             check_form_token('stats_new');
38)         }
39)     }
40)     save_vhost($v);
41)     redirect('stats');
42) } else {
43)     $all_vhosts = list_vhosts();
44)     $stats_vhosts = array();
45) 
46)     foreach ($all_vhosts as $v) {
47)         if ($v['stats']) {
48)             $stats_vhosts[] = $v;
49)         }
50)     }
51) 
52) 
53)     output('<p>Um die Reichweite und das Publikum Ihrer Internet-Seiten besser einschätzen zu können, besteht die Möglichkeit aus den ggf. vorhandenen Webserver-Logfiles grafisch aufbereitete Statistiken erstellen zu lassen.</p>
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

54) 
55) <h3>Statistiken für Ihre Seiten</h3>
56) ');
57) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

58)     if (count($stats_vhosts) > 0) {
59)         output('
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

60)   <table><tr><th>Für Website</th><th>Öffentlich abrufbar?</th><th>Operationen</th></tr>
61)   ');
62) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

63)         foreach ($stats_vhosts as $v) {
64)             output("<tr>");
65)             output("<td>".internal_link('showstats', $v['fqdn'], "vhost={$v['id']}")."</td>");
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

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

Hanno authored 5 years ago

67)             if ($v['stats'] == 'public') {
68)                 output("<td><a href=\"http://".config('stats_hostname')."/{$v['fqdn']}\">".icon_enabled("Diese Statistiken können von jedermann aufgerufen werden. Klicken Sie hier um die öffentliche Version zu sehen.")."</a></td>");
69)             } else {
70)                 output("<td>".icon_disabled("Diese Statistiken können nur hier im Webinterface betrachtet werden.")."</td>");
71)             }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

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

Hanno authored 5 years ago

73)             output("<td>");
74)             if ($v['stats'] == 'public') {
75)                 output(internal_link("", other_icon("lock.png", "Statistiken nicht mehr öffentlich anzeigen"), "vhost={$v['id']}&public=0"));
76)             } else {
77)                 output(internal_link("", other_icon("world.png", "Statistiken veröffentlichen"), "vhost={$v['id']}&public=1"));
78)             }
79)             output(" &#160; ".internal_link("", icon_delete("Diese Statistiken löschen"), "vhost={$v['id']}&action=delete")."</td>");
80)             output("</tr>");
81)         }
82)         output('</table>');
83)     } else {
84)         output('<em>Für Ihre Seiten werden bisher keine Statistiken erzeugt</em>');
85)     }