Hello, I'm trying to login with LDAP connection, in symfony 1.4. I exploded the connection variables, ldap_connect and ldap_bind and they return True, however I can not redirect the user into my system:
if ($request->isMethod('post'))
{
$this->form->bind($request->getParameter('signin'));
$login = $request->getParameter('signin_username');
$pass = $request->getParameter('signin_password');
$host = '192.168.1.xxx';
$port = 389;
$link = ldap_connect($host, $port);
$bind = @ldap_bind($link, $login, $pass);
if($link)
{
echo 'link ok ';
if($bind){
echo 'bind ok';
// $signinUrl = sfConfig::get('app_sf_guard_plugin_success_signin_url', $user->getReferer($request->getReferer()));
// return $this->redirect('' != $signinUrl ? $signinUrl : '@homepage');
header('location:@homepage');
}
else{
echo 'close ok';
ldap_close($link);
}
}