Yii Framework Forum: Change Captcha Url - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Change Captcha Url Rate Topic: -----

#1 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,335
  • Joined: 21-February 11
  • Location:Greece

Posted 28 May 2013 - 09:54 AM

Hi Everyone

I want to change the default url of the captcha
for example on refresh captcha link I want

r=mymodule/action1/mycaptcha&refresh=1&_=8766547

Instead of default

r=mymodule/action1/captcha&refresh=1&_=8766547

How to achieve this?
Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#2 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,695
  • Joined: 04-March 10
  • Location:UK

Posted 28 May 2013 - 09:59 AM

CCaptcha::captchaAction()

Aside from that, you'll need to change the configuration of the action in the controller (and the access rules).
1

#3 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,335
  • Joined: 21-February 11
  • Location:Greece

Posted 28 May 2013 - 10:36 AM

View PostKeith, on 28 May 2013 - 09:59 AM, said:

CCaptcha::captchaAction()

Aside from that, you'll need to change the configuration of the action in the controller (and the access rules).


Keith,

I changed the widget settings like this

$this->widget('CCaptcha',array('captchaAction'=>'mycaptcha'));


Also I changed the accessRules to mycaptcha (as we have conversation in previous post :) )
Everything works ok (no broken images, refresh etc) except the submitted form.
When the validate form called then error exception occurs

The CCaptchaValidator.action "captcha" is not valid.
I can't change the validator name in CFormModel

array('verifyCode', 'captcha', 'allowEmpty' => !CCaptcha::checkRequirements()),


because the validator name is 'captcha'

Any suggestion ?
Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#4 User is offline   Kostas Apazidis (KonApaz) 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,335
  • Joined: 21-February 11
  • Location:Greece

Posted 28 May 2013 - 10:44 AM

For second time today I found the solution

I have to assign both widget and CFormModel rule validator the same setting 'captchaAction'

Keith, just became a member with triple Reputation number :)
Yii is the best php framework in the world!
It is also powerful and flexible for large scale websites
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#5 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,695
  • Joined: 04-March 10
  • Location:UK

Posted 28 May 2013 - 10:50 AM

View PostKonApaz, on 28 May 2013 - 10:44 AM, said:

Keith, just became a member with triple Reputation number :)


This is truly an honour. I'd like to take this opportunity to thank all my fans and the people who have supported me and helped me to get where I am today. ;)

Edit:
I just want to clarify that the above comment is slathered with British sarcasm, before I get lynched... :D
0

#6 User is offline   waterloomatt 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 545
  • Joined: 09-April 10

Posted 28 May 2013 - 11:20 AM

View PostKeith, on 28 May 2013 - 10:50 AM, said:

This is truly an honour. I'd like to take this opportunity to thank all my fans and the people who have supported me and helped me to get where I am today. ;)

Edit:
I just want to clarify that the above comment is slathered with British sarcasm, before I get lynched... :D


Too late, mob is on their way! Sorry pal.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users