TAuthManager class
TAuthManager performs user authentication and authorization for a Prado application. TAuthManager works together with a IUserManager module that can be specified via the UserManager property. If an authorization fails, TAuthManager will try to redirect the client browser to a login page that is specified via the LoginPage. To login or logout a user, call login or logout, respectively.
To load TAuthManager, configure it in application configuration as follows, <module id="auth" class="System.Security.TAuthManager" UserManager="users" LoginPage="login" /> <module id="users" class="System.Security.TUserManager" />
Located in /Security/TAuthManager.php (line 37)
TComponent | --TApplicationComponent | --TModule | --TAuthManager
Performs authentication.
This is the event handler attached to application's Authentication event. Do not call this method directly.
Performs authorization.
This is the event handler attached to application's Authorization event. Do not call this method directly.
Initializes this module.
This method is required by the IModule interface.
Performs login redirect if authorization fails.
This is the event handler attached to application's EndRequest event. Do not call this method directly.
Logs in a user with username and password.
The username and password will be used to validate if login is successful. If yes, a user object will be created for the application.
Logs out a user.
User session will be destroyed after this method is called.
Performs the real authentication work.
An OnAuthenticate event will be raised if there is any handler attached to it. If the application already has a non-null user, it will return without further authentication. Otherwise, user information will be restored from session data.
Performs the real authorization work.
Authorization rules obtained from the application will be used to check if a user is allowed. If authorization fails, the response status code will be set as 401 and the application terminates.
Sets the login page that the client browser will be redirected to if login is needed.
Login page should be specified in the format of page path.
Sets the URL that the browser should be redirected to when login succeeds.
Switches to a new user.
This method will logout the current user first and login with a new one (without password.)
Inherited From TModule
TModule::getID()
TModule::init()
TModule::setID()
Inherited From TApplicationComponent
TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()
Inherited From TComponent
TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()
Documentation generated on Mon, 21 Apr 2008 11:30:38 -0400 by phpDocumentor 1.3.0RC4