1. Fredrik_Widfeldt
  2. Support
  3. Tuesday, July 01 2014, 10:37 AM
Hi,

I'm trying to implement a member registration functionality with activation codes in Easy Profile.
The purpose is to only allow registration for members of an association.

I have added two required profile fields "activation_code" and "member_no_reg" that are not on the registration form, but that they are asked to update their profile with when logging in first time after registering.

I have implemented a plugin that check the activation_code and member_no against a table with activation codes in teh database. When the activation code is not correct I would like to reset the field and require the user to enter the correct code.
I try doing this by the following code:
unset($data['activation_code']);
unset($data['member_no_reg']);
JFactory::getApplication()->enqueueMessage('The membership number and activation code does not match', 'error');

The error is displayed and the fields are not saved, but the edit profile form closes and instead the profile is displayed.

Is there any way from the trigger to prevent the edit profile from closing?
Accepted Answer
admin Accepted Answer
Admin
Hi Fredrik,
Yes, try to add this code:
JFactory::getApplication()->setUserState('com_users.edit.profile.redirect',JRoute::_('index.php?option=com_users&view=profile&layout=edit',false));
  1. more than a month ago
  2. Support
  3. # Permalink
Fredrik_Widfeldt Accepted Answer
Pro
Excelent! That works just as I wanted!
Thanks for the superb support!
  1. more than a month ago
  2. Support
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.