Cakephp Classroom image

osdyui
 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87|Last
Lessons:-Core Libraries

$this->redirect(’/users/home’);
}
}
Warning: Be sure to manually add the new User id to the array passed to the login method. Otherwise
you won’t have the user id available.
Accessing the logged in user Once a user is logged in, you will often need some particular information
about the current user. You can access the currently logged in user using AuthComponent::user().
This method is static, and can be used globally after the AuthComponent has been loaded. You can access
it both as an instance method or as a static method:
// Use anywhere
AuthComponent::user(’id’)
// From inside a controller
$this->Auth->user(’id’);
Logging users out Eventually you’ll want a quick way to de-authenticate someone, and redirect them
to where they need to go. This method is also useful if you want to provide a ‘Log me out’ link inside a
members’ area of your application:
public function logout() {
$this->redirect($this->Auth->logout());
}
Logging out users that logged in with Digest or Basic auth is difficult to accomplish for all clients. Most
browsers will retain credentials for the duration they are still open. Some clients can be forced to logout
by sending a 401 status code. Changing the authentication realm is another solution that works for some
clients.
Authorization
Authorization is the process of ensuring that an identified/authenticated user is allowed to access the resources
they are requesting. If enabled AuthComponent can automatically check authorization handlers
and ensure that logged in users are allowed to access the resources they are requesting. There are several
built-in authorization handlers, and you can create custom ones for your application, or as part of a plugin.
• ActionsAuthorize Uses the AclComponent to check for permissions on an action level.
• CrudAuthorize Uses the AclComponent and action -> CRUD mappings to check permissions for
resources.
• ControllerAuthorize Calls isAuthorized() on the active controller, and uses the return
of that to authorize a user. This is often the most simple way to authorize users.

 
 
 

osdyui

Skills    Cakephp

Qualifications :-
Location :-,,,
Description:-
Explore
 

  Students (0)