I'm building a little application that displays a publically viewable
resume but I want to protect the add/edit/delete methods for a given
controller. It's a dead simple app for a single user and the whole Acl
bit would be serious overkill.
The Security component seemed to fit the bill so I did the following
in one of my controllers as a test:
function beforeFilter() {
$this->Security->loginOptions = array(
'type'=>'basic',
'realm'=>'Authentication Required'
);
$this->Security->loginUsers = array(
'user'=>'sekrit'
);
$this->Security->requireLogin('edit');
}
This code came directly from The Book(http://book.cakephp.org/view/
1309/Basic-HTTP-Authentication)
As expected a login box will pop up when I go to that page.
Unfortunately, when I put in the proper credentials it just pops up
the authentication dialog again. If I hit cancel, it goes to the white
page (the black hole I'm assuming).
Any ideas on why it isn't working? Is there a better way to go about
this?
Thanks!
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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en