I'm working on my first phpcake application and I'm trying to create a
nice admin front-end to the database.  I'm using obAuth and I
uncommented CAKE_ADMIN from the config.  I'd like to use a different
layout for my login function in my  Users controller than the admin
front-end when you login.

I tried to browse the cake documentation but I didn't really know what
I was looking for so I didn't come up with anything.  I tried setting
$this->layout = 'admin_login'; but that didn't seem to work.

Also I was wondering how to make a page display at just "/admin" since
my user login is at /admin/users/login I'd like to play around with
some things.

class UsersController extends AppController
{
        var $components = array("obAuth");
        var $name = "Users";
        var $layout = 'admin';
        var $scaffold;

        function admin_index()
        {
                $this->obAuth->lock();
        }

        function admin_login()
        {
                $this->layout = 'admin_login';
                if(isset($this->data['User']))
                {
                        if($this->obAuth->login($this->data['User']))
                        {
                                $this->redirect('/admin');
                        }
                        $this->flash("Username/Password is incorrect", "/");
                }
        }

        function admin_logout()
        {
                $this->obAuth->lock();
                $this->obAuth->logout();
                $this->flash('You are now logged out.');
                $this->redirect('/admin/users/login');
        }
}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to