Automatically activate user after some days

1 week 12 hours ago - 1 week 7 hours ago #319816 by TheoSp
Hello,

Is it possible to automatically activate a user with a perticular field inputvalue after a certain number of days after registration date?

Thanks,
Theo

Please Log in to join the conversation.

5 days 4 hours ago #319840 by krileon
Replied by krileon on topic Automatically activate user after some days
I assume you mean approve their registration after x days automatically? That would be doable using CB Auto Actions.


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.

5 days 2 hours ago - 5 days 1 hour ago #319848 by TheoSp
Replied by TheoSp on topic Automatically activate user after some days
Thanks for reply.

Approve and activate.
Indeed x days after registrationDate.

I read documentation about CB Auto Actions but that addon works with triggers.
Here is no trigger excepted the change of system date which has to be compared with registrationDate + x days.
Also there is a registerform-field value which has to be a condition for the activation.

So how should I use the addon in this case?

Please Log in to join the conversation.

4 days 4 hours ago #319863 by krileon
Replied by krileon on topic Automatically activate user after some days
CB Auto Actions can be ran using CRON Tasks configured in your hosting platform. Using the Internal Users trigger and its URL you can pass an auto action through your entire user base. That's where you'd do this processing. To activate them you'd just call the built in API for it. For example the below Internal Users usage should work fine for this.

Global
Triggers: Internal Users
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [cb:parse function="time"]now[/cb:parse]
Features: Format Functions
Operator: Equal To or Greater Than
Value: [cb:parse function="time" time="+3 DAY"][registerDate][/cb:parse]
Features: Format Functions
Code
Method: PHP
Code:
$user->approveUser( 1 );

The above for example should automatically approve their registration (and enable them if they're confirmed) 3 days after they register. You'd either need to run the Internal Users URL manually daily or setup a CRON Task to wget or cURL GET load it. This is an advanced usage though and don't recommend it unless you've become more familiar with how CB Auto Actions works.


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.

4 days 2 hours ago #319864 by TheoSp
Replied by TheoSp on topic Automatically activate user after some days
Thank you for this extended reply.

2 questions:

1. the PHP code sets the approval to true but I whish to set activation also. What's the code fot that?
2.I am not famliar with crontasks. But I realise that wget or cURL sets the link to the joomla cb action.
But what should be the full statement for that link?

Please Log in to join the conversation.

4 days 2 hours ago #319865 by krileon
Replied by krileon on topic Automatically activate user after some days

1. the PHP code sets the approval to true but I whish to set activation also. What's the code fot that?

Assuming the user is confirmed already it will handle marking them approved and enabled with that single function call.

2.I am not famliar with crontasks. But I realise that wget or cURL sets the link to the joomla cb action.
But what should be the full statement for that link?

wget and cURL examples can be found below.

www.joomlapolis.com/forum/277-cb-paid-subscriptions-support/237481-cron-job#297853


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.

Moderators: beatnantkrileon
Time to create page: 0.446 seconds

Facebook Twitter LinkedIn