aboutsummaryrefslogtreecommitdiffstats
path: root/config/sshdcond
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-05-07 17:43:09 -0300
committermarcelloc <marcellocoutinho@gmail.com>2012-05-07 17:43:09 -0300
commite65bbe0559a2c0080dd30863df6c7011c78e4be4 (patch)
treee41d42352faa8e789c26e6702016ca5a3427f895 /config/sshdcond
parentd9bb4967f4234993efab65bf22bcb60e3e621cc4 (diff)
downloadpfsense-packages-e65bbe0559a2c0080dd30863df6c7011c78e4be4.tar.gz
pfsense-packages-e65bbe0559a2c0080dd30863df6c7011c78e4be4.tar.bz2
pfsense-packages-e65bbe0559a2c0080dd30863df6c7011c78e4be4.zip
sshdcond - fix xmlrpc sync function call
Diffstat (limited to 'config/sshdcond')
-rw-r--r--config/sshdcond/sshdcond.inc21
1 files changed, 8 insertions, 13 deletions
diff --git a/config/sshdcond/sshdcond.inc b/config/sshdcond/sshdcond.inc
index 43ff9a06..cd9d8018 100644
--- a/config/sshdcond/sshdcond.inc
+++ b/config/sshdcond/sshdcond.inc
@@ -146,38 +146,33 @@ function sshdcond_custom_php_write_config(){
function sshdcond_sync_on_changes() {
global $config, $g;
+ if (is_array($config['installedpackages']['sshdcondsync']))
+ if (!$config['installedpackages']['sshdcondsync']['config'][0]['synconchanges'])
+ return;
+
log_error("[sshdcond] xmlrpc sync is starting.");
- $synconchanges = $config['installedpackages']['sshdcondsync']['config'][0]['synconchanges'];
- if(!$synconchanges)
- return;
foreach ($config['installedpackages']['sshdcondsync']['config'] as $rs ){
foreach($rs['row'] as $sh){
$sync_to_ip = $sh['ipaddress'];
$password = $sh['password'];
- if($sh['username'])
- $username = $sh['username'];
- else
- $username = 'admin';
if($password && $sync_to_ip)
- sshdcond_do_xmlrpc_sync($sync_to_ip, $username, $password);
+ sshdcond_do_xmlrpc_sync($sync_to_ip, $password);
}
}
log_error("[sshdcond] xmlrpc sync is ending.");
}
/* Do the actual XMLRPC sync */
-function sshdcond_do_xmlrpc_sync($sync_to_ip, $username, $password) {
+function sshdcond_do_xmlrpc_sync($sync_to_ip, $password) {
global $config, $g;
- if(!$username)
- return;
-
if(!$password)
return;
if(!$sync_to_ip)
return;
+ $username='admin';
$xmlrpc_sync_neighbor = $sync_to_ip;
if($config['system']['webgui']['protocol'] != "") {
$synchronizetoip = $config['system']['webgui']['protocol'];
@@ -230,7 +225,7 @@ function sshdcond_do_xmlrpc_sync($sync_to_ip, $username, $password) {
/* tell sshdcond to reload our settings on the destionation sync host. */
$method = 'pfsense.exec_php';
$execcmd = "require_once('/usr/local/pkg/sshdcond.inc');\n";
- $execcmd .= "sync_package_sshdcond();";
+ $execcmd .= "sshdcond_custom_php_write_config();";
/* assemble xmlrpc payload */
$params = array(
XML_RPC_encode($password),