From d1e94cb5821e6bb5d5e3d05e2e5c47ec81b87730 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 11 Aug 2015 13:28:01 +0200 Subject: sshdcond.inc - fix sshdcond_sync_on_changes() logic take two --- config/sshdcond/sshdcond.inc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'config/sshdcond') diff --git a/config/sshdcond/sshdcond.inc b/config/sshdcond/sshdcond.inc index d68ece7f..12af3551 100644 --- a/config/sshdcond/sshdcond.inc +++ b/config/sshdcond/sshdcond.inc @@ -117,26 +117,26 @@ function sshdcond_custom_php_write_config() { function sshdcond_sync_on_changes() { global $config, $g; + /* Basically, this package was never configured */ if (!is_array($config['installedpackages']['sshdcondsync'])) { - /* Basically, this package was never configured */ return; - } elseif (!$config['installedpackages']['sshdcondsync']['config'][0]['synconchanges']) { - /* Package is configured but XMLRPC sync is disabled */ + } + /* Package is configured but XMLRPC sync is disabled */ + if (!isset($config['installedpackages']['sshdcondsync']['config'][0]['synconchanges'])) { return; - } else { - /* Do XMLRPC sync */ - log_error("[sshdcond] xmlrpc sync is starting."); - foreach ($config['installedpackages']['sshdcondsync']['config'] as $rs) { - foreach($rs['row'] as $sh) { - $sync_to_ip = $sh['ipaddress']; - $password = $sh['password']; - if ($password && $sync_to_ip) { - sshdcond_do_xmlrpc_sync($sync_to_ip, $password); - } + } + /* Do XMLRPC sync */ + log_error("[sshdcond] xmlrpc sync is starting."); + foreach ($config['installedpackages']['sshdcondsync']['config'] as $rs) { + foreach($rs['row'] as $sh) { + $sync_to_ip = $sh['ipaddress']; + $password = $sh['password']; + if ($password && $sync_to_ip) { + sshdcond_do_xmlrpc_sync($sync_to_ip, $password); } } - log_error("[sshdcond] xmlrpc sync is ending."); } + log_error("[sshdcond] xmlrpc sync is ending."); } /* Do the actual XMLRPC sync. */ -- cgit v1.2.3