Hi,
Easy Profile does not do this natively but it is possible by creating a simple Plugin, you can follow these steps:
- Download our skeleton plugin (you can find it at
http://docs.easy-profile.com/index.php/article/triggers)
- Install it from Joomla Installer
- Enable it from Extensions->Plugins
- Open file /plugins/jsn/skeleton/skeleton.php
- Remove sample functions: "triggerFieldAvatarUpdate" and "triggerProfileUpdate"
- Add a function like this:
public function triggerProfileUpdate($user,&$data,$changed,$isNew)
{
if(isset($data['here_the_alias_of_your_field']) && !empty($data['here_the_alias_of_your_field'])){
$value = $data['HERE_THE_ALIAS_OF_YOUR_FIELD'];
/* HERE YOU CAN ADD THE CODE TO CHECK IF THE VALUE IS VALID */
if($valid) JsnHelper::addUserToGroup($user, HERE_THE_NUMERIC_ID_OF_USERGROUP_VALID_MEMBERSHIP); // if the value is valid then this add user to usergroup
else{
JsnHelper::removeUserFromGroup($user, HERE_THE_NUMERIC_ID_OF_USERGROUP_VALID_MEMBERSHIP); // if the value is not valid then this remove user from usergroup
$data['HERE_THE_ALIAS_OF_YOUR_FIELD'] = ''; // if the value is not valid then this delete the value
}
}
}
IMPORTANT NOTE: This code is not tested and not supported, this is only for example purpose.