Controller/Plugin/Auth.php
\Conjoon_Controller_Plugin_Auth
A plugin that checks if a user is currently logged in before a dispatch is being made.
If the user is not logged in, the plugin will alter teh request to redirect to the login process. The plugin does also take the current format of the request being made into account.
- Parent(s)
- \Zend_Controller_Plugin_Abstract
- Author
- Thorsten Suckow-Homberg
- Category
- Plugins
- Uses
- \Zend_Controller_Plugin_Abstract
Properties
Methods

__construct(
\Zend_Auth $auth
)
:
voidConstructor.
| Name | Type | Description |
|---|---|---|
| $auth | \Zend_Auth | The authentication-object to use for authentication checks |

dispatchLoopStartup(
\Zend_Controller_Request_Abstract $request
)
:
voidCalled before teh disptach loop gets processed.
This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (via {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}), the current action may be skipped.
The method checks for an authenticated user. It does also compare the authToken property of teh user with the auth_token field in the db - if the authToken is set in the db and does not equal to the authToken in the session, then it is assumed that another user has signed in with the same credentials, and the user's current session will be invalidated.
| Name | Type | Description |
|---|---|---|
| $request | \Zend_Controller_Request_Abstract |