On Thu, Mar 3, 2011 at 2:35 PM, lebert <albertriba...@gmail.com> wrote:
> Hello everyone,
>
> I'm making a website and I need the following feature:
>
> - The website will have a lot of pictures in slideshows that can be
> seen by anyone
> - Images will have an 'Add to favorites' button
> - If a user is registered and logged in already, when he clicks the
> 'Add to favorites' button, the current image will be stored in his
> profile in the database
> - If a user is not logged in or registered yet, when he clicks the
> 'Add to favorites' button, he will be prompted to either register or
> log in, and after completing that, the image will be added to the
> favorites section of his profile.

No need for ACL. If you're using AuthComponent this is a cinch.

In your view:

if ($this->Session->read('Auth.User.id'))
{
        // display faves button
}

In your controller, DO NOT add the faves action to the
$this->Auth->allowedActions array.

Pass the Image.id to the action and get the User.id with $this->Auth->user('id')

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to