From d064a115350a7460265cad5d4c50b5a5fcc91cfd Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 7 Dec 2010 11:32:16 +0000 Subject: Tighten checks a bit also when check_firmware_version is called return the config version too. --- etc/inc/xmlrpc.inc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'etc/inc/xmlrpc.inc') 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 +?> -- cgit v1.1