[SOLVED] User auto generated number

6 years 1 month ago #302732 by krileon
Replied by krileon on topic User auto generated number

when replacing the SECRETKEY, can that be any string of characters? meaning could i use all letters, or all numbers, or a combination of both? example something like this: TESTPASSWORD

It's whatever you want kept to your self as it's a signing password that no one should know, but you.

The below will probably work. Replace jos_ with whatever your table prefix is. If it throws errors adjust as needed as I did not test it.

i hate to ask, would you be so kind as to help me produce the sql query code to complete the update to all cbsubs of each specific subscription/plan?

UPDATE `jos_comprofiler` AS cb SET cb.`cb_license` = ( SELECT CONCAT_WS( '_', cb.`id`, cbsubs.`plan_id`, cbsubs.`id`, 'SECRETKEY' ) FROM `jos_cbsubs_subscriptions` AS cbsubs WHERE cb.`id` = cbsubs.`user_id` AND cbsubs.`status` = 'A' LIMIT 1 )


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 to join the conversation.

6 years 1 month ago #302747 by wjgadmin
Replied by wjgadmin on topic User auto generated number
oh so close! this did put the information together, but it didn't actually generate a license key from it. for example instead of coming out like a serial key it came out in this format "[user_id]_[plan_id]_[subsciption_id]_SECRETKEY", but it did have actual numbers so in the db it looks like this:
2089_15_2208_MYPASSWORD

basically it did run the query & did produce the information, it just didn't turn it into an encrypted serial key. it seems like the MD5 portion is not taking place?

Please Log in to join the conversation.

6 years 1 month ago #302785 by krileon
Replied by krileon on topic User auto generated number
Forgot the MD5. Add the MD5 function around the CONCAT_WS. Again, it was an example that I didn't test.


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 to join the conversation.

6 years 1 month ago #302821 by wjgadmin
Replied by wjgadmin on topic User auto generated number
Thank you so much Kyle! I tried so many variations yesterday using this exact thought process, but until you said "around the CONCAT_WA" it didn't work. i was placing it in the wrong spots.
anyway thank you again & please mark this as resolved :)
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.719 seconds

Facebook Twitter LinkedIn