Welcome Guest, Not a member yet? Register   Sign In
Preventing Logged in users from calling methods/functions of a controller directly. N00b here :oP
#6

[eluser]Bas Vermeulen[/eluser]
Ghehe, I am working way to much ;p

Ok, I hope I properly get your question now:

Let's say you have a page that shows a user profile form, your controller is called Profile and you have a method called view($user_id). This method returns the user data, loads the view et voila you got yourself this nice form. The form is submitted to the edit($user_id) method. But you want to prevent people to directly load the edit($user_id) method by browsing to profile/edit/1 ?

You should not use what I showed you earlier for this. In the edit() method you can simply do some checks to make sure it's a valid POST request. I use the form validation class for that.

If I'm completely wrong please clarify Smile


Messages In This Thread
Preventing Logged in users from calling methods/functions of a controller directly. N00b here :oP - by El Forum - 10-11-2010, 07:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB