Hello,
It is always the way that writing your problem down helps solve it.
If you do the following
PHP Code:
$auth = Zend_Auth::getInstance();
$adapter = new Zend_Auth_Adapter_Ldap($options, $username, $password);
try {
$result = $auth->authenticate($adapter);
}
catch (Zend_Auth_Adapter_Exception $e)
{
print $e;
}
$result->isValid()
This does the check and if the user is valid creates a Session with the NameSpace of Zend_Auth
All you then need to do is create a new Zend_Session object with the namespace of Zend_Auth.
I used the code below to extract the userid of the authenticated login
PHP Code:
$auth = new Zend_Session_Namespace('Zend_Auth');
### CHECK IF USER IS AUTHENTICATED ###
if (isset($auth->storage))
{
$User = $auth->storage;
}
else
{
$User = 'nobody';
}
Thanks
Madmaxious