From cb90b744c2841f6f2ab0dcec6bf516422db332cf Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 13 Jan 2008 23:22:31 +0000 Subject: Check that ldap_connect() exists before calling. For some reason on bootup the function does not exist but the module is loaded? --- etc/inc/auth.inc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'etc') 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']; -- cgit v1.1