Setting HTTP 401 header from a component.
Hi All, Whats the right way to set a 401 header ? Im currently using if (empty($_SERVER['PHP_AUTH_DIGEST'])) { $this-controller-header('HTTP/1.1 401 Unauthorized'); $this-controller-header('WWW-Authenticate: Digest realm='.$realm.',qop=auth,nonce='.$realm.',opaque='.$realm.''); return $this-setStatus(ERRDIGEST); } Which fills my debug.log with 2013-07-06 14:09:46 Notice: Notice (8): Undefined offset: 1 in [/opt/hd-1983/lib/Cake/Network/CakeResponse.php, line 526] Trace: CakeResponse::header() - CORE/Cake/Network/CakeResponse.php, line 526 Controller::header() - CORE/Cake/Controller/Controller.php, line 821 [snip...] Cakephp : 2.2.3 Thanks. Cheers Richard -- 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.
Securing a controller - best practice ?
Hi Bakers, First off let me say cake rocks. I've been baking for about 2 weeks now and I'm loving it. I've got a best practice question for y'all. Whats the _best_ way to secure my controller's public actions such that I can requestAction on them form other controllers but prevent users from calling those public actions directly (via URLs) ? Thanks. Cheers r --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Securing a controller - best practice ?
On 3/26/07, Samuel DeVore [EMAIL PROTECTED] wrote: look at this thread http://groups.google.com/group/cake-php/browse_thread/thread/9b3106780fb861ec/9b2bd7e3c3597f8f?lnk=gstq=requestAction+controllerrnum=35#9b2bd7e3c3597f8f if($this-params['requested'] === true){ //do your thing here } Awesome ! Thanks. Cheers r --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---