I want to make action requests more secure by implementing the Restricting
HTTP methods { requirePost(),requireGet(), requirePut(), requireDelete()}
but running into a bit of an issue.


For an add request for example via ajax I have to fetch the form (get) and
load it into the colorbox, and save the input gets sent as post. So the add
method invokes 2 separate HTTP methods.


Other than break the public function add() into 2 separate functions such as



public function load() // fetch the form via get 


and then 
public function save()// post to save the data


Is there another way to accomplish this without having to break up the
function?


I currently have:


public function save(){


                //load the form

                if($this->request->is('ajax') && $this->request->is('get'))
{

                                .

                }

 

                //save the form

                if (!empty($this->request->data) &&
$this->request->is('post')) {

                                ..

                }


}


 

Any ideas anyone the best way to handle this?

Thanks,

 

Dave

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to