I need to add users who have entered a birthday in a date field, and who's birthday makes them younger than 25, to a certain user group - how would I do that ? How can I test against a date - 25 years ? And also, could I afterwards run this as a batch every day to automatically remove the group when they become older than 25 years ?
That's specifically what the Batch feature is for. Lets you run an auto action against a set of users. You'll need to use an Advanced Filter in your batch though as you'll need to use MySQL functions to check the date of whatever field you're using for birthdate.
You'd need 2 batches and 2 auto actions. 1 batch check if they're under the age of 25 and are missing that usergroup. The other checks if they're over the age of 25 and do have that usergroup. 1 auto action adds the usergroup and the other removes it. Now you'd schedule CRON to run the batch URLs using wget on whatever interval you like.
An alternative is you do this at time of login. So when they login it checks their age and adds/removes the usergroup as needed. That's a simpler approach if this is only needed to add or remove access for the user and won't be used for some sort of filtering/searching behavior.
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.