but let's say we deny group manager and user to have access to users
model, and the logout function is located in users controller; would
it be a good suggestion to place the logout function in posts
controller instead because it is a public page (controller)..
Is it less secure?
I couldn't find a way to access users controller since it denies group
manager and user, and therefore can't call the logout function in
there..
Regards,
Maxim
On Jan 1, 2:20 pm, Jeremy Burns | Class Outfit
<jeremybu...@classoutfit.com> wrote:
> Here's some sample code that you can place in an element and drop it in to views as and when needed:
>
> <?php
> if ($this->Session->check('Auth.User')):
> echo $this->Html->link(
> 'Log Out',
> array(
> 'controller' => 'users',
> 'action' => 'logout'
> )
> );
> else:
> echo $this->Html->link(
> 'Log In',
> array(
> 'controller' => 'users',
> 'action' => 'login'
> )
> );
> endif;
> ?>
>
> I usually include this as part of my site navigation so that it is always available. You can also add links such as 'Your Details' to the logged in piece, and 'Register' to the logged out piece.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 1 Jan 2011, at 03:17, John Maxim wrote:
>
> > Hi, thanks for the reply..
>
> > function logout() {
> > $this->Session->setFlash('Good-Bye');
> > $this->redirect($this->Auth->logout());
> > }
>
> > I created it in usersController alright. I access it by creating a
> > link to it am I correct?
>
> > I'm looking for a uniform way to put it in one single place so it can
> > be viewed 'only' after logging into users, groups, posts, and
> > widgets.
>
> > Can it be accomplished?
>
> > (1)
> > I could do this:
>
> > <p><?php echo $html->link('logout', array('action' => 'logout')); ?>
>
> > and place it on the indexes of groups, users, posts, widgets.. But I
> > would need to create addition of 3 more function logout() for each of
> > the 3 controllers.
>
> > (2)
> > But the link logout is displayed even we're not logged in. Is it we
> > need to use Access method from the views? as attempted but failed in
> > this post:
> >http://groups.google.com/group/cake-php/browse_thread/thread/478daa30...
> > I posted a solution but the Access for some reason wasn't called and
> > the links for edit and delete were never displayed regardless of
> > loggin status.
> >http://groups.google.com/group/cake-php/browse_thread/thread/8a4aa816...
>
> > Furthermore, the tutorial says it was like a 'hack' to get access
> > component working in views I wonder if there's a proper way to do this
> > without breaking MVC Cake convention.
> > The tutorial for Access to work in Views:
> >http://net.tutsplus.com/tutorials/php/how-to-use-cakephps-access-cont...
>
> > Regards,
> > Maxim
>
> > On Jan 1, 3:18 am, AD7six <andydawso...@gmail.com> wrote:
> >> On Dec 31, 3:01 pm, John Maxim <goog...@gmail.com> wrote:
>
> >>> Hi,
>
> >>> I'm right here:http://book.cakephp.org/view/1552/Logout
>
> >>> May I ask if anyone could help to point out how exactly am I to log-
> >>> out now ??
>
> >> You access the function logout which after following the tutorial you
> >> will have created in your users controller.
>
> >>> I went through some comments on that page suggested to
>
> >>> $this->Auth->allowedActions = array('logout');
>
> >> for what reason?
>
> >>> What's your suggestion?
>
> >> You could start with explaining in what way the tutorial you're
> >> following isn't working with exactly what you're doing and what you're
> >> expecting to happen
>
> >> AD
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment