I'm using dAuth and want a login form that is accessible on all pages
on the site. Following Dieter's advice in comment 53 on
http://bakery.cakephp.org/articles/view/147 my beforeFilter() in
AppController now looks like this:

        function beforeFilter()
        {
                $error = '';
                $this->DAuth->newSalt();
                $this->set('error', $error);
                $this->set('allowcleartext', $this->DAuth->allowClearText);
        }

By using this solution I get this error message:
Fatal error: Call to a member function set() on a non-object in /
DEVELOPMENT/app/controllers/components/d_auth.php on line 350

So I changed newSalt() in the dAuthComponent to return the salt value
instead:

function newSalt()
        {
                $salt = crc32(time());
                //$this->controller->set('special_sauce',$salt);
                $this->Session->write('salt', $salt);

                return $salt;
        }

and beforeFilter() now looks like this:

        function beforeFilter()
        {
                $error = '';
                $salt = $this->DAuth->newSalt();
                $this->set('special_sauce', $salt);
                $this->set('error', $error);
                $this->set('allowcleartext', $this->DAuth->allowClearText);
        }

But by using this method I end up with a credentials mismatch error. I
can't figure out what the problem is. Any advice would be great!

//Miche


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