We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Username and captcha | Forum

Nirmalya Ghosh
Nirmalya Ghosh Nov 10 '12
Hello developers,

I just wanted to know if there is any way to disable the "username" and "captcha" fields from the sign up form.

My users complain that the captcha field does not work fine. Sometimes it works fine but sometime it doesn't.

And I want the username to be generated automatically so that the users don't have to choose any username.

Alia Team
Alia Nov 12 '12
Nirmalya, 

1. Automatically generated usernames - this requires custom code modification.
2. Disabling captcha- you can disable by editing join.php file  ( ow_systemplugins/base/controllers).
Nirmalya Ghosh
Nirmalya Ghosh Nov 12 '12
Can you please elaborate how to disable the captcha?

And will my users be able to sign up without using it? Meaning will disabling captcha do any harm to my users' signing up process?


Nirmalya Ghosh
Nirmalya Ghosh Nov 12 '12
how can i disable the captcha?
Nirmalya Ghosh
Nirmalya Ghosh Nov 13 '12
can i know how to disable the captcha?


Purusothaman Ramanujam
Comment out the captcha element in the code.
Nirmalya Ghosh
Nirmalya Ghosh Nov 13 '12
Do i need to make any change in this part only?


$captchaField = new CaptchaField('captchaField');
        $this->addElement($captchaField);
        $controller->assign('display_photo', $displayPhoto);        $controller->assign('display_terms_of_use', $displayTermsOfUse);
        if ( OW::getRequest()->isPost() )        {            $captchaField->setValue(null);
            if ( isset($userPhoto) && isset($_FILES[$userPhoto->getName()]['name']) )            {                $_POST[$userPhoto->getName()] = $_FILES[$userPhoto->getName()]['name'];            }        }

Alia Team
Alia Nov 14 '12
Nirmalya, you will need to do changes in this part of the code and also in join_index.html (ow_systemplugins/base/view/controllers).

Please note that you will need to redo those changes once more, if you update the software.
Alia Team
Alia Nov 14 '12
Topic was moved from General Questions.
Jochen
Jochen Nov 15 '12
Hi Aliia, thanks for your reply, I will try to disable it today, best regards, Jochen
Nirmalya Ghosh
Nirmalya Ghosh Nov 16 '12
Aliia,

Can you please define in details how can we actually do this?

I tried but when I did it, I got a blank login page.

Nirmalya Ghosh
Nirmalya Ghosh Nov 18 '12
Can anyone please tell me in details how can I disable the captcha please?
Alia Team
Alia Nov 20 '12
1. Disable CAPTCHA in .php code

Note: make a copy of the join.php file before you start editing and save the copy, for example on your desktop. In case of any issues use saved copy to reverse incorrect changes.


Go to ow_systemplugin/base/controllers →find join.php file → open this file in an editor you are comfortable with → find following piece of code:


 $this->setEnctype('multipart/form-data');

$captchaField = new CaptchaField('captchaField');

$this->addElement($captchaField);

$controller->assign('display_photo', $displayPhoto);

$controller->assign('display_terms_of_use', $displayTermsOfUse);

if ( OW::getRequest()->isPost() )

{

$captchaField->setValue(null);

if ( isset($userPhoto) && isset($_FILES[$userPhoto->getName()]['name']) )

{

$_POST[$userPhoto->getName()] = $_FILES[$userPhoto->getName()]['name'];

}

}


Comment out or delete bellow lines that are related to CAPTCHA. You can comment the code out using /* code that needs to be commented out here */ :


- /*$captchaField = new CaptchaField('captchaField'); $this->addElement($captchaField);*/

- /*{ $captchaField->setValue(null);*/

- /*}*/


If you are commenting out the code, you will get following as a result:


Save edited file. Now all you need to do is to remove CAPTCHA block from .html files.


2. Disable CAPTCHA in .html files


 Note: make a copy of the join_index.html file before you start editing and save the copy, for example on your desktop. In case of any issues use saved copy to reverse incorrect changes.


Go to ow_systemplugins/base/views/controllers →find join_index.html→open this file in editor you are comfortable with →find following piece of code:


<tr><th colspan="3">{text key="base+questions_section_captcha_label"}</th></tr>

<tr class="{cycle name=captchaField values='ow_alt1,ow_alt2'}" >

<td colspan="3" class="ow_center">

<div style='padding:10px;'>

{input name='captchaField'}

<div style="height:1px;"></div>

{error name='captchaField'}

</div>

</td>

</tr>


Comment the code above using {* code here *} or delete it. Here is how the code will look like if you are commenting it out:


{* <tr><th colspan="3">{text key="base+questions_section_captcha_label"}</th></tr>

<tr class="{cycle name=captchaField values='ow_alt1,ow_alt2'}" >

<td colspan="3" class="ow_center">

<div style='padding:10px;'>

{input name='captchaField'}

<div style="height:1px;"></div>

{error name='captchaField'}

</div>

</td>

</tr> *}


Save edited file and check whether changes were applied on your site.

Note: Please remove CAPTCHA code BOTH from join.php and join_index.html files. Editing only one of those files will cause errors on your site


IF YOU UPDATE THE SOFTWARE ALL CHANGES WILL BE LOST AND YOU WILL HAVE TO DO THEM ONCE MORE.

Nirmalya Ghosh
Nirmalya Ghosh Nov 20 '12
Hello Aliia,

Everything becomes unclickable.

Meaning, you can't click on the username, email, password, etc (on the join form) to edit them and to join.

Alia Team
Alia Nov 20 '12
Nirmalya, use your original files ( saved before you started editing) to reverse the changes. Most likely that you did something wrong along the way. Unfortunately there is nothing I can help you with in this situation, since i can only direct you where custom code modification needs to be done,  and it is up to you to deal with further issues. Please note that given instructions work on standard oxwall installation.
Ted
Ted Feb 5 '13

give for me 


Error 500

Internal Server Error.


$this->setEnctype('multipart/form-data'); /*$captchaField = new CaptchaField('captchaField'); $this->addElement($captchaField);*/ $controller->assign('display_photo', $displayPhoto); $controller->assign('display_terms_of_use', $displayTermsOfUse); if ( OW::getRequest()->isPost() ) /*{ $captchaField->setValue(null);*/ if ( isset($userPhoto) && isset($_FILES[$userPhoto->getName()]['name']) ) { $_POST[$userPhoto->getName()] = $_FILES[$userPhoto->getName()]['name']; } /*}*/ }


and


{text key="base+questions_section_captcha_label"}

{input name='captchaField'} {error name='captchaField'}










Michael I.
Michael I. Feb 8 '13
Ted, you should be informed that all changes you make in your code files may cause issues since different users have different setups, servers, mods, etc. So you are either missing something or your files were modified earlier.
Ted
Ted Feb 8 '13

Michael I., thank you

i will try agane

Ronald
Ronald Oct 22 '13
I get This:



TypeError: Cannot call method 'focus' of null


How do I fix it?

Daisy Team
Daisy Oct 23 '13
Ronald, could you please specify what changes exactly you've done? Where does this error message appear? Please provide me with more details.
Pages: 1 2 »