What if the img src was generated inside the controller by a captcha
component?

So in the action function for whatever controller is using this you
have something like:

$this->set('captcha_src', $this->Captcha->getSrc() );

Then in your view, you do:

<img src="<?php echo $captcha_src; ?>" />

Another option would be to create a view helper that generates this
same captcha element, so you would put this in your view:

<?php echo $captcha->getImg(); ?>

This last use might be considered more in line with the MVC pattern.

-Aran

On Apr 16, 4:57 pm, ReiToei <[EMAIL PROTECTED]> wrote:
> Hi,
> I have been able to implement stephanoff's captcha component as 
> per:http://bakery.cakephp.org/articles/view/integrate-cakephp-with-kcaptcha
>
> I have a User component, with a captcha action that renders the
> graphic, so in my view I just have:
>
> <img src="<?php echo $html->url('/users/captcha'); ?>" />
>
> It works fine, but my problem is anyone can access the action via
> mysite.com/users/captcha. I don't want people to be able to access it
> via a URI, I only want it to be available internally, that is, if
> called from a view.
>
> I know about making functions private by adding an underscore and I've
> also read into beforeFilter stuff too. I feel like I'm halfway there
> but just need a final push in the right direction. Would really
> appreciate it if anyone could help.
>
> Thanks,
> Rei
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to