1. geri1104
  2. Support
  3. Tuesday, February 09 2016, 03:56 PM
is this possible:
I want a user to be added to a usergroup based on his age.
for exampe:
if age > 40 than add to usergroup "old"

admin Accepted Answer
sorry this is not possible.

This is something that you need to manage with some Cron process, because the age value is not static (i.e. today I have 39 years old, tomorrow 40)

With our APIs you can build a simple plugin that check this, but this check come only when user Register or Update his profile (docs with example plugin at
- Download, Install and Enable Skeleton Plugin
- remove samples functions: triggerFieldAvatarUpdate, triggerProfileUpdate
- add function like this:
public function triggerProfileUpdate($user,&$data,$changed,$isNew)
$aliasOfFieldBirthday='dob'; // replace with your Alias of Birthday field
$groupToAdd=10; // replace with ID of usergroup

$birthDate=JHtml::_('date', $data[$aliasOfFieldBirthday], 'm/d/Y','UTC');
$birthDate = explode("/", $birthDate);
$age = ( date( "md" , date( "U", mktime( 0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2] ) ) ) > date( "md" ) ? ((date( "Y" )-$birthDate[2])-1 ) : ( date( "Y" )-$birthDate[2] ) );

if ( $age > 40 ) JsnHelper::addUserToGroup( $user , $groupToAdd );

NOTE: This code is not tested and not supported, this is only for example purpose.
  1. more than a month ago
  2. Support
  3. # 1
geri1104 Accepted Answer
Ok, i will try this solution.

thank you very much for the fast answer!
  1. more than a month ago
  2. Support
  3. # 2
  • Page :
  • 1

There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.


Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.