Support

  1. ialearn
  2. Features Request
  3. Friday, April 20 2018, 09:52 AM
HI

I would like to add a text field where a person can enter a unique membership number, the field must then compare the value entered to a list of valid membership numbers, the the number is contained in the list they must be added to group "Valid Membership"

Is this possible.
admin Accepted Answer
Admin
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.
  1. more than a month ago
  2. Features Request
  3. # 1
ialearn Accepted Answer
Hi

Thank you for all the help thus far.
One more question, the code as I have it at the moment adds the user to the required user group, would it be possible to set it up so that for example after it has added the user to group with ID 18 it checks to see if the user is also in group with ID 19 if the user is in both groups the system then adds them to Group with ID 20 as well
  1. more than a month ago
  2. Features Request
  3. # 2
ialearn Accepted Answer
Content Protected
  1. more than a month ago
  2. Features Request
  3. # 3
  • 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.

Guidelines

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.