Jump to content
Sign in to follow this  
Druide

NEW: Anti Robot Registration Validation

Recommended Posts

Eh , Druide i dont know if it is me only but in my admin, i dont see nothing under ANTI ROBOT REG.

 

All i see is this :

 

Anti Robot Reg

 

Title Value Action

 

I did successfully inserted the SQL code so what i'm i missing?

 

Thanks


Stand for something or fall for anything

Share this post


Link to post
Share on other sites
Eh , Druide i dont know if it is me only but in my admin, i dont see nothing under ANTI ROBOT REG.

 

All i see is this :

 

Anti Robot Reg

 

Title Value Action

 

I did successfully inserted the SQL code so what i'm i missing?

 

Thanks

 

:oops:

this is not my day, lots of stupid bugs, a few power surges due to the bad weather around here :(

Here is the right code for the TABLE

DROP TABLE IF EXISTS anti_robotreg;

CREATE TABLE anti_robotreg (

 session_id char(32) NOT NULL default '',

 reg_key char(5) NOT NULL default '',

 timestamp int(11) unsigned NOT NULL default '0',

 PRIMARY KEY  (session_id)

) TYPE=MyISAM;

 

 

I'm affraid something went wrong here during a power surge / saving / backup

 

I have to recheck ALL the coding i recently changed

 

 

My appologies...


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites

I have to get to bed now...

 

after posting the above message i did see that the field reg_key only has 5 char which was 15.... i am losing it :(

 

so....

 

DROP TABLE IF EXISTS anti_robotreg;

CREATE TABLE anti_robotreg (

 session_id char(32) NOT NULL default '',

 reg_key char(15) NOT NULL default '',

 timestamp int(11) unsigned NOT NULL default '0',

 PRIMARY KEY  (session_id)

) TYPE=MyISAM;


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites

first of all good contrib,

 

but after changing sql code , i have the same error as described before, nothing in admin. I suppose the informations appear when i create a new account in catalog. But for the options to validate or not nothing appear. For now i use phpmyadmin to change options status.

 

 

thanks a lot


PL DTM

-----------------------------------------

Sur un malentendu, ... ?a pourrait marcher

Share this post


Link to post
Share on other sites

great contrib, thanks.

 

i also have the no options in the admin - i do have a link for Anti Robot Reg under configuration, but the page is blank...

 

all it shows is:

Anti Robot Reg

Title Value Action

Share this post


Link to post
Share on other sites

i will try my project on a fresh install tonight to see what is going wrong here

 

I have no clue why it's not showing in the admin area


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites
i will try my project on a fresh install tonight to see what is going wrong here

 

I have no clue why it's not showing in the admin area

 

No Need!!

 

I see the problem!!

 

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('', 'Anti Robot Reg', 'Anti Robot Registration', 300, 1);

 

Configuration Group ID Is balnk when this needs to be hardcoded so that the option can link with this group....

 

Understand?

 

Warren

Share this post


Link to post
Share on other sites

There sure is something weird with this thing.

Hopefully someone will spot it ..

:D


Stand for something or fall for anything

Share this post


Link to post
Share on other sites
i will try my project on a fresh install tonight to see what is going wrong here

 

I have no clue why it's not showing in the admin area

 

No Need!!

 

I see the problem!!

 

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('', 'Anti Robot Reg', 'Anti Robot Registration', 300, 1);

 

Configuration Group ID Is balnk when this needs to be hardcoded so that the option can link with this group....

 

Understand?

 

Warren

 

To make life easy,

What I mean is to remove the SQL already insereted in your DB from this mod and use this:

 

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('19', 'Anti Robot Reg', 'Anti Robot Registration', 300, 1);





INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Activate Anti Robot Registration ?', 'ACCOUNT_VALIDATION', 'true', 'Put a special code into create account & edit account to verify the user is human :)', 19, 10, '2003-05-10 19:38:18', '2003-05-10 19:38:18', NULL, 'tep_cfg_select_option(array('true', 'false'),');





INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Activate for Create Account ? ', 'ACCOUNT_CREATE_VALIDATION', 'true', 'This will put the Validation Code Check in the Create Account when activated (DEFAULT)', 19, 20, '2003-05-10 21:23:10', '2003-05-10 20:39:46', NULL, 'tep_cfg_select_option(array('true', 'false'),');





INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Activate for Editing Account ? ', 'ACCOUNT_EDIT_VALIDATION', 'true', 'This will put the Validation Code Check also in the Account Edit when activated (OPTIONAL)', 19, 30, '2003-05-10 21:23:10', '2003-05-10 20:39:46', NULL, 'tep_cfg_select_option(array('true', 'false'),');





INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Length for the Validation Code', 'ENTRY_VALIDATION_LENGTH', '5', 'The DEFAULT Length = 5', 19, 50, '2003-05-10 21:23:10', '2003-05-10 20:39:46', NULL, NULL);





CREATE TABLE anti_robotreg (

session_id char(32) DEFAULT '' NOT NULL,

reg_key char(5) NOT NULL,

timestamp int(11) unsigned NOT NULL,

PRIMARY KEY (session_id))

 

Please post if that works!!!

 

Warren

Share this post


Link to post
Share on other sites

Why does this work?

 

Notice the 19's in each statement? Check the old SQL (which uses 300's) and you will find that one of the statement has a 300 missing!!

Share this post


Link to post
Share on other sites

That was it Warren, Once again, you got it.

 

It is working just perfect.


Stand for something or fall for anything

Share this post


Link to post
Share on other sites
That was it Warren, Once again, you got it.

 

It is working just perfect.

 

Glad I could Help :lol: :lol:

 

Warren

Share this post


Link to post
Share on other sites

I love Benjamin's AVACHAR it is keeping it real.

Look at him go...

 

Reminds me of this song:

 

Go go, go shorty it's your birthday, we gonna party like it's your birthday..

We gonna sip barcadi like it's your birthday,you know we dont give a f*** that's your birthday.

 

:lol: :lol: :lol:

 

 

He is a Believer.


I Believe in my Dreams wherever they lead me.

I Demand Nothing less But EVERYTHING!!!

Share this post


Link to post
Share on other sites
Why does this work?

 

Notice the 19's in each statement? Check the old SQL (which uses 300's) and you will find that one of the statement has a 300 missing!!

 

Thank you Warren but why do you change the number to 19 ??

 

Just because you have set it up like that, wasn't it easier to set ONLY the configuration_group_id to 300 and not make all those other changes, this will get confusing when i am posting the next release

 

Sorry but not the best thing to do


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites

So user of my contribution

 

PLEASE !!!

 

only make this change

 

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES ('300', 'Anti Robot Reg', 'Anti Robot Registration', 300, 1);

 

Still thanks Warren for spotting this copy/past bug of mine (once again) :oops:


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites

LOL - Robert,

Te reason why I did it is to keep the tables simple - A big jump from 15 to 300 seemed daft...

 

Anyway, that just my personal preferance...

 

Warren

Share this post


Link to post
Share on other sites
LOL - Robert,

A big jump from 15 to 300 seemed daft...

 

Warren

 

That depends how you make use of groups,

I got an up to date version on my dev cart with almost 80 contributions installed and all settings (original and adjusted) are put in seperate groups etc to get a maximum result from the admin area.

 

Then you need to make bigger jumps then using # 15

else you will end up in a mess


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites

it it only me or has anyone else experienced this?

 

the validation fails first time (have only tried it with creating an account) and works fine on the second attempt. This happens every time...

Share this post


Link to post
Share on other sites
it it only me or has anyone else experienced this?

 

the validation fails first time (have only tried it with creating an account) and works fine on the second attempt. This happens every time...

 

Hmmm,

I thoguht that at first....

 

Druide why dont you make the code much simpilar? By removing the need of having a DB table etc....

 

Alss that basically is needed is to check if the entry matched the images displayed...

 

Warren

Share this post


Link to post
Share on other sites
it it only me or has anyone else experienced this?

 

the validation fails first time (have only tried it with creating an account) and works fine on the second attempt. This happens every time...

 

tried it on a fresh install and didn't had this problem, what osC version do you use ?


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites
tried it on a fresh install and didn't had this problem, what osC version do you use ?

 

I'm using the Loaded CREv5, and it happens every time...

Share this post


Link to post
Share on other sites

tried it on a fresh install and didn't had this problem, what osC version do you use ?

 

I'm using the Loaded CREv5, and it happens every time...

 

 

while i'm at it, i would like to add this to another page but am not getting to far...any tips?

Share this post


Link to post
Share on other sites

i haven't done any testing with any LOADED version and i am not planning to do that also (sorry for that)

 

maybe the password validation gets called later then the original osC version or so ???

Ask Ian (the creator of Loaded version) if this is true

 

So the quick solution for you should be (without testing this)

 

 

you can try it by deleting this from catalog/includes/functions/password_funcs.php

////

// This funstion validates the created profile 

// searchengine spiders will not know what to do here, so you will not have automatic profiles from them

function gen_reg_key()

{

$key = "";

$chars = array(

 "a","b","c","d","e","f","g","h","i","j","k","l","m",

 "n","o","p","q","r","s","t","u","v","w","x","y","z");



$count = count($chars) - 1;



srand((double)microtime()*1000000);



for($i = 0; $i < ENTRY_VALIDATION_LENGTH; $i++)

 {

 $key .= $chars[rand(0, $count)];

 }



return($key);

}

 

make a new file called account_validation.php in catalog/includes/functions/

 

with this in it

<?php

////

// This funstion validates the created profile 

// searchengine spiders will not know what to do here, so you will not have automatic profiles from them

function gen_reg_key()

{

$key = "";

$chars = array(

 "a","b","c","d","e","f","g","h","i","j","k","l","m",

 "n","o","p","q","r","s","t","u","v","w","x","y","z");



$count = count($chars) - 1;



srand((double)microtime()*1000000);



for($i = 0; $i < ENTRY_VALIDATION_LENGTH; $i++)

 {

 $key .= $chars[rand(0, $count)];

 }



return($key);

}

?>

 

 

change

 

catalog/create_account.php

 

 

  if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_CREATE_VALIDATION == 'true') {

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_VALIDATION);

 }

 

