From: <abe...@us...> - 2012-01-03 00:24:06
|
Revision: 5352 http://astlinux.svn.sourceforge.net/astlinux/?rev=5352&view=rev Author: abelbeck Date: 2012-01-03 00:24:00 +0000 (Tue, 03 Jan 2012) Log Message: ----------- web interface, Status tab, add Jabber Status section. Enabled via the Prefs tab. Modified Paths: -------------- branches/1.0/package/webinterface/altweb/admin/prefs.php branches/1.0/package/webinterface/altweb/common/status.inc branches/1.0/package/webinterface/altweb/common/version.php Modified: branches/1.0/package/webinterface/altweb/admin/prefs.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/prefs.php 2012-01-02 21:16:22 UTC (rev 5351) +++ branches/1.0/package/webinterface/altweb/admin/prefs.php 2012-01-03 00:24:00 UTC (rev 5352) @@ -1,6 +1,6 @@ <?php -// Copyright (C) 2008-2010 Lonnie Abelbeck +// Copyright (C) 2008-2012 Lonnie Abelbeck // This is free software, licensed under the GNU General Public License // version 3 as published by the Free Software Foundation; you can // redistribute it and/or modify it under the terms of the GNU @@ -11,6 +11,7 @@ // 04-20-2008, Never-ending Additions // 08-19-2008, Added CDR Log Format Menu // 08-24-2008, Added /mnt/kd/ prefs file support +// 01-02-2012, Added Show Jabber Status/Command // $myself = $_SERVER['PHP_SELF']; @@ -91,6 +92,10 @@ $value = 'status_dahdi_show_status = yes'; fwrite($fp, $value."\n"); } + if (isset($_POST['jabber_status'])) { + $value = 'status_jabber_show_status = yes'; + fwrite($fp, $value."\n"); + } if (isset($_POST['firewall_states'])) { $value = 'status_show_firewall_states = yes'; fwrite($fp, $value."\n"); @@ -137,6 +142,8 @@ fwrite($fp, $value."\n"); $value = 'status_dahdi_status_cmdstr = "'.trim($_POST['dahdi_cmd']).'"'; fwrite($fp, $value."\n"); + $value = 'status_jabber_status_cmdstr = "'.trim($_POST['jabber_cmd']).'"'; + fwrite($fp, $value."\n"); $value = 'sysdial_ext_prefix_cmdstr = "'.trim($_POST['ext_prefix']).'"'; fwrite($fp, $value."\n"); @@ -501,6 +508,15 @@ putHtml('<input type="text" size="28" maxlength="64" value="'.$value.'" name="dahdi_cmd" /></td></tr>'); putHtml('<tr class="dtrow1"><td style="text-align: right;">'); + $sel = (getPREFdef($global_prefs, 'status_jabber_show_status') === 'yes') ? ' checked="checked"' : ''; + putHtml('<input type="checkbox" value="jabber_status" name="jabber_status"'.$sel.' /></td><td colspan="5">Show Jabber Status</td></tr>'); + putHtml('<tr class="dtrow1"><td style="text-align: right;" colspan="3">Jabber Status Command:</td><td colspan="3">'); + if (($value = getPREFdef($global_prefs, 'status_jabber_status_cmdstr')) === '') { + $value = 'jabber show connections'; + } + putHtml('<input type="text" size="28" maxlength="64" value="'.$value.'" name="jabber_cmd" /></td></tr>'); + + putHtml('<tr class="dtrow1"><td style="text-align: right;">'); $sel = (getPREFdef($global_prefs, 'status_show_firewall_states') === 'yes') ? ' checked="checked"' : ''; putHtml('<input type="checkbox" value="firewall_states" name="firewall_states"'.$sel.' /></td><td colspan="5">Show Firewall States</td></tr>'); putHtml('<tr class="dtrow1"><td style="text-align: right;" colspan="2">Hide SRC Ports:</td><td colspan="4">'); Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2012-01-02 21:16:22 UTC (rev 5351) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2012-01-03 00:24:00 UTC (rev 5352) @@ -1,6 +1,6 @@ <?php -// Copyright (C) 2008-2011 Lonnie Abelbeck +// Copyright (C) 2008-2012 Lonnie Abelbeck // This is free software, licensed under the GNU General Public License // version 3 as published by the Free Software Foundation; you can // redistribute it and/or modify it under the terms of the GNU @@ -24,6 +24,7 @@ // 11-06-2009, Added Reboot Scheduled notice // 05-05-2011, Added DAHDI Status and Hardware Monitoring sections // 08-10-2011, Added APC UPS Status +// 01-02-2012, Added Jabber Status // // System location of OpenVPN Client logfile $OVPNCLOGFILE = '/var/log/openvpnclient-status.log'; @@ -889,6 +890,27 @@ @unlink($tmpfile); putHtml("</pre>"); } + + if ($status == 0 && getPREFdef($global_prefs, 'status_jabber_show_status') === 'yes') { + if (($cmd = getPREFdef($global_prefs, 'status_jabber_status_cmdstr')) === '') { + $cmd = 'jabber show connections'; + } + putHtml("<h2>Jabber Status:</h2>"); + putHtml("<pre>"); + $tmpfile = tempnam("/tmp", "PHP_"); + asteriskCMD($cmd, $tmpfile); + $ph = @fopen($tmpfile, "r"); + while (! feof($ph)) { + if ($line = trim(fgets($ph, 1024))) { + if (strncasecmp($line, 'verbosity ', 10)) { + putText($line); + } + } + } + fclose($ph); + @unlink($tmpfile); + putHtml("</pre>"); + } } if (is_file($CONNTRACK)) { Modified: branches/1.0/package/webinterface/altweb/common/version.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/version.php 2012-01-02 21:16:22 UTC (rev 5351) +++ branches/1.0/package/webinterface/altweb/common/version.php 2012-01-03 00:24:00 UTC (rev 5352) @@ -1,6 +1,6 @@ <?php // version.php for AstLinux Alternate Web Interface -$GUI_VERSION = '1.8.04'; +$GUI_VERSION = '1.8.05'; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |