Add check in ldapConnect() for presence of ldap_functions per bug# 880672

This commit is contained in:
Miles Lott 2004-01-21 13:55:22 +00:00
parent 1e48ae5590
commit cae90732c6

View File

@ -201,7 +201,8 @@
$supportedLanguages = $this->getInstalledLanguages();
// find usersupported language
while (list($key,$value) = each($userLanguages))
// while (list($key,$value) = each($userLanguages))
foreach($userLanguages as $key => $value)
{
// remove everything behind '-' example: de-de
$value = trim($value);
@ -234,6 +235,19 @@
*/
function ldapConnect($host='', $dn='', $passwd='')
{
if(!function_exists('ldap_connect'))
{
/* log does not exist in setup(, yet) */
if(is_object($GLOBALS['phpgw']->log))
{
$GLOBALS['phpgw']->log->message('F-Abort, LDAP support unavailable');
$GLOBALS['phpgw']->log->commit();
}
printf('<b>Error: LDAP support unavailable</b><br>',$host);
return False;
}
if(!$host)
{
$host = $GLOBALS['phpgw_info']['server']['ldap_host'];
@ -271,7 +285,7 @@
}
}
// bind as admin, we not to able to do everything
// bind as admin
if(!ldap_bind($ds,$dn,$passwd))
{
if(is_object($GLOBALS['phpgw']->log))