|
|
|
| Re: New Plugin sfCaptchaGD [message #89956 is a reply to message #54790 ] |
Mon, 14 December 2009 09:50   |
Andromeda Messages: 64 Registered: July 2008 Location: Berlin, Germany |
Member |
|
|
Hey,
in the new 1.4.0 Version you forgot to include the Widget and Routing Class... could you please fix this.
I also tried to include these classes from the 1.2.0 Version but didn't work out as well.
Ben
[Updated on: Mon, 14 December 2009 14:19]
|
|
|
|
|
|
|
|
|
| Re: New Plugin sfCaptchaGD [message #91939 is a reply to message #54790 ] |
Thu, 21 January 2010 09:49   |
nowaycharlie Messages: 1 Registered: January 2010 Location: Australia |
Junior Member |
|
|
I had some problems with this plugin v1.4.1 using symfony 1.4.2-DEV.
I use a format for form field names like "myform[captcha]"
ie.
<input type="text" name="myform[captcha]" />
this hard-coded name was not working:
<input type="text" name="captcha" />
This is the file:
sfCaptchaGDPlugin\lib\widget\sfWidgetCaptchaGD.class.php
This diff fixes it using renderTag() and sf link_to/image_tag functions:
12c12
< return "<input type='text' name='captcha' value='".$context->getRequest()->getPostParameter('captcha')."' class='captcha' /> <a href='' onClick='return false' title='Reload image'><img src='$url?".time()."' onClick='this.src=\"$url?r=\" + Math.random() + \"&reload=1\"' border='0' class='captcha' /></a>";
---
> return $this->renderTag('input', array_merge(array('type' => $this->getOption('type'), 'name' => $name, 'value' => $value), $attributes)) . link_to( image_tag("$url?".time(), array('raw_name' => true, 'border' => 0, 'onClick' => "this.src=\"$url?r=\" + Math.random() + \"&reload=1\"", 'class' => 'captcha')) ,'/',"class=captcha onClick='return false' title='Reload image'");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: New Plugin sfCaptchaGD [message #99977 is a reply to message #99975 ] |
Fri, 28 May 2010 03:07   |
macgyver Messages: 13 Registered: July 2009 |
Junior Member |
|
|
Hi,
I found this problem in settings with dev mode and I think this causes the issue.
These are my parameters in config > Globals
| Quote: | env:
DOCUMENT_ROOT: /home/mysite.com/home/mysite.com/public_html
...
ORIG_PATH_TRANSLATED: /home/mysite.com/home/mysite.com/public_html/myproject/web/f rontend_dev.php/en/slug/page.html
...
PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bi n'
PATH_INFO: /en/slug/page.html
PATH_TRANSLATED: /home/mysite.com/home/mysite.com/public_html/en/slug/page.ht ml
...
SCRIPT_FILENAME: /home/mysite.com/home/mysite.com/public_html/myproject/web/f rontend_dev.php
server:
the same thing...
|
Also:
| Quote: | session:
symfony/user/sfUser/attributes: { symfony/user/sfUser/attributes: { first_request: false, captcha: '6674' } }
symfony/user/sfUser/authenticated: false
symfony/user/sfUser/credentials: { }
symfony/user/sfUser/culture: en
symfony/user/sfUser/lastRequest: 1275029813
|
Any idea?
[Updated on: Fri, 28 May 2010 09:30]
|
|
|
|
|
|
|
|
|
| Re: New Plugin sfCaptchaGD [message #100049 is a reply to message #100045 ] |
Sun, 30 May 2010 11:54   |
tomekmal Messages: 2 Registered: May 2010 |
Junior Member |
|
|
| Quote: | Yes, for well-formed XML output img content must be as you wrote.
I'll add to the next release or you can supply a patch with differences.
|
Hello, thanks for reply, i uploaded in attachment a patch for sfWidgetCaptchaGD.class.php,
of course please test it, i used i18n function in widget, and it works.
but i'm not sure if it will work on every version of SF. maybe it should be sfContext::getInstance()->getI18N()->__(...)
Greets,
Tomasz M.
|
|
|
|
|
|
| Re: New Plugin sfCaptchaGD [message #101800 is a reply to message #54790 ] |
Wed, 30 June 2010 03:46  |
raphox Messages: 8 Registered: October 2007 Location: Brazil, Campo Grande - M... |
Junior Member |
|
|
Im missing my html attribute 'class'.
I found a better solution to widget. See:
<?php
class sfWidgetCaptchaGD extends sfWidgetForm
{
protected function configure($options = array(), $attributes = array())
{
}
public function render($name, $value = null, $attributes = array(), $errors = array())
{
$context = sfContext::getInstance();
$url = $context->getRouting()->generate("sf_captchagd");
$value = $context->getRequest()->getPostParameter('captcha');
// if there exists a value for 'class'
if (isset($attributes['class'])) {
if (!strstr($attributes['class'], 'captcha')) {
$attributes['class'] = empty($attributes['class']) ? 'captcha' : trim($attributes['class']) . ' captcha';
}
} else {
$attributes['class'] = 'captcha';
}
$attributes = $attributes;
return $this->renderTag('input', array_merge(array('type' => 'text', 'name' => $name, 'value' => $value), $attributes)) . "<a href='' onClick='return false' title='Reload image'><img src='$url?".time()."' onClick='this.src=\"$url?r=\" + Math.random() + \"&reload=1\"' border='0' class='captcha' /></a>";
}
}
|
|
|