Jitu and Floyd,

you can create a controller named Admin, with just one method named
index.

This controller without any models (using var $uses = array())

So in the index view of Admin controller you will add your painel
menu.

To verify when the user is acessing a admin method (by admin route)
(like /admin/posts/add) in AppController you can check if is admin
route and if it is true you check if the user is logged. Like this:
<?
class AppController extends Controller
{
        function beforeFilter() {

            if (isset($this->params["admin"])) { // if you are
acessing any method defined as admin
                      $this->checkSession();
            }
        }
function checkSession(){
// checks if user has been logged if not redirect to login page
}
}
?>

[]'s

Tulio Faria
www.tuliofaria.net

On 8 maio, 16:53, Hellbot <[EMAIL PROTECTED]> wrote:
> I'm not sure how this fits the ideology of CakePHP :), but you can create a
> directory /admin inside the application webroot and then just use .htaccess
> & .htpasswd to password-protect the admin methods.
>
> 2007/5/8, Floyd <[EMAIL PROTECTED]>:
>
>
>
> > Ok Hellbot but this screencasts only show how to use admin routes.
> > This is not our problem, so we (and jitu i think so) want to make a
> > admin dir that colect all admin routes. In fact, I'd like to protect
> > whole dir with password HTTP (not with acl or obAuth).


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to