peter vercauteren wrote on Wednesday 18th of May 2011:So how about the URI?
You propably would have ROOT/messages/... Should I set message/user_ID/message_ID? Isn't this a security flaw?
public function action_view($message_id)
$user = Auth::instance()->get_user_id();
$user_id = $user[1];
//Get the message from the database.
$query = Model_Message::find()->where('message_id', $message_id);
$message = $query->get_one();
//Check permission
if($message->user_id==$user_id){
// show the message.
}else{
// don't have permission so redirect them to whereever.
\\Response.Redirect('/');
}
It looks like you're new here. If you want to get involved, click one of these buttons!