New Zenner
- Join Date:
- Aug 2008
- Posts:
- 27
- Plugin Contributions:
- 0
User Verification (Anti-Robot / CAPTCHA)
Hi,
I have the same trouble, I need start in a new line the CAPTCHA code.
Thanks
Rolando Maldonado
https://www.todoenguate.com
Views: 79,780
New Zenner
Hi,
I have the same trouble, I need start in a new line the CAPTCHA code.
Thanks
Rolando Maldonado
https://www.todoenguate.com
New Zenner
<?php if (ACCOUNT_VALIDATION == 'true') { ?> <?php if (strstr($_SERVER['REQUEST_URI'],'create_account') && CREATE_ACCOUNT_VALIDATION == 'true' || strstr($_SERVER['REQUEST_URI'],'login') && LOGIN_VALIDATION == 'true') { ?> <?php if ($is_read_only == false || (strstr($_SERVER['REQUEST_URI'],'create_account')) || (strstr($_SERVER['REQUEST_URI'],'login'))) { $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . zen_session_id() . "'"; if( !$result = $db->Execute($sql) ) { die('Could not delete validation key'); } $reg_key = generate_captcha_code(); $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . zen_session_id() . "', '" . $reg_key . "', '" . time() . "')"; if( !$result = $db->Execute($sql) ) { die('Could not check registration information'); } ?> <fieldset> <legend><?php echo CATEGORY_ANTIROBOTREG; ?></legend> <label class="inputLabel" for="antirobotreg"><?php echo ENTRY_ANTIROBOTREG ?></label> <?php $validation_images = ''; for($i = 0; $i < ENTRY_VALIDATION_LENGTH; $i++) { $parse_image = 'validation/validation_' . $reg_key{$i} . '.gif'; $parse_image_alt = $reg_key{$i}; $validation_images .= zen_image(DIR_WS_IMAGES . $parse_image, $parse_image_alt); } echo '<div class="centered">'; echo $validation_images . '<br />'; echo '</div>'; ?> <?php echo zen_draw_input_field('antirobotreg','', 'id="antirobotreg"') . (zen_not_null(ENTRY_ANTIROBOTREG) ? '<span class="alert">' . ENTRY_ANTIROBOTREG_TEXT . '</span>': ''); ?> <br class="clearBoth" /> ``` > > > Does the validation related HTML show up when you view the source for the create_account web page? > > Woody I am following this thread and have the sam problem. The code does not show up in the view sorce of the html.Woodymon:
The "validation code" box should display at the bottom of create account form
/index.php?main_page=create_account
In admin under Configuration > CAPTCHA Validation, are you certain you have "Activate Validation on Create Account page" set to TRUE ?
Which version of CAPTCHA mod have you installed?
If employing the new Zen cart 1.37 split login option, be aware the CAPTCHA mod does NOT support the "Login" page. but still works on "Create Account" page.
Are you certain you have the below code block near the end of your tpl_modules_create_account.php ????
Also I can not find the end resolution to mgrunk problem
New Zenner
Can someone provide uninstall instructions? Of course, my back ups have a days worth of work that are not included and now I'd like to uninstall.
I replaced/deleted the files that were uploaded with the originals since I had those, but I'm wondering about the database.
I installed, thought I was happy, did a bunch of other work today and now I want to try a different CAPTCHA since this one does not include a CAPTCHA for the contact us page.
I'll keep it if I can get the contact us page to work, but I'm noting some concerns here about security.
I could backtrack through the .sql file to see if I can undo what the script did, but instructions would be appreciated.
Thanks in advance.
New Zenner
Not sure if anyone's mentioned this already, but this mod have issues when used with a URL rewriting mod like Magic SEO URLs. Problem is in tpl_modules_create_account.php:
if ((strstr($_SERVER['REQUEST_URI'],'create_account') && CREATE_ACCOUNT_VALIDATION == 'true') || (strstr($_SERVER['REQUEST_URI'],'login') && LOGIN_VALIDATION == 'true')) {
To check if the including page is the Create Account or Login page, the code assumes the presence of "create_account" or "login" in the REQUEST_URI string. On my site, MSEO URLs is changing the former to account/create.html, so it's not matching.
Changing $_SERVER['REQUEST_URI'] to $_GET['main_page'] seems to be more reliable.
if (($_GET['main_page'] == 'create_account' && CREATE_ACCOUNT_VALIDATION == 'true') || ($_GET['main_page'] == 'login' && LOGIN_VALIDATION == 'true')) {
if ($is_read_only == false || $_GET['main_page'] == 'create_account' || $_GET['main_page'] == 'login') {
New Zenner
I just installed the latest version (june 2010) of this, it is allowing me to create the account even thought I entered an invalid captcha verification code.
I am using fast and easy checkout add on, but tested with the create account flow.
Has anyone experienced this? Suggestions?
~ Heritage
Zen Follower
heritage:
I just installed the latest version (june 2010) of this, it is allowing me to create the account even thought I entered an invalid captcha verification code.
I am using fast and easy checkout add on, but tested with the create account flow.
Has anyone experienced this? Suggestions?
~ Heritage
Did you install a template or do you use the Classic Template?
If you have a different template and there is a YOUR_TEMPLATE folder under includes/modules, did you copy the includes/modules/create_account.php
into includes/modules/YOUR_TEMPLATE/ folder?
Also, a new Thread has been started for this mod:
http://www.zen-cart.com/forum/showthread.php?t=156720&highlight=CAPTCHA
New Zenner
hi JTheed,
Yes, I installed all the files in the correct directory including the cYeate_account.php in my template folder. I am using a customized template.
Thanks for directing me to the other thread, I will check it out...
~Heritage
Totally Zenned
Is this compatible with v1.3.9d and FEC?
Also, I don't use the tell-a-friend page, can I disregard the files:
thanks
Zen Follower
split63:
Is this compatible with v1.3.9d and FEC?
Also, I don't use the tell-a-friend page, can I disregard the files:
- includes/templates/template_default/tpl_tell_a_friend.php
- includes/modules/pages/tell_a_friend/header_php.php
thanks
This one does, as it says in the title that it is 139 compatable, they don't give a letter in the dropdown choices, but yes 1.3.9d.
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=325
and you wouldn't have to install the tell a friend files as you can just leave the originals in place.
New Zenner
I had no issues installing it and I am very impressed by the clarity of the captcha letters and it's seamless integration into the template.
New Zenner
I was just looking to upgrade 1.3.9.f to .g today and noticed
includes/modules/pages/contact_us/header_php is drastically changed from the captcha module. Has anyone looked into if these changes need to be applied or if some of these changes should be copied over?
Thanks for the inside. I am still learning this code
New Zenner
I am a beginner with Sql
I'm running Zencart 1.3.9h locally
I've installed the Captha file.
I realise the error below is due to a missing table prefix
I didn't change any prefix before I uploaded the Captcha.sql file by cut & paste of query in admin/tools/install Sql patches
My tables have a prefix of znc_ and is defined in my configure.php
The Captcha validation was loaded and showing in admin/configuration (even though in hindsight the insert queries should not have been able to be actioned with not prefix.)
When I view the contact page I have this error:
1146 Table 'DB_name.table_anti_robot_registration' doesn't exist
in:
[DELETE FROM TABLE_ANTI_ROBOT_REGISTRATION WHERE timestamp < '1289259168' OR session_id = '6aobqt9c01qnvu1qlkb8koj911']
I ran the Unintall_Captcha.sql
then I ran the install sql patch again , changing all inserts commands to znc_table_name and delete from znc_table_name.
yet now when I ran the patch I got this error as soon as I executed the 'send'
1146 Table 'db_name.znc_znc_configuration_group' doesn't exist
in:
[SELECT @sortorder:=max(sort_order) FROM znc_znc_configuration_group;]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
So I see 'znc prefix' has been automically added to the configuration_group and I am assuming the rest of the ' INSERT TO configure queries as well.
yet it didn't add znc_ automatically the first time I ran it to the DELETE FROM query
Could someone let me know which of the following queries I need to add the prefix of 'znc_' to and which will be automatically added by zencart when I run this sql patch for the Captcha.sql addon?
Cheers
SELECT @sortorder:=max(sort_order)
FROM configuration_group;
INSERT INTO configuration_group VALUES (NULL, 'CAPTCHA Validation', 'Anti-Robot Registration/Verification', @sortorder+1, 1);
SELECT @captchaid:=max(configuration_group_id)
FROM configuration_group;
INSERT INTO configuration ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) VALUES ( 'Activate Validation', 'ACCOUNT_VALIDATION', 'true', 'Enables CAPTCHA Verification Code. This is used to verify that the customer is real and valid, rather than a bot or spider session.', @captchaid, 10, NULL, 'zen_cfg_select_option(array('true', 'false'),' );
INSERT INTO configuration ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) VALUES ( 'Activate Validation on Create Account page', 'CREATE_ACCOUNT_VALIDATION', 'true', 'Enables verification on Create Account page. (Recommended)', @captchaid, 20, NULL, 'zen_cfg_select_option(array('true', 'false'),' );
INSERT INTO configuration ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) VALUES ( 'Activate Validation on Tell a Friend page', 'TELL_A_FRIEND_VALIDATION', 'true', 'Enables verification on Tell a Friend page. (Recommended)', @captchaid, 30, NULL, 'zen_cfg_select_option(array('true', 'false'),' );
INSERT INTO configuration ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) VALUES ( 'Activate Validation on Contact Us page', 'CONTACT_US_VALIDATION', 'true', 'Enables verification on Contact Us page. (Optional)', @captchaid, 40, NULL, 'zen_cfg_select_option(array('true', 'false'),' );
INSERT INTO configuration ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function ) VALUES ( 'Length of Validation Code', 'ENTRY_VALIDATION_LENGTH', '5', 'Default Length = 5, Maximum Length = 32', @captchaid, 50, NULL, NULL );
DROP TABLE IF EXISTS anti_robotreg;
CREATE TABLE anti_robotreg (session_id char(32) DEFAULT '' NOT NULL, reg_key char(32) NOT NULL, timestamp int(11) unsigned NOT NULL, PRIMARY KEY (session_id));
New Zenner
Hi
using the latest version 1.3.9.h
few add ons but the one that caused the issue when getting this all working was in combination with the "confirm_email_address" add on for the create account page.
be sure to merge the changes required for each add on to the
tpl_modules_create_account.php
in your own template...
either or add on overwrites the file with its changes and stops either or working unless the changes are merged...use a comparing utility to look at the code changes each implements...
great mods though, well impressed
donal:clap:
New Zenner
I could not get the sql to install, even when i changed the relevant database tables to zen_ but manually entered everything. Biggest issue I have is that the sql file wants you to put
"@captchaid" in the "configuration_group_id" well it only yakes an integer, won't accept a phrase I get this error "Warning: #1292 Truncated incorrect INTEGER value: '@captchaid'
"
Help:smile:
New Zenner
:Well if I was smart enough to read the entire readme file and "understand it" :shocking: then I would have been ok for the sql portion.
That is now loaded coreectly and shown in the admin section, though so far :wink: I have not gotten the any captcha code to display on the pages.
But let me dig into y and fix
Sorry for the last post
Bud
New Zenner
I'm missing captcha on login page.
New Zenner
How is result of Anti-Robot Registration System did you guys forgot about bot spammer?
New Zenner
Extract or Upload all the files in this archive, overwriting the
existing files.
Upload the contents of the images/ directory to your server to
see the verification graphics.
Apply the included CAPTCHA.sql file via the usual method.
NOTE: On certain PHP5 based installations, the SQL file will
fail if you use the 'patch upload' function. For best results,
cut-and-paste the code into the query field and press 'Send'
instead.
If you have done everything correctly, configuration options for
CAPTCHA verfication code will appear in:
Admin->Configuration->CAPTCHA Validation
Once you have applied the CAPTCHA.sql file, it is safe to remove it
from your machine.
Once you have installed and tested this modification, it is safe to
remove this README file from your machine.
where can i find a more detailed instruction that includes all paths ect instead of statements like: Apply the included CAPTCHA.sql file via the usual method.
Sorry to be such a novice.....
New Zenner
shipbuilder777:
I am building my my zencart site and want to add this captcha, however i am one of those who needs a dumbed down install proceedure.
Me too.
I'm looking at the readme.txt as well. I'm getting the hang of the override system, and have loaded a template and changed the dates from usa format to uk format following the instructions else where.
Where i've had to override the admin folder for the dates, i've secured both the pre and post edited files for now until I can back up and secure fully the changes.
So which files end up in the override folders and which do I have to secure before overwriting them?
Also could I have a pointer on the sql database, my database does have a prefix and is a format xxxx_yyy where xxxx is the prefix. So where in the sql do I insert the prefix and or database name?
Sorry to be a novice at this as well, but some wise words of guidence will always be of benefit.
Totally Zenned
I used the CAPTCHA for a while but found that it really slowed the page load down and in IE the image wasn't rendered properly unless the page was refreshed. I tried this method described here in this forum and suddenly every single spam email disappeared. It's been about 3 months and not a single spam. Plus, the pages that had CAPTCHA are all loading a lot faster. Honestly, do you really want to force your customers to have to enter info in another field when you are doing everything else to make the process of them giving you their money as easy as possible? It seems counter-intuitive, the CAPTCHA is only to make ***your ***life easier but your customer's experience more frustrating by having to fill in another field and actually THINK. You don't want them THINKING during their time on your site, read Don't Make Me Think if you think I am wrong.:P:D
Seriously, use the technique from the thread I posted above and you will get rid of ALL spam without compromising your customer's experience.
Tell staff why this post should be reviewed.