From: <abe...@us...> - 2012-10-27 21:32:08
|
Revision: 5721 http://astlinux.svn.sourceforge.net/astlinux/?rev=5721&view=rev Author: abelbeck Date: 2012-10-27 21:32:01 +0000 (Sat, 27 Oct 2012) Log Message: ----------- web interface, Network tab, Firewall Plugins: list is now marked as: [Active], [Enabled] and [Disabled] Modified Paths: -------------- branches/1.0/package/webinterface/altweb/admin/firewall.php branches/1.0/package/webinterface/altweb/admin/network.php branches/1.0/package/webinterface/altweb/common/functions.php branches/1.0/package/webinterface/altweb/common/version.php Modified: branches/1.0/package/webinterface/altweb/admin/firewall.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/firewall.php 2012-10-27 18:16:19 UTC (rev 5720) +++ branches/1.0/package/webinterface/altweb/admin/firewall.php 2012-10-27 21:32:01 UTC (rev 5721) @@ -544,7 +544,7 @@ foreach ($plugins as $key => $value) { if (basename($key, '.conf') === $TRAFFIC_SHAPER_PLUGIN) { $TRAFFIC_SHAPER_FILE = $key; - $TRAFFIC_SHAPER_ENABLE = $value; + $TRAFFIC_SHAPER_ENABLE = substr($value, 0, 1); break; } } Modified: branches/1.0/package/webinterface/altweb/admin/network.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/network.php 2012-10-27 18:16:19 UTC (rev 5720) +++ branches/1.0/package/webinterface/altweb/admin/network.php 2012-10-27 21:32:01 UTC (rev 5721) @@ -1279,7 +1279,7 @@ putHtml('Firewall Plugins:'); putHtml('<select name="firewall_plugin">'); foreach ($plugins as $key => $value) { - putHtml('<option value="'.$key.'">'.basename($key, '.conf').' ['.($value === '1' ? 'Enabled' : 'Disabled').']</option>'); + putHtml('<option value="'.$key.'">'.basename($key, '.conf').' ['.substr($value, 2).']</option>'); } putHtml('</select>'); putHtml('–'); Modified: branches/1.0/package/webinterface/altweb/common/functions.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/functions.php 2012-10-27 18:16:19 UTC (rev 5720) +++ branches/1.0/package/webinterface/altweb/common/functions.php 2012-10-27 21:32:01 UTC (rev 5721) @@ -238,6 +238,15 @@ if (! is_dir($dir)) { return(FALSE); } + + // Find the currently active plugins + $active = array(); + $active_file = '/var/tmp/aif_active_plugins'; + if (is_file($active_file)) { + $cmd = "sed -n -r -e 's|^.*/plugins/[0-9][0-9](.*)\\.plugin$|\\1|p' $active_file"; + @exec($cmd, $active); + } + $tmpfile = tempnam("/tmp", "PHP_"); $cmd = 'grep -m1 -H \'^ENABLED=\' '.$dir.'/*.conf |'; $cmd .= 'sed -e \'s/ENABLED=//\' -e \'s/"//g\''; @@ -248,7 +257,21 @@ if ($line = trim(fgets($ph, 1024))) { if (($pos = strpos($line, ':')) !== FALSE) { $linetokens = explode(':', $line); - $plugins[$linetokens[0]] = $linetokens[1]; + if ($linetokens[1] === '0') { + $value = '0~Disabled'; + } elseif ($linetokens[1] === '1') { + $value = '1~Enabled'; + } else { + $value = '0~Undefined'; + } + $plugin_name = basename($linetokens[0], '.conf'); + foreach ($active as $active_name) { + if ($active_name === $plugin_name) { + $value = substr($value, 0, 2).'Active'; + break; + } + } + $plugins[$linetokens[0]] = $value; } } } Modified: branches/1.0/package/webinterface/altweb/common/version.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/version.php 2012-10-27 18:16:19 UTC (rev 5720) +++ branches/1.0/package/webinterface/altweb/common/version.php 2012-10-27 21:32:01 UTC (rev 5721) @@ -1,6 +1,6 @@ <?php // version.php for AstLinux Alternate Web Interface -$GUI_VERSION = '1.8.17'; +$GUI_VERSION = '1.8.18'; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |