RSForm registration and user group assigning

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
acrocephalus
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Tue Sep 24, 2013 7:36 pm

RSForm registration and user group assigning

Post by acrocephalus » Thu Oct 30, 2014 11:05 am

Hello,
How can I assign a user to a specific user group other than registered? For example, under registered groups I have "Member" and "Volunteer", and I need to assign each user to its groups according to the form they use.
Thanks,

Dani

alexpRS
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Mon Mar 23, 2009 7:17 am

Re: RSForm registration and user group assigning

Post by alexpRS » Fri Oct 31, 2014 8:01 am

Hi!

The following article might put you on the right track: http://www.rsjoomla.com/support/documen ... nment.html
http://www.rsjoomla.com
- RSform!Pro - RSFirewall! - RSEvents!Pro - RSSeo! - RSDirectory! - RSMail! - RSBlog!

acrocephalus
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Tue Sep 24, 2013 7:36 pm

Re: RSForm registration and user group assigning

Post by acrocephalus » Fri Oct 31, 2014 9:06 am

I've tried it but I've run into a problem. I have a form named fes-te-soci. Within the form, there is a hidden field named "Usuari" with value "Soci". Also, I have a group of users named Soci. Then, I want to assign the users registered through this form to the Soci's group. I have tried this code from the linked provided:

Code: Select all

list($replace, $with) = RSFormProHelper::getReplacements($SubmissionId);
$userID = str_replace($replace, $with, '{global:userid}');
JUserHelper::setUserGroups($userID, $_POST['form']['Usuari']);
However, it returns an error:

Code: Select all

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 SQL=SELECT `id`, `title` FROM `mpctz_usergroups` WHERE `id` =
When I check the registered users in the Joomla user's area, the new user is assigned to "Registered" users.
Thanks,

Dani

alexpRS
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Mon Mar 23, 2009 7:17 am

Re: RSForm registration and user group assigning

Post by alexpRS » Fri Oct 31, 2014 10:03 am

Are you using other scripts besides the ones mentioned within the article ?
http://www.rsjoomla.com
- RSform!Pro - RSFirewall! - RSEvents!Pro - RSSeo! - RSDirectory! - RSMail! - RSBlog!

acrocephalus
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Tue Sep 24, 2013 7:36 pm

Re: RSForm registration and user group assigning

Post by acrocephalus » Fri Oct 31, 2014 10:27 am

No

alexpRS
Joomla! Intern
Joomla! Intern
Posts: 76
Joined: Mon Mar 23, 2009 7:17 am

Re: RSForm registration and user group assigning

Post by alexpRS » Fri Oct 31, 2014 10:43 am

Try this instead:

Code: Select all

list($replace, $with) = RSFormProHelper::getReplacements($SubmissionId);
$userID = str_replace($replace, $with, '{global:userid}');
$gr = array($_POST['form']['Usuari']);
JUserHelper::setUserGroups($userID, $gr);
http://www.rsjoomla.com
- RSform!Pro - RSFirewall! - RSEvents!Pro - RSSeo! - RSDirectory! - RSMail! - RSBlog!


Locked

Return to “Extensions for Joomla! 3.x”