• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Changing Usergroup of Registered Users

Changing Usergroup of Registered Users 12 years 3 months ago #20783

  • j.hanby
  • j.hanby's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello all,

I am using the Joomla! Registration Integration and would like to have different Registration forms for different types of users. However, for this to work I need to be able to change what usergroup they are automatically assigned to after submitting their registration. I've been messing around with SQL Mapping to no avail. Does anybody know how else I could go about this?
The administrator has disabled public write access.

Changing Usergroup of Registered Users 9 years 5 months ago #33223

Go into form's proprieties and select "PHP Script", then paste this code into last box:
$user = JFactory::getUser();
$groupId = NEW_GROUP_ID_VALUE_TO_ASSIGN;
JUserHelper::addUserToGroup( $user->id, $groupId );
$app = JFactory::getApplication();
$app->redirect(JRoute::_(JURI::root().'index.php'));
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!