[vhffs-dev] [1134] external public stats

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1134
Author:   gradator
Date:     2008-01-20 05:22:58 +0000 (Sun, 20 Jan 2008)

Log Message:
-----------
external public stats

Modified Paths:
--------------
    trunk/vhffs-public/Makefile.am

Added Paths:
-----------
    trunk/vhffs-public/extern/stats.pl


Modified: trunk/vhffs-public/Makefile.am
===================================================================
--- trunk/vhffs-public/Makefile.am	2008-01-20 03:08:19 UTC (rev 1133)
+++ trunk/vhffs-public/Makefile.am	2008-01-20 05:22:58 UTC (rev 1134)
@@ -15,7 +15,8 @@
 	usersearch.pl \
 	websitesearch.pl \
 	extern/newgroupsrss.pl \
-	extern/newusersrss.pl
+	extern/newusersrss.pl \
+	extern/stats.pl
 
 # Define the substitution we need to point perl script at correct location
 do_sed = $(SED) --in-place \

Added: trunk/vhffs-public/extern/stats.pl
===================================================================
--- trunk/vhffs-public/extern/stats.pl	                        (rev 0)
+++ trunk/vhffs-public/extern/stats.pl	2008-01-20 05:22:58 UTC (rev 1134)
@@ -0,0 +1,117 @@
+#!%PERL% -w 
+# Copyright (c) vhffs project and its contributors
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without 
+# modification, are permitted provided that the following conditions 
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright 
+#   notice, this list of conditions and the following disclaimer.
+#2. Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in 
+#   the documentation and/or other materials provided with the 
+#   distribution.
+#3. Neither the name of vhffs nor the names of its contributors 
+#   may be used to endorse or promote products derived from this 
+#   software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
+#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
+#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
+#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+# POSSIBILITY OF SUCH DAMAGE.
+
+
+use utf8;
+use POSIX qw(locale_h);
+use strict;
+
+use lib '%VHFFS_LIB_DIR%';
+use Vhffs::User;
+use Vhffs::Group;
+use Vhffs::Main;
+use Vhffs::Panel::Main;
+use Vhffs::Panel::Menu;
+use Vhffs::Stats;
+use Vhffs::Constants;
+
+my $vhffs = init Vhffs::Main;
+exit 1 unless defined $vhffs;
+
+my $stats = new Vhffs::Stats( $vhffs );
+exit 1 unless defined $stats;
+
+my $output = '';
+
+$output .= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
+$output .= '<stats>'."\n";
+
+$output .= '<users>'."\n";
+$output .= '  <total>'.$stats->get_user_total.'</total>'."\n";
+$output .= '</users>'."\n";
+
+$output .= '<groups>'."\n";
+$output .= '  <total>'.$stats->get_groups_total.'</total>'."\n";
+$output .= '  <activated>'.$stats->get_groups_activated.'</activated>'."\n";
+$output .= '</groups>'."\n";
+
+$output .= '<service name="web">'."\n";
+$output .= '  <awaitingmoderation>'.$stats->get_web_in_moderation.'</awaitingmoderation>'."\n";
+$output .= '  <activated>'.$stats->get_web_activated.'</activated>'."\n";
+$output .= '</service>'."\n";
+
+$output .= '<service name="mysql">'."\n";
+$output .= '  <awaitingmoderation>'.$stats->get_mysql_in_moderation.'</awaitingmoderation>'."\n";
+$output .= '  <activated>'.$stats->get_mysql_activated.'</activated>'."\n";
+$output .= '</service>'."\n";
+
+$output .= '<service name="pgsql">'."\n";
+$output .= '  <awaitingmoderation>'.$stats->get_pgsql_in_moderation.'</awaitingmoderation>'."\n";
+$output .= '  <activated>'.$stats->get_pgsql_activated.'</activated>'."\n";
+$output .= '</service>'."\n";
+
+$output .= '<service name="cvs">'."\n";
+$output .= '  <awaitingmoderation>'.$stats->get_cvs_in_moderation.'</awaitingmoderation>'."\n";
+$output .= '  <activated>'.$stats->get_cvs_activated.'</activated>'."\n";
+$output .= '</service>'."\n";
+
+$output .= '<service name="svn">'."\n";
+$output .= '  <awaitingmoderation>'.$stats->get_svn_in_moderation.'</awaitingmoderation>'."\n";
+$output .= '  <activated>'.$stats->get_svn_activated.'</activated>'."\n";
+$output .= '</service>'."\n";
+
+$output .= '<service name="git">'."\n";
+$output .= '  <awaitingmoderation>'.$stats->get_git_in_moderation.'</awaitingmoderation>'."\n";
+$output .= '  <activated>'.$stats->get_git_activated.'</activated>'."\n";
+$output .= '</service>'."\n";
+
+$output .= '<service name="mail">'."\n";
+$output .= '  <awaitingmoderation>'.$stats->get_mail_in_moderation.'</awaitingmoderation>'."\n";
+$output .= '  <activated>'.$stats->get_mail_activated.'</activated>'."\n";
+$output .= '  <boxes>'.$stats->get_mail_total_boxes.'</boxes>'."\n";
+$output .= '  <forwards>'.$stats->get_mail_total_forwards.'</forwards>'."\n";
+$output .= '</service>'."\n";
+
+$output .= '<service name="mailinglist">'."\n";
+$output .= '  <total>'.$stats->get_lists_total.'</total>'."\n";
+$output .= '  <activated>'.$stats->get_lists_activated.'</activated>'."\n";
+$output .= '  <subscriptions>'.$stats->get_lists_totalsubs.'</subscriptions>'."\n";
+$output .= '</service>'."\n";
+
+$output .= '<service name="dns">'."\n";
+$output .= '  <awaitingmoderation>'.$stats->get_dns_in_moderation.'</awaitingmoderation>'."\n";
+$output .= '  <activated>'.$stats->get_dns_activated.'</activated>'."\n";
+$output .= '</service>'."\n";
+
+$output .= '</stats>'."\n";
+
+binmode STDOUT , ':utf8';
+print "Content-Type: text/xml; charset=utf-8\n\n" . $output;


Property changes on: trunk/vhffs-public/extern/stats.pl
___________________________________________________________________
Name: svn:executable
   + *


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/