to

 

  if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_CREATE_VALIDATION == 'true') {

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_VALIDATION);

 include_once('includes/functions/' . FILENAME_ACCOUNT_VALIDATION);

 }

 

 

if that works you need to change these files too:

create_account_process.php

account_edit.php

account_edit_process.php

 

just include the line

  include_once('includes/functions/' . FILENAME_ACCOUNT_VALIDATION);

in those files

 

 

NOTE: i haven't tested this and i am moving to my new house so time is VERY limited for me the next 2 weeks


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites
it it only me or has anyone else experienced this?

 

the validation fails first time (have only tried it with creating an account) and works fine on the second attempt. This happens every time...

 

Hmmm,

I thoguht that at first....

 

Druide why dont you make the code much simpilar? By removing the need of having a DB table etc....

 

Alss that basically is needed is to check if the entry matched the images displayed...

 

Warren

 

complain about coding Warren ? :twisted:

Ofcourse Idea's are most welcome,

but nobody writes a bug free code for ALL osC versions when releasing a new contribution.

 

I just implemented this from a phpBB version like i did wrote in the INSTALL file !!!

 

Since my time is VERY LIMITED atm i only offered it this way, to get some bugs out etc...

 

Final version will come later when i have moved COMPLETLY over to my new house

 

Still got only 2 arms and 1 brain, sorry for that ... :lol:

 

Have to get back to moving stuff again......

 

Take care


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites
i haven't done any testing with any LOADED version and i am not planning to do that also (sorry for that)

 

don't be sorry, the work you have done is excellent!!!

 

and it was just me, i have just created 2 new acounts and it worked first time...so i am sorry...

 

will try the tip for the validation i need on the other form though, thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×