diff options
author | Ermal <eri@pfsense.org> | 2010-12-07 11:32:16 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-12-07 11:32:16 +0000 |
commit | d064a115350a7460265cad5d4c50b5a5fcc91cfd (patch) | |
tree | 93d83be1306331ba2cb571ad6eda25ec3ee7875b /etc/inc/xmlrpc.inc | |
parent | 137f46d8939ac05856b183d81d749287f1fc40cc (diff) | |
download | pfsense-d064a115350a7460265cad5d4c50b5a5fcc91cfd.zip pfsense-d064a115350a7460265cad5d4c50b5a5fcc91cfd.tar.gz |
Tighten checks a bit also when check_firmware_version is called return the config version too.
Diffstat (limited to 'etc/inc/xmlrpc.inc')
-rw-r--r-- | etc/inc/xmlrpc.inc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/etc/inc/xmlrpc.inc b/etc/inc/xmlrpc.inc index 61167bf..da71538 100644 --- a/etc/inc/xmlrpc.inc +++ b/etc/inc/xmlrpc.inc @@ -108,16 +108,23 @@ function php_value_to_xmlrpc($value, $force_array = false) { */ function xmlrpc_auth(&$params) { global $config; + + if (!is_array($config['system']['user'])) + return false; + if (!isset($config['system']['user'][0]['password'])) + return false; + $localpass = $config['system']['user'][0]['password']; if(crypt($params[0], $localpass) == $localpass) { array_shift($params); return true; - } else if(crypt($params['xmlrpcauth'], $localpass) != $localpass) { + } else if(crypt($params['xmlrpcauth'], $localpass) == $localpass) { unset($params['xmlrpcauth']); - return false; + return true; } unset($params['xmlrpcauth']); + return false; } -?>
\ No newline at end of file +?> |