From 0ce726624dc1fbc4998ca85d79b27d810d88d5fb Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 2 Aug 2010 17:17:46 -0400 Subject: Optionally sync users and groups via xmlrpc. Fixes #650 --- etc/rc.filter_synchronize | 5 +++++ usr/local/pkg/carp_settings.xml | 7 +++++++ usr/local/www/xmlrpc.php | 1 + 3 files changed, 13 insertions(+) diff --git a/etc/rc.filter_synchronize b/etc/rc.filter_synchronize index 0a6cdb8..ded772c 100755 --- a/etc/rc.filter_synchronize +++ b/etc/rc.filter_synchronize @@ -168,6 +168,7 @@ function carp_sync_xml($url, $password, $sections, $port = 80, $method = 'pfsens case 'cert': case 'ca': case 'user': + case 'group': $xml['system'][$section] = $config_copy['system'][$section]; break; default: @@ -270,6 +271,10 @@ if (is_array($config['installedpackages']['carpsettings']['config'])) { $mergesections[] = 'cert'; $mergesections[] = 'ca'; } + if ($carp['synchronizeusers'] != "") { + $mergesections[] = 'user'; + $mergesections[] = 'group'; + } if ($carp['synchronizednsforwarder'] != "" and is_array($config['dnsmasq'])) $sections[] = 'dnsmasq'; if ($carp['synchronizeschedules'] != "" and is_array($config['schedules'])) diff --git a/usr/local/pkg/carp_settings.xml b/usr/local/pkg/carp_settings.xml index 97aee7a..0ebe98d 100644 --- a/usr/local/pkg/carp_settings.xml +++ b/usr/local/pkg/carp_settings.xml @@ -77,6 +77,12 @@ + Synchronize Users and Groups + synchronizeusers + When this option is enabled, this system will automatically sync the users and groups over to the other CARP host when changes are made. + checkbox + + Synchronize rules synchronizerules When this option is enabled, this system will automatically sync the firewall rules to the other CARP host when changes are made.. @@ -192,3 +198,4 @@ filter_configure(); + \ No newline at end of file diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php index bb0559c..5daa29a 100755 --- a/usr/local/www/xmlrpc.php +++ b/usr/local/www/xmlrpc.php @@ -230,6 +230,7 @@ function filter_configure_xmlrpc($raw_params) { openvpn_resync_all(); services_dhcpd_configure(); services_dnsmasq_configure(); + local_sync_accounts(); return $xmlrpc_g['return']['true']; } -- cgit v1.1