Re: Setting a variable for beforeFilter to catch?

2006-11-09 Thread themanfrombucharest
If I understood your explanation right then this is what happens: the beforeFilter() method gets called before your action method so $this->locked isn't set yet! you could try to have a special class var for your controller that stores the locked actions: class EntriesController extends AppContro

Re: Setting a variable for beforeFilter to catch?

2006-11-09 Thread Bert Van den Brande
I think defining locked as a class instance var inside AppController should solve the warning ? On 11/9/06, Ismael S. Kafeltz <[EMAIL PROTECTED]> wrote: > > Cypher, i think you are right. This should work. > > I guess the problem is that you are *extends* the wrong class. > Did you alter the /lib

Re: Setting a variable for beforeFilter to catch?

2006-11-09 Thread Ismael S. Kafeltz
Cypher, i think you are right. This should work. I guess the problem is that you are *extends* the wrong class. Did you alter the /libs/controllers/app_control.php file? Or you created a new one in another place? --~--~-~--~~~---~--~~ You received this message b

Re: Setting a variable for beforeFilter to catch?

2006-11-08 Thread cypher543
Sorry if I wasn't clear on what I wanted... $this->locked is defined so that I can use it in beforeFilter to check if an action is supposed to be accessible by guests or admins. If beforeFilter sees that $this->locked is true, then it will later check if the admin session is created (which I have

Re: Setting a variable for beforeFilter to catch?

2006-11-08 Thread francky06l
You should store your variable "lock" into the Session Object (ei : Session->write(), Session->check or read ). When reading just check the existence of the variable and it's value (in beforeFilter)... On Nov 8, 11:14 pm, "cypher543" <[EMAIL PROTECTED]> wrote: > I have a one-user blog, so I don't

Setting a variable for beforeFilter to catch?

2006-11-08 Thread cypher543
I have a one-user blog, so I don't have a big fancy authentication scheme. What I want to do is "lock" certain actions so that they are only visible if my session is set. Here's what I did... (without the session checks done) In app_controller.php, I defined the beforeFilter() function: locked)