Re: User accounts to restrict specific features

2011-03-03 Thread lebert
Thank you guys for your replies! I'll check those out

On Mar 3, 6:46 pm, Sam Bernard  wrote:
> Your application sounds simple enough that you may not need ACL- however,
> you may find ACL useful if you expand your app to have different permission
> levels for different groups.
>
> Take a look at Croogo CMS- it has the most intuitive, easy to use
> implementation of ACL in Cakephp that I've seen. If you end up using ACL,
> you might find Croogo useful in piecing it together.

-- 
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


Re: User accounts to restrict specific features

2011-03-03 Thread Sam Bernard
Your application sounds simple enough that you may not need ACL- however, 
you may find ACL useful if you expand your app to have different permission 
levels for different groups.

Take a look at Croogo CMS- it has the most intuitive, easy to use 
implementation of ACL in Cakephp that I've seen. If you end up using ACL, 
you might find Croogo useful in piecing it together.

-- 
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


Re: User accounts to restrict specific features

2011-03-03 Thread cricket
On Thu, Mar 3, 2011 at 2:35 PM, lebert  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


User accounts to restrict specific features

2011-03-03 Thread lebert
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.

My question is: what's the best option to accomplish this? My website
is running under CakePHP 1.3, and I've been looking at the ACL
tutorial, but I'm not sure if that's what I need to do this. What
about Cake's Session? Or maybe it will be easier to use "normal" PHP
code (as if I wasn't using CakePHP).

I'm not sure what way to go. I have some PHP knowledge but I've never
worked with user accounts, and I'm not sure what's the best approach
for my specific needs. Any advice would be appreciated, or link to a
good tutorial or something. The ACl tutorial in CakePHP's website is
meant to block users from accessing some pages without being logged
in, but I'm not sure that I can apply it to my functionality...

Thank you very much in advance!

-- 
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