forked from extern/egroupware
Add check in ldapConnect() for presence of ldap_functions per bug# 880672
This commit is contained in:
parent
1e48ae5590
commit
cae90732c6
@ -201,7 +201,8 @@
|
|||||||
$supportedLanguages = $this->getInstalledLanguages();
|
$supportedLanguages = $this->getInstalledLanguages();
|
||||||
|
|
||||||
// find usersupported language
|
// 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
|
// remove everything behind '-' example: de-de
|
||||||
$value = trim($value);
|
$value = trim($value);
|
||||||
@ -234,6 +235,19 @@
|
|||||||
*/
|
*/
|
||||||
function ldapConnect($host='', $dn='', $passwd='')
|
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)
|
if(!$host)
|
||||||
{
|
{
|
||||||
$host = $GLOBALS['phpgw_info']['server']['ldap_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(!ldap_bind($ds,$dn,$passwd))
|
||||||
{
|
{
|
||||||
if(is_object($GLOBALS['phpgw']->log))
|
if(is_object($GLOBALS['phpgw']->log))
|
||||||
|
Loading…
Reference in New Issue
Block a user