From e79618a502471431d490e5416f9c84141a73c60d Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 22 Aug 2012 12:37:44 +0545 Subject: Update Ipguard Sync page title Make it say Ipguard - Sync when navigating to the Sync tab. --- config/ipguard/ipguard_sync.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ipguard/ipguard_sync.xml b/config/ipguard/ipguard_sync.xml index 645ba413..0b5ffecb 100755 --- a/config/ipguard/ipguard_sync.xml +++ b/config/ipguard/ipguard_sync.xml @@ -43,7 +43,7 @@ Currently there are no FAQ items provided. ipguardsync 1.0 - SSH Conditional - Sync + Ipguard - Sync /usr/local/pkg/ipguard.inc -- cgit v1.2.3 From 88dc86b81ec08aaca38dd4f8a7c4f46c8ecf5502 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 22 Aug 2012 12:39:24 +0545 Subject: Ipguard GUI minor text changes --- config/ipguard/ipguard.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/ipguard/ipguard.xml b/config/ipguard/ipguard.xml index ac096522..cafc6e4e 100644 --- a/config/ipguard/ipguard.xml +++ b/config/ipguard/ipguard.xml @@ -49,7 +49,7 @@ /usr/local/pkg/ipguard.inc Ipguard - Tool designed to protect LAN IP adress space by ARP spoofing + Tool designed to protect LAN IP address space by ARP spoofing
Firewall
/pkg.php?xml=ipguard.xml
@@ -57,7 +57,7 @@ ipguard ipguard.sh ipguard - Tool designed to protect LAN IP adress space by ARP spoofing. + Tool designed to protect LAN IP address space by ARP spoofing. installedpackages->package->ipguard @@ -100,11 +100,11 @@ ip - description + Description description on - This will prevent not permitted host to work properly in the specified ethernet segment.]]> + This will prevent not permitted host from working properly in the specified ethernet segment.]]> @@ -125,7 +125,7 @@ /%FILTERTEXT%/i - Ip Adress + Ip Address ip /%FILTERTEXT%/i @@ -135,12 +135,12 @@ Enable enable checkbox - Important Note: Always create rules to pfsense mac and ip address to avoid denying access to pfsense gui.]]> + Important Note: Always create rules for pfsense mac and ip address to avoid denying access to pfsense gui.]]> Interface interface - The interface ipguard server will check this mac + The interface on which ipguard server will check this mac interfaces_selection lan @@ -156,7 +156,7 @@ Mac address mac - + To include a permit rule, use mac=00:00:00:00:00:00]]> input 25 -- cgit v1.2.3 From 9c886d11858e0e82e65f4de02662b6e4c076ca51 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 22 Aug 2012 12:43:30 +0545 Subject: Fix Ipguard initial setup PHP warnings Add some checks that ipguard.sh exists - before anything is setup in the GUI it does not exist. Improve the test for doing the XMLRPC sync - it was trying to do this even if there was nothing setup at all. --- config/ipguard/ipguard.inc | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/config/ipguard/ipguard.inc b/config/ipguard/ipguard.inc index 052f6f31..1891b24b 100644 --- a/config/ipguard/ipguard.inc +++ b/config/ipguard/ipguard.inc @@ -44,7 +44,9 @@ function ipguard_custom_php_deinstall_command(){ conf_mount_rw(); stop_service('ipguard'); - chmod("/usr/local/etc/rc.d/ipguard.sh",0444); + $ipguard_sh_file = "/usr/local/etc/rc.d/ipguard.sh"; + if (is_file($ipguard_sh_file)) + chmod($ipguard_sh_file,0444); conf_mount_ro(); } @@ -60,9 +62,6 @@ function ipguard_custom_php_write_config(){ if (is_array($config['installedpackages']['ipguard']['config'])){ - // Mount Read-write - conf_mount_rw(); - // Read config $new_config=array(); foreach ($config['installedpackages']['ipguard']['config'] as $ipguard){ @@ -96,7 +95,9 @@ function ipguard_custom_php_write_config(){ else{ #remove config files stop_service('ipguard'); - chmod("/usr/local/etc/rc.d/ipguard.sh",0444); + $ipguard_sh_file = "/usr/local/etc/rc.d/ipguard.sh"; + if (is_file($ipguard_sh_file)) + chmod($ipguard_sh_file,0444); } // Mount Read-only conf_mount_ro(); @@ -109,20 +110,20 @@ function ipguard_custom_php_write_config(){ function ipguard_sync_on_changes() { global $config, $g; - if (is_array($config['installedpackages']['ipguardsync'])) - if (!$config['installedpackages']['ipguardsync']['config'][0]['synconchanges']) - return; - - log_error("[ipguard] xmlrpc sync is starting."); - foreach ($config['installedpackages']['ipguardsync']['config'] as $rs ){ - foreach($rs['row'] as $sh){ - $sync_to_ip = $sh['ipaddress']; - $password = $sh['password']; - if($password && $sync_to_ip) - ipguard_do_xmlrpc_sync($sync_to_ip, $password); + if (is_array($config['installedpackages']['ipguardsync'])) { + if ($config['installedpackages']['ipguardsync']['config'][0]['synconchanges']) { + log_error("[ipguard] xmlrpc sync is starting."); + foreach ($config['installedpackages']['ipguardsync']['config'] as $rs ){ + foreach($rs['row'] as $sh){ + $sync_to_ip = $sh['ipaddress']; + $password = $sh['password']; + if($password && $sync_to_ip) + ipguard_do_xmlrpc_sync($sync_to_ip, $password); + } } + log_error("[ipguard] xmlrpc sync is ending."); + } } - log_error("[ipguard] xmlrpc sync is ending."); } /* Do the actual XMLRPC sync */ @@ -185,7 +186,7 @@ function ipguard_do_xmlrpc_sync($sync_to_ip, $password) { log_error("ipguard XMLRPC sync successfully completed with {$url}:{$port}."); } - /* tell ipguard to reload our settings on the destionation sync host. */ + /* tell ipguard to reload our settings on the destination sync host. */ $method = 'pfsense.exec_php'; $execcmd = "require_once('/usr/local/pkg/ipguard.inc');\n"; $execcmd .= "ipguard_custom_php_write_config();"; -- cgit v1.2.3