With Auth, you can also get the same info with
$session->read('Auth.User.group_id') when in a view. I'd forgotten
about that.On Fri, Aug 7, 2009 at 11:44 PM, FrederickD<[email protected]> wrote: > > Thanks Brian! I realize nobody is paid. Yes there is frustration and > desperation at times. I do know how to live with it and continue to > forge ahead. > > Indeed I was treating check() incorrectly. I read the entry in > book.cakephp.org about six times until it finally sunk in. Once you > understand what is written in the manual it makes much more sense. > > I am using the Auth component. I did try your suggestion at first but > I kept getting an "Undefined property" error on that line in the > default.ctp view. I'm sure it is a timing thing and I could load user > somewhere, but ultimately reading from the session seemed to work out > for now. > > Thanks for the encouragement to keep going. I shall. I need the money. > Badly. Now on to model relationships... > > On Aug 7, 8:57 pm, brian <[email protected]> wrote: >> Nobody on this list is being paid to answer anyone's questions. We've >> all been there before where our desperate queries have gone ignored. >> Learn to live with it. In the meantime, maybe you should give this a >> read: >> >> http://catb.org/esr/faqs/smart-questions.html >> >> But back to your problem, you're treating check() incorrectly. It >> returns a boolean, not the value of the field. It returns true if the >> param has been set. If you were to use AuthComponent, you could use >> it's user() method like so" >> >> if ($this->Auth->user('group_id') == 2) >> > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
