diff options
author | Ermal <eri@pfsense.org> | 2010-12-10 19:35:59 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-12-10 19:35:59 +0000 |
commit | 4d775dd000e6efd78959fb627a28cd7aaeda744d (patch) | |
tree | 6ff50272eaeaaf5111648bb1a1de7f3175e769ad /etc/inc/xmlrpc.inc | |
parent | 602cb4b00c590e2efcd5a91ea4d7ec2d68c4034b (diff) | |
download | pfsense-4d775dd000e6efd78959fb627a28cd7aaeda744d.zip pfsense-4d775dd000e6efd78959fb627a28cd7aaeda744d.tar.gz |
Be consistent on shifting array during authentication. Also check for array to avoid strange errors.
Diffstat (limited to 'etc/inc/xmlrpc.inc')
-rw-r--r-- | etc/inc/xmlrpc.inc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/etc/inc/xmlrpc.inc b/etc/inc/xmlrpc.inc index da71538..baeb791 100644 --- a/etc/inc/xmlrpc.inc +++ b/etc/inc/xmlrpc.inc @@ -109,21 +109,30 @@ function php_value_to_xmlrpc($value, $force_array = false) { function xmlrpc_auth(&$params) { global $config; - if (!is_array($config['system']['user'])) + if (!is_array($config['system']['user'])) { + array_shift($params); + unset($params['xmlrpcauth']); return false; - if (!isset($config['system']['user'][0]['password'])) + } + if (!isset($config['system']['user'][0]['password'])) { + array_shift($params); + unset($params['xmlrpcauth']); return false; + } $localpass = $config['system']['user'][0]['password']; if(crypt($params[0], $localpass) == $localpass) { array_shift($params); + unset($params['xmlrpcauth']); return true; } else if(crypt($params['xmlrpcauth'], $localpass) == $localpass) { + array_shift($params); unset($params['xmlrpcauth']); return true; } - unset($params['xmlrpcauth']); + array_shift($params); + unset($params['xmlrpcauth']); return false; } |