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'];
if($value == 'opt1') {
/* HERE THE CODE TO ADD USER TO K2 GROUP, FOR EXAMPLE WITH A SQL QUERY */
}
else{
/* HERE THE CODE TO REMOVE USER FROM K2 GROUP, FOR EXAMPLE WITH A SQL QUERY */
}
}
}
IMPORTANT NOTE: This code is not tested and not supported, this is only for example purpose.