diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-10-08 22:14:17 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-10-08 22:14:17 +0000 |
commit | 785a9043a7757b92344cc6084c6bdd9588271318 (patch) | |
tree | 9da6c7fc2aa2de16c55e32b756d4ab16b9d3c20b /etc/inc/auth.inc | |
parent | c26023b4bb987d259f792f91d347f2322bd4e901 (diff) | |
download | pfsense-785a9043a7757b92344cc6084c6bdd9588271318.zip pfsense-785a9043a7757b92344cc6084c6bdd9588271318.tar.gz |
honour custom username set in webConfigurator page
Diffstat (limited to 'etc/inc/auth.inc')
-rw-r--r-- | etc/inc/auth.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index a13b815..c221010 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -61,8 +61,20 @@ function passwd_backed_basic_auth() { /* Check to see if user even exists */ $username = $HTTP_SERVER_VARS['AUTH_USER']; - if(!($line = array_shift(preg_grep("/^$username:.*$/", $authfile)))) - continue; + + /* + * auth the username + * honour custom username set in webConfigurator page */ + */ + if($config['system']['username'] == $HTTP_SERVER_VARS['AUTH_USER']) { + /* we match, don't continue to next for loop */ + } else { + /* finally, if we're here then we didn't match the username in + * the webConfigurator. Check the password file. + */ + if(!($line = array_shift(preg_grep("/^$username:.*$/", $authfile)))) + continue; + } /* Get crypted password */ preg_match("/^$username:((\\$1\\$[.\d\w_\/]{8}\\$)[.\d\w_\/]{22})$/", $line, $matches); |