ADD CAPTCHA to Registration in 1.5.1
10 posts
• Page 1 of 1
ADD CAPTCHA to Registration in 1.5.1
Here is my first modification contribution to implement the OpenCart captcha to the registration form in 1.5.1...
SEE EXAMPLE HERE: https://www.rockmebabyclothing.com/stor ... t/register
Note: You must enter the codes below at the end of the code I am telling you to find.
(To easily find code, press control f on a pc, or command f on a mac)
------------------------------------------------------------------------------------------------------------
1st.
GO TO: catalog/view/theme/"default or your custom theme folder"/template/account/register.tpl (after newsletter code, around line 200)
*FIND THIS CODE:
*ENTER THIS ON THE NEXT LINE BELOW:
If you refresh the page, you'll notice there are undefined variables we need to address!
LETS GET'ER DONE!
------------------------------------------------------------------------------------------------------------
2nd.
GO TO: catalog/language/english/account.register.php
*FIND THIS CODE:
*ENTER THIS ON THE NEXT LINE BELOW:
*THEN FIND THIS CODE:
*ENTER THIS ON THE NEXT LINE BELOW:
------------------------------------------------------------------------------------------------------------
3rd.
GO TO: catalog/controller/account/register.php
*FIND THIS CODE:
*ENTER THIS ON THE NEXT LINE BELOW:
*NEXT FIND THIS CODE:
*ENTER THIS ON THE NEXT LINE BELOW:
*NEXT FIND THIS CODE:
*ENTER THIS ON THE NEXT LINE BELOW:
*NEXT FIND THIS CODE:
*ENTER THIS ON THE NEXT LINE BELOW:
*NEXT FIND THIS CODE:
*ENTER THIS ON THE NEXT LINE BELOW:
------------------------------------------------------------------------------------------------------------
THATS IT!!!
Now you can empty your cache then refresh your browser on your websites registration page.
YOU SHOULD BE GOOD TO GO...
PM me if you have any questions...
Daniel
http://www.whateverhealth.com (My 240 Page Health Book "The Synergy Diet Blueprint")
http://www.rockmebabyclothing.com (Custom Rock Kids Clothes Site)
http://www.christianindustries.com (Web Development Contact)
SEE EXAMPLE HERE: https://www.rockmebabyclothing.com/stor ... t/register
Note: You must enter the codes below at the end of the code I am telling you to find.
(To easily find code, press control f on a pc, or command f on a mac)
------------------------------------------------------------------------------------------------------------
1st.
GO TO: catalog/view/theme/"default or your custom theme folder"/template/account/register.tpl (after newsletter code, around line 200)
*FIND THIS CODE:
- Code: Select all
<h2><?php echo $text_newsletter; ?></h2>
<div class="content">
<table class="form">
<tr>
<td><?php echo $entry_newsletter; ?></td>
<td><?php if ($newsletter == 1) { ?>
<input type="radio" name="newsletter" value="1" checked="checked" />
<?php echo $text_yes; ?>
<input type="radio" name="newsletter" value="0" />
<?php echo $text_no; ?>
<?php } else { ?>
<input type="radio" name="newsletter" value="1" />
<?php echo $text_yes; ?>
<input type="radio" name="newsletter" value="0" checked="checked" />
<?php echo $text_no; ?>
<?php } ?></td>
</tr>
</table>
</div>
*ENTER THIS ON THE NEXT LINE BELOW:
- Code: Select all
<div class="content">
<span class="required">*</span> <b><?php echo $entry_captcha; ?></b><br />
<input type="text" name="captcha" value="<?php echo $captcha; ?>" />
<br />
<img src="index.php?route=information/contact/captcha" alt="" />
<?php if ($error_captcha) { ?>
<span class="error"><?php echo $error_captcha; ?></span>
<?php } ?>
</div>
If you refresh the page, you'll notice there are undefined variables we need to address!
LETS GET'ER DONE!
------------------------------------------------------------------------------------------------------------
2nd.
GO TO: catalog/language/english/account.register.php
*FIND THIS CODE:
- Code: Select all
$_['entry_confirm'] = 'Password Confirm:';
*ENTER THIS ON THE NEXT LINE BELOW:
- Code: Select all
$_['entry_captcha'] = 'Enter the code in the box below:';
*THEN FIND THIS CODE:
- Code: Select all
$_['error_agree'] = 'Warning: You must agree to the %s!';
*ENTER THIS ON THE NEXT LINE BELOW:
- Code: Select all
$_['error_captcha'] = 'The captcha code was entered incorrectly, please try again!';
------------------------------------------------------------------------------------------------------------
3rd.
GO TO: catalog/controller/account/register.php
*FIND THIS CODE:
- Code: Select all
$this->data['button_continue'] = $this->language->get('button_continue');
*ENTER THIS ON THE NEXT LINE BELOW:
- Code: Select all
$this->data['entry_captcha'] = $this->language->get('entry_captcha');
*NEXT FIND THIS CODE:
- Code: Select all
if (isset($this->error['zone'])) {
$this->data['error_zone'] = $this->error['zone'];
} else {
$this->data['error_zone'] = '';
}
*ENTER THIS ON THE NEXT LINE BELOW:
- Code: Select all
if (isset($this->error['captcha'])) {
$this->data['error_captcha'] = $this->error['captcha'];
} else {
$this->data['error_captcha'] = '';
}
*NEXT FIND THIS CODE:
- Code: Select all
if (isset($this->request->post['newsletter'])) {
$this->data['newsletter'] = $this->request->post['newsletter'];
} else {
$this->data['newsletter'] = '';
}
*ENTER THIS ON THE NEXT LINE BELOW:
- Code: Select all
if (isset($this->request->post['captcha'])) {
$this->data['captcha'] = $this->request->post['captcha'];
} else {
$this->data['captcha'] = '';
}
*NEXT FIND THIS CODE:
- Code: Select all
private function validate() {
if ((strlen(utf8_decode($this->request->post['firstname'])) < 1) || (strlen(utf8_decode($this->request->post['firstname'])) > 32)) {
$this->error['firstname'] = $this->language->get('error_firstname');
}
*ENTER THIS ON THE NEXT LINE BELOW:
- Code: Select all
if (!isset($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
$this->error['captcha'] = $this->language->get('error_captcha');
}
*NEXT FIND THIS CODE:
- Code: Select all
if (!$this->error) {
return true;
} else {
return false;
}
}
*ENTER THIS ON THE NEXT LINE BELOW:
- Code: Select all
public function captcha() {
$this->load->library('captcha');
$captcha = new Captcha();
$this->session->data['captcha'] = $captcha->getCode();
$captcha->showImage();
}
------------------------------------------------------------------------------------------------------------
THATS IT!!!
Now you can empty your cache then refresh your browser on your websites registration page.
YOU SHOULD BE GOOD TO GO...
PM me if you have any questions...
Daniel
http://www.whateverhealth.com (My 240 Page Health Book "The Synergy Diet Blueprint")
http://www.rockmebabyclothing.com (Custom Rock Kids Clothes Site)
http://www.christianindustries.com (Web Development Contact)
-

RockMeBaby - Posts: 4
- Joined: Thu Sep 08, 2011 6:24 pm
Re: ADD CAPTCHA to Registration in 1.5.1
great, share, thanks!
- rize
- Posts: 93
- Joined: Fri Jul 15, 2011 3:29 am
Re: ADD CAPTCHA to Registration in 1.5.1
Sorry, ia'm is newbi using Version 1.5.1.3, I was following the instruction....otherwise I have many problems...looklike this
May U help Me..
Best Regards
Hamdani Wigatno
Parse error: syntax error, unexpected $end in /home/muslimia/public_html/musliminia.com/catalog/controller/account/register.php on line 1
May U help Me..
Best Regards
Hamdani Wigatno
- Code: Select all
[url]musliminia.com[/url]
- wigatno
- Posts: 11
- Joined: Wed Oct 12, 2011 5:41 am
Re: ADD CAPTCHA to Registration in 1.5.1
Thanks for sharing!
Just found this captcha approach has a potential issue, please see this post for details:
viewtopic.php?f=161&t=46775
Also, possibly no need to copy function captcha(), as "information/contact/captcha" is used in the view.
Just found this captcha approach has a potential issue, please see this post for details:
viewtopic.php?f=161&t=46775
Also, possibly no need to copy function captcha(), as "information/contact/captcha" is used in the view.
- BobHL
- Posts: 7
- Joined: Thu Nov 10, 2011 12:55 pm
Re: ADD CAPTCHA to Registration in 1.5.1
BobHL wrote:Thanks for sharing!
Just found this captcha approach has a potential issue, please see this post for details:
viewtopic.php?f=161&t=46775
Also, possibly no need to copy function captcha(), as "information/contact/captcha" is used in the view.
And that is possibly where your "security hole" lies. The captcha that should be loaded is the one that has been inserted into the register controller.
In the code above, what should be placed in "catalog/view/theme/default/account/register.tpl" is:
- Code: Select all
<div class="content">
<span class="required">*</span> <b><?php echo $entry_captcha; ?></b><br />
<input type="text" name="captcha" value="<?php echo $captcha; ?>" />
<br />
<img src="index.php?route=account/register/captcha" alt="" />
<?php if ($error_captcha) { ?>
<span class="error"><?php echo $error_captcha; ?></span>
<?php } ?>
</div>

If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
-

fido-x - Posts: 1960
- Joined: Fri Jun 27, 2008 5:09 pm
- Location: Tasmania, Australia
Re: ADD CAPTCHA to Registration in 1.5.1
spamming are common now, including the registration spamming.
by having Captcha can reduce of the spamming.
I hope it can be considered to be part of new version core
just my 2c
by having Captcha can reduce of the spamming.
I hope it can be considered to be part of new version core
just my 2c
- utomo
- Posts: 44
- Joined: Sat Nov 26, 2011 4:55 am
Re: ADD CAPTCHA to Registration in 1.5.1
You are the best. Saved lot of work and money!
- coolguy
- Posts: 37
- Joined: Fri Nov 25, 2011 12:46 pm
Re: ADD CAPTCHA to Registration in 1.5.1
Works fine for me right now.. Thanks dude..
- SunehraTech
- Posts: 30
- Joined: Sat Jun 23, 2012 5:19 pm
Re: ADD CAPTCHA to Registration in 1.5.1
I would like to put this login page, authentication code
Please could you help thanks
Please could you help thanks
- debil
- Posts: 2
- Joined: Fri Sep 14, 2012 11:11 am
Re: ADD CAPTCHA to Registration in 1.5.1
Guys, there is free ReCaptcha extension for OpenCart.
For all versions.
For all versions.
Regards,
Konstantinos Botonakis - Web Expert
OpenCart Extensions - Facebook Fans - Twitter Followers
Botonakis.com Web Development
Αποστολή SMS με 0,015 το SMS
AKA.gr - URL shortener with analytics
Konstantinos Botonakis - Web Expert
OpenCart Extensions - Facebook Fans - Twitter Followers
Botonakis.com Web Development
Αποστολή SMS με 0,015 το SMS
AKA.gr - URL shortener with analytics
-

botonakis - Posts: 236
- Joined: Tue Jan 24, 2012 11:55 am
- Location: Athens, Greece
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests













