Hi,
I'm trying to write an php-application, that authenticates itself against ebox LDAP. For some reasons it doesn't authenticate. The same server's virtual host serves also another website on which Joomla runs. On that Joomla installation users can authenticate themselves.
As a newbie - I looked also the examples that are available on different sites, but nothing happens.
in the system log I can find only:
Jun 30 14:18:01 fw1 slapd[30928]: connection_read(35): no connection!
Jun 30 14:18:01 fw1 slapd[30928]: connection_read(35): no connection!
Jun 30 14:20:01 fw1 CRON[1299]: (root) CMD (/usr/share/ebox/ebox-cronjob-runner >> /dev/null 2>&1)
Jun 30 14:20:01 fw1 CRON[1300]: (root) CMD (/usr/share/ebox-usersandgroups/slave-sync)
Jun 30 14:20:09 fw1 slapd[30928]: connection_read(37): no connection!
Can anybody tell - is something not configured yet? php5-ldap is installed...
the php-code itself:
function authorize($usr,$pwd) {
$ldap['user'] = $usr;
$ldap['pass'] = $pwd;
$ldap['host'] = '127.0.0.1';
$ldap['port'] = '389';
$ldap['dn'] = 'ou=Users,dc=fw1,dc=nec,dc=eu';
$ldap['base'] = 'dc=fw1,dc=nec,dc=eu';
// connecting to ldap
$ldap['conn'] = ldap_connect( $ldap['host'], $ldap['port'] )
or die( "Could not connect to {$ldap['host']}" );
$ldap['conn'] = ldap_connect( $ldap['host'], $ldap['port'] );
$ldap['bind'] = ldap_bind( $ldap['conn'],"cn=".$ldap['user'].",". $ldap['dn'], $ldap['pass']);
if( !$ldap['bind']){
echo 'did not connect';
return FALSE;
exit;
} else {
echo ' connected';
ldap_unbind($ldap['conn']);
return TRUE;
}
return FALSE;
}
bests
Hannes