loginRedirect question - sending a param value to the action

2009-09-23 Thread Brian Lee
Upon login, users should redirect to /users/view_summary/. I'm getting the user_id from the Session component. I tried just concatenate or pass extra variable to $this->Auth->loginRedirect, but all my ideas have failed. Is this something we can do in cakephp? This is my AppController::beforeFilt

returning or exiting from methods of controllers

2009-05-18 Thread Brian Lee
In methods of controllers, there are usually many checks for "doing the right thing". For instance, I check if user is accessing the right data. However, I'm wondering what is the best way to return or exit from these methods when errors do occur. I've been using just simple return statement, bu

Re: Forcing user to access her data only

2009-05-18 Thread Brian Lee
never mind. I get it! Thanks! On May 18, 12:05 pm, Brian Lee wrote: > But how does this prevent user from accessing a random course? > > such as typing localhost/courses/view/123 > and hoping to see what he gets for course_id 123. > > I know that paginate would restrict wh

Re: Forcing user to access her data only

2009-05-18 Thread Brian Lee
the > courses of the current user... ex: > > $cond = array('Course.user_id' => $Current_user_id); > $this->set('courses', $this->paginate('Course', $cond)); > > Brian Lee escribió: > > > So, here is how my application works: > &g

Forcing user to access her data only

2009-05-18 Thread Brian Lee
So, here is how my application works: 1. I have users (just like any other apps) 2. I have courses that each user can create Upon login, user will view the list of courses that she created. I got that to work. However, now the problem is, I don't know the simple, neat way to block user from acc

Re: Auth->logout() doesn't logout a user?

2009-05-18 Thread Brian Lee
nvm. I found what I did wrong. I forgot to allow 'logout'. Also, for my ACL tables, it let admin to do anything, whereas other users were limited. Problem solved :) On May 18, 6:17 am, Brian Lee wrote: > Hello, > > I have a debug code that prints out values of >

Auth->logout() doesn't logout a user?

2009-05-18 Thread Brian Lee
Hello, I have a debug code that prints out values of $this->Auth->user('id') $this->Auth->user('name') inside a controller's beforeRender(). When I login, it shows that I'm logged in as a person. However, when I logout, it shows that I'm still logged in as the person I was logged in. This only