diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-01-13 23:22:31 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-01-13 23:22:31 +0000 |
commit | cb90b744c2841f6f2ab0dcec6bf516422db332cf (patch) | |
tree | 3b55b062bca0e21fb7e09a0d0d29eb92e51867ab /etc/inc/auth.inc | |
parent | 5ed85831cd8359ecb3ef2b82301c3ae3d08ebda6 (diff) | |
download | pfsense-cb90b744c2841f6f2ab0dcec6bf516422db332cf.zip pfsense-cb90b744c2841f6f2ab0dcec6bf516422db332cf.tar.gz |
Check that ldap_connect() exists before calling. For some reason on
bootup the function does not exist but the module is loaded?
Diffstat (limited to 'etc/inc/auth.inc')
-rw-r--r-- | etc/inc/auth.inc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 734bb2a..3cee79b 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -59,6 +59,9 @@ function logout_session() { function getAllowedGroups($logged_in_user) { global $g, $config; + + if(!function_exists("ldap_connect")) + return; $allowed = array(); $allowed_groups = array(); @@ -347,6 +350,9 @@ function isSystemAdmin($username = "") { if($_SESSION['isSystemAdmin']) return $_SESSION['isSystemAdmin']; + if(!function_exists("ldap_connect")) + return; + if($config['system']['webgui']['backend'] == "ldap") { $groups = ldap_get_groups($username); if(is_array($groups)){ @@ -673,7 +679,10 @@ function ldap_test_bind() { function ldap_get_user_ous($show_complete_ou=false) { global $config, $g; - + + if(!function_exists("ldap_connect")) + return; + $ldapserver = $config['system']['webgui']['ldapserver']; $ldapbindun = $config['system']['webgui']['ldapbindun']; $ldapbindpw = $config['system']['webgui']['ldapbindpw']; @@ -726,6 +735,9 @@ function ldap_get_user_ous($show_complete_ou=false) { function ldap_get_groups($username) { global $config; + if(!function_exists("ldap_connect")) + return; + if(!$username) return false; @@ -815,7 +827,10 @@ function ldap_backed($username, $passwd) { if(!$username) return; - + + if(!function_exists("ldap_connect")) + return; + $ldapserver = $config['system']['webgui']['ldapserver']; $ldapbindun = $config['system']['webgui']['ldapbindun']; $ldapbindpw = $config['system']['webgui']['ldapbindpw']; |