Skip to Content Skip to Menu

[SOLVED] "Secured" registration

  • danbo1972
  • danbo1972
  • OFFLINE
  • Posts: 88
  • Thanks: 22
  • Karma: 4
11 years 2 weeks ago - 11 years 2 weeks ago #235713 by danbo1972
[SOLVED] "Secured" registration was created by danbo1972
Hello all,

I'm using CB 1.9 and have installed an auto action


During registration, select users would place a "token" (unique string of numbers) into a field, [cb_verificationnumber]
When the number matches the number used in this auto action, the user is automatically authorized on the site. If they don't have a token they are registered but must await admin approval.

Here's my problem

I can only use a single token in auto actions in the ______ is equal to ___
and I kind of need to be able to use at least 70 different tokens for vendors.

this is the code I'm using in the auto action

Query
onAfterUserConfirm
___________ Equal To __"Token"__
Automatic
everybody

UPDATE `#__comprofiler` SET `approved`= '1' WHERE `user_id` = '[user_id]';
UPDATE `#__users` SET `block` = '0' WHERE `id` = '[user_id].

Again, This works, and it works well. I just need to find a way to do something like this but with more token values.

Any help would be greatly appreciated.
Last edit: 11 years 2 weeks ago by danbo1972.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48495
  • Thanks: 8284
  • Karma: 1443
11 years 2 weeks ago #235761 by krileon
Replied by krileon on topic "Secured" registration
Use a text field with CB Query Field installed then add Query Validation to your text field. This will allow you to compare the value they supplied against a database of values. You then would simply validate it on successful rows returned. Next in your CB Auto Actions you just need to check that the field isn't empty as it'll only validate the field if their code supplied matches a list of codes in your custom database table.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • danbo1972
  • danbo1972
  • OFFLINE
  • Posts: 88
  • Thanks: 22
  • Karma: 4
11 years 2 weeks ago - 11 years 2 weeks ago #235791 by danbo1972
Replied by danbo1972 on topic "Secured" registration
Kyle,

Thanks for your reply. I understand what needs to be done, just not how to do it. Do you have any tutorials on it?
The largest confusion I have is where do I place the valid token keys? Do I have to create a new database or can it be placed "inline" in the query.
I can struggle through this if I'm pointed in the right direction.
Damn.... I should have stayed in school. :unsure:
Last edit: 11 years 2 weeks ago by danbo1972.

Please Log in or Create an account to join the conversation.

  • danbo1972
  • danbo1972
  • OFFLINE
  • Posts: 88
  • Thanks: 22
  • Karma: 4
11 years 2 weeks ago #235794 by danbo1972
Replied by danbo1972 on topic "Secured" registration
Looking further at what you said, and letting it sink in a little....

Field, [cb_verificationcode] would be on the registration form. That field would have query enabled and would check the data entered in that field against a database.
The query would only allow the field to populate if the entered data matched that database information, (ie, Select "tokens" from, validate.)
if the user enters a string that isn't in the database the form would not accept the entry and deny access. If however the string was acceptable it would populate the field and my new auto action would see that the field IsNotEmpty and allow the registration to progress. Right?

I guess it all makes sense except where do I enter the valid token information. Do I have to create a field in a DB somewhere?
Please bear with the ignorance, I'm the furthest thing there is away from being a script writer or programmer.

Thanks again for all you do.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48495
  • Thanks: 8284
  • Karma: 1443
11 years 2 weeks ago #235798 by krileon
Replied by krileon on topic "Secured" registration

Do you have any tutorials on it?

No, not currently. It makes a little more sense when looking at the parameters though. There is also a few usages for CB Query Field query validation posted around the forums.

The largest confusion I have is where do I place the valid token keys? Do I have to create a new database or can it be placed "inline" in the query.

You need to create a new database table in your Joomla database that'll store all your token keys. 1 key per row. This will allow you to query for them and make sure the value the user supplied matches one.

That field would have query enabled and would check the data entered in that field against a database.

Correct.

The query would only allow the field to populate if the entered data matched that database information, (ie, Select "tokens" from, validate.)

It will only allow registration to save if the value they supplied is valid. So if the field has no value or a valid value they can register, which would cover your 2 needed usages.

if the user enters a string that isn't in the database the form would not accept the entry and deny access.

They would get a registration validation error, which you can supply to inform them why they can't register.

If however the string was acceptable it would populate the field and my new auto action would see that the field IsNotEmpty and allow the registration to progress. Right?

Yup.

I guess it all makes sense except where do I enter the valid token information. Do I have to create a field in a DB somewhere?

Yes, you need to create a new database table to store your tokens so you have something to query against.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • danbo1972
  • danbo1972
  • OFFLINE
  • Posts: 88
  • Thanks: 22
  • Karma: 4
11 years 2 weeks ago #235801 by danbo1972
Replied by danbo1972 on topic "Secured" registration
Okay, I almost have it working. The only problems I'm running into now is how to point to that fields values in the db.

fieldvalueid fieldid Fieldtitle

79 78 XKSI66406462J 1 0
80 78 LSDKJO4684056 2 0
81 78 LKJSIJAIEGHSK 3 0

I dont know what to call the values.
Select ? from? where? =?

Thanks again for your help Kyle. I know this wasn't part of the purchase plan. :)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum