• 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: can rs forms be used to register a new site user?

can rs forms be used to register a new site user? 15 years 9 months ago #6706

  • kiran.lam
  • kiran.lam's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 1
Is it possible to use rs forms to register new users to your joomla site
Last Edit: 15 years 5 months ago by bogdan.
The administrator has disabled public write access.
The following user(s) said Thank You: desktoplaptoprepair

Re:can rs forms be used to register a new site user? 15 years 9 months ago #6791

Can we please get an answer on this? Several questions in the forum, but no answers...

thanks.
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 15 years 8 months ago #6814

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

A rather basic script would be this ( placed on the Scripts called on form process area ):
if (isset($_POST['form']['username']))
{
	global $database;
	$fullname = $_POST['form']['fullname'];
	$email = $_POST['form']['email'];
	$username = $_POST['form']['username'];
	$password = $_POST['form']['password'];
	$database->setQuery("SELECT `id` FROM #__users WHERE `username`='".$username."'");
	$database->query();
	if ($database->getNumRows() > 0) die('This username is already taken. Please press back and try a different username.');
	$database->setQuery("INSERT INTO #__users (`name`, `username`, `email`, `password`, `usertype`, `block`, `sendEmail`, `gid`, `registerDate`, `lastvisitDate`, `activation`, `params`) VALUES('".$fullname."', '".$username."', '".$email."', '".md5($password)."', '', 0, 0, 18, now(), now(), '', '')");
	$database->query();
	$userid = $database->insertid();
	$database->setQuery("INSERT INTO #__core_acl_aro (`id`, `section_value`, `value`, `order_value`, `name`, `hidden`) VALUES ('', 'users', '".$userid."', 0, '".$fullname."', 0)");
	$database->query();
	$aro_id = $database->insertid();
	$database->setQuery("INSERT INTO #__core_acl_groups_aro_map (`group_id`,`section_value`,`aro_id`) VALUES ('18','','".$aro_id."')");
	$database->query();
exit();
}

This is a simple form that contains these fields:

username, fullname, email, password and s submit button.

I will also add an example form on: www.joomla-form.com/form-examples/form-scripts

Till then, if you submit a ticket to tech support i can send you ca copy of it.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 15 years 3 months ago #8398

  • jlopez6398
  • jlopez6398's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
I have tried to use this code and only get the following error:
Fatal error: Call to a member function setQuery() on a non-object in ...components/com_rsform/controller/functions.php(1047) : eval()'d code on line 8

Any suggestions?
Joomla 2.5.4
RSTickets!
RSFormPro!
RSEvents!
RSFiles!
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 15 years 2 months ago #8532

  • leolll
  • leolll's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
Replace:
global $database;

With this:
$database =& JFactory::getDBO();
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 15 years 2 months ago #8639

Hi, I used this code and it updates the database with the correct values. The only problem on the submission is that it gives me a blank screen and does not go to the thankyou page. Is anybody able to help me out with this?

Thanks in advance
Danny
The administrator has disabled public write access.

Mapping Plugin for user registration 15 years 2 months ago #8718

Well, I learned from another Form Component how insert data directly into tables. RSForms Pro, comes with Mapping plugin allowing you to insert data from your form into an existing table.

I'm trying to do so using Community Builder table and/or Joomla Users table. Still trying but looks the easiest way so far.
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 15 years 2 months ago #8719

If you remove exit(); from the end of the code it will work. But not sure if the exit function is needed for any special reasons...
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 15 years 2 months ago #8727

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
@energy2080 ,

Just remove the exit() statement.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 15 years 1 month ago #8879

  • Boomer
  • Boomer's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi all,

I have tried the code below without the exit statment and it works for me too. However I would like to profite from the occasion (given by Mohammed querry),to ask where could i fnd some documentation regarding the mapping plugin.

Regards,

Sphere
Last Edit: 15 years 1 month ago by Boomer.
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 14 years 9 months ago #10007

  • sjnims
  • sjnims's Avatar
Isn't user registration more complex than simply saving the credentials? Specifically the password...from what I understand the password is stored as an md5 hash of the user supplied password + salt, with the following procedure:

1.) generate 32-character random string and save as salt
2.) save in a temp variable the md5 hash of the user's password concatenated with the salt
3.) save in the database the temp variable concatenated with the salt, separated by a semi-colon

So say the password is 'userpass1', generate the salt, '1234567890qwertyuiopasdfghjklzxc', compute the md5 for the password+salt 'userpass11234567890qwertyuiopasdfghjklzxc', which is 'a8c37942f621f8e2f05e0990423a24e7', then save the following in the jos_user table for this particular user's encrypted password: 'a8c37942f621f8e2f05e0990423a24e7:1234567890qwertyuiopasdfghjklzxc' a.k.a. md5{password+salt}: salt.

How would this be implemented in RSFormPro?
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 14 years 7 months ago #10347

I actually have this working for a client project, but when the value is entered into the hidden field I have created for it, it cuts off everything after the colon.

Any ideas how to allow the entire string to be submitted?
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 14 years 2 months ago #11405

Sphere wrote:
Hi all,

I have tried the code below without the exit statment and it works for me too. However I would like to profite from the occasion (given by Mohammed querry),to ask where could i fnd some documentation regarding the mapping plugin.

Regards,

Sphere

Sphere: here is the page with all of the plugins for RSForm!Pro:
www.rsjoomla.com/joomla-plugins/rsform-pro.html

Once there, click on the "Mapping to 3rd Party" link.

Ken
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 14 years 2 months ago #11406

sjnims wrote:
Isn't user registration more complex than simply saving the credentials? Specifically the password...from what I understand the password is stored as an md5 hash of the user supplied password + salt, with the following procedure:

1.) generate 32-character random string and save as salt
2.) save in a temp variable the md5 hash of the user's password concatenated with the salt
3.) save in the database the temp variable concatenated with the salt, separated by a semi-colon

So say the password is 'userpass1', generate the salt, '1234567890qwertyuiopasdfghjklzxc', compute the md5 for the password+salt 'userpass11234567890qwertyuiopasdfghjklzxc', which is 'a8c37942f621f8e2f05e0990423a24e7', then save the following in the jos_user table for this particular user's encrypted password: 'a8c37942f621f8e2f05e0990423a24e7:1234567890qwertyuiopasdfghjklzxc' a.k.a. md5{password+salt}: salt.

How would this be implemented in RSFormPro?

Hi sjnims,

Did you figure out a way to implement this with RSForm!Pro? I'd really like to replace the standard Joomla! user signup form with a customized form, and then capture the data in Salesforce.com (and RSForm!Pro has an integration with SF.com).

RSJoomla! Admins: I bet this would be a good selling feature for RSForm!Pro if you included it as standard functionality.

Thanks,
Ken
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 14 years 1 month ago #11721

  • ashley.barnard
  • ashley.barnard's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 2
I seem to be having trouble with the mappings

I have mapped all the form fields to register a new user within community builder.



but when i submit the form i am not a user, am i missing something
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 14 years 1 month ago #11857

  • sjnims
  • sjnims's Avatar
Did some digging, came up with the following example...it hasn't been tested and does not save data (there are examples on how to save data to a table elsewhere) but should get us started...use from <code> to </code> on the scripts tab in the on form processing text area...
//<code>
 
// Adapted from user registration bind function here: http://api.joomla.org/__filesource/fsource_Joomla-Framework_User_joomlauseruser.php.html#a490
 
// PLACEHOLDER - If logged in, dont show registration form
 
jimport('joomla.user.helper'); // not sure if this line is needed or not
$array = $_POST['form'];
 
// PLACEHOLDER - Check to see if the user is new or not, if new proceed, else display error
 
// If no password provided create the encrypted password
if (empty($array['password'])) {
	$array['password']  = JUserHelper::genRandomPassword();
	$array['password2'] = $array['password'];
}
 
// PLACEHOLDER - Display error if passwords do not match (can also do with javascript)
 
$salt  = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword($array['password'], $salt);
$array['password'] = $crypt.':'.$salt;
 
// Set the registration timestamp
$now =& JFactory::getDate();
$registerDate = $now->toMySql(); // not sure if this is correct syntax
 
// PLACEHOLDER - Check that username is not greater than 150 characters (can also do with javascript)
 
// PLACEHOLDER - Check that password is not greater than 100 characters (can also do with javascript)
 
// PLACEHOLDER - Routine to save data to jos_user and/or other tables
 
//</code>
Last Edit: 14 years 1 month ago by sjnims. Reason: added placeholders for further explanation
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 13 years 9 months ago #12760

  • AK
  • AK's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hello all,

wanna pull out this older thread:

I need a special registration form too. Can anyone update me with the latest news about doing this with RS Form Pro? Any samples available?

Thxs. very much
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 13 years 9 months ago #12770

  • webguy77
  • webguy77's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
nothing ha? so I see the no one has been sucessfull on this.

i am on the new 1.6 Joomla system which engineered different
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 13 years 9 months ago #12887

if (isset($_POST['form']['username']))  
{  
    $database =& JFactory::getDBO();  
    $fullname = $_POST['form']['fname'];  
    $email = $_POST['form']['email'];  
    $username = $_POST['form']['username'];  
    $password = $_POST['form']['password'];  
    $database->setQuery("SELECT `id` FROM #__users WHERE `username`='".$username."'");  
    $database->query();  
    if ($database->getNumRows() > 0) die('This username is already taken. Please press back and try a different username.');  
    $database->setQuery("INSERT INTO #__users (`name`, `username`, `email`, `password`, `usertype`, `block`, `sendEmail`, `gid`, `registerDate`, `lastvisitDate`, `activation`, `params`) VALUES('".$fullname."', '".$username."', '".$email."', '".md5($password)."', '', 1, 0, 18, now(), now(), '', '')");  
    $database->query();  
    $userid = $database->insertid();  
    $database->setQuery("INSERT INTO #__core_acl_aro (`id`, `section_value`, `value`, `order_value`, `name`, `hidden`) VALUES ('', 'users', '".$userid."', 0, '".$fullname."', 0)");  
    $database->query();  
    $aro_id = $database->insertid();  
    $database->setQuery("INSERT INTO #__core_acl_groups_aro_map (`group_id`,`section_value`,`aro_id`) VALUES ('18','','".$aro_id."')");  
    $database->query();  
}

The code works - thank you! But I have my Global Config set to New User Account Activation: Yes. The user is created successfully via the rsform pro but no activation email gets sent.

What script can I add to this so that the user receives the standard email with activation link?
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 13 years 9 months ago #13020

This does not work in J! 1.6. The example forms that were previously linked, do not work either.

Best bet is to create a ticket and hope they have further information on it.

This was one of the major pieces I was looking for when purchasing RSForm Pro.
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 13 years 8 months ago #13183

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

I have posted an example form that it can be downloaded here:

http://www.rsjoomla.com/presentation/registration form.zip

Note this will only work for RSform!Pro revision 36 on 1.5 Joomla! installation.

I will also add a 1.6 example at a later time.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 13 years 8 months ago #13296

  • houfton
  • houfton's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 3
I have been trying this version for J!1.6. It seems to work...
if (isset($_POST['form']['username']))  
{  
    jimport('joomla.user.helper');
    $database =& JFactory::getDBO();  
    $fullname = $_POST['form']['firstname']." ".$_POST['form']['lastname'];  
    $email = $_POST['form']['email'];  
    $username = $_POST['form']['username'];  
    $password = $_POST['form']['password'];  
    $salt = JUserHelper::genRandomPassword(32); 
    $crypt = JUserHelper::getCryptedPassword($password, $salt); 
    $password = $crypt.":".$salt; 
    $database->setQuery("SELECT `id` FROM #__users WHERE `username`='".$username."'");  
    $database->query();  
    if ($database->getNumRows() > 0) die('This username is already taken. Please press back and try a different username.');  
    $database->setQuery("INSERT INTO #__users (`name`, `username`, `email`, `password`, `usertype`, `block`, `sendEmail`, `registerDate`, `lastvisitDate`, `activation`, `params`) VALUES('".$fullname."', '".$username."', '".$email."', '".$password."', 'Registered', 0, 0, now(), now(), '', '')");  
    $database->query();  
    $userid = $database->insertid();  
    $database->setQuery("INSERT INTO #__user_usergroup_map (`user_id`, `group_id`) VALUES ('".$userid."', 2)");  
    $database->query();
}
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 13 years 7 months ago #13503

  • Pam1234
  • Pam1234's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hello,

I have posted an example form that it can be downloaded here:

http://www.rsjoomla.com/presentation/registration form.zip

Note this will only work for RSform!Pro revision 36 on 1.5 Joomla! installation.

I will also add a 1.6 example at a later time.

I cannot get this to install (joomla 1.5). I get "Error! Could not find a Joomla! XML setup file in the package." It has only one file but it's xml. Is it installed like any other extension or plugin or does the xml file content need to be copy/pasted somewhere?

Thanks.
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 13 years 7 months ago #13580

  • adam3
  • adam3's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
kessels1234 wrote:
Hi, I used this code and it updates the database with the correct values. The only problem on the submission is that it gives me a blank screen and does not go to the thankyou page. Is anybody able to help me out with this?
I think all you need to do is comment out the "exit;" line.

Here's my version of the same script re-worked for Joomla 1.6. Note that the form field names need to correspond with whatever you set up in the form:
if (isset($_POST['form']['User_Name'])) 
{ 
    $database =& JFactory::getDBO(); 
    $firstname = $_POST['form']['First_Name'];
    $lastname = $_POST['form']['Last_Name'];
    $fullname = $_POST['form']['First_Name'] . ' ' . $_POST['form']['Last_Name'];
    $email = $_POST['form']['email']; 
    $username = $_POST['form']['User_Name']; 
    $password = $_POST['form']['Password']; 
    $database->setQuery("SELECT `id` FROM #__users WHERE `username`='".$username."'"); 
    $database->query(); 
 
    if ($database->getNumRows() > 0) die('This username is already taken. Please press back and try a different username.'); 
    $database->setQuery("INSERT INTO #__users (`name`, `username`, `email`, `password`, `usertype`, `block`, `sendEmail`, `registerDate`, `lastvisitDate`, `activation`, `params`) VALUES('".$fullname."', '".$username."', '".$email."', '".md5($password)."', 'Registered', 0, 0, now(), now(), '', '')"); 
    $database->query();
 
    $userid = $database->insertid(); 
    $database->setQuery("INSERT INTO #__user_usergroup_map 
    (`user_ID`, `group_ID`) 
    VALUES 
    ('".$userid."', 2)"); 
    $database->query();
 
//exit(); 
} 
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 12 years 11 months ago #16012

  • sintcorp
  • sintcorp's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
Muito obrigado, isso foi uma grande ajuda! Thanks!
The administrator has disabled public write access.

Re:can rs forms be used to register a new site user? 11 years 8 months ago #22193

Hello. There is no such link at that location (about mapping to 3rd party). I am looking for a way to use RSForms to capture data on our site and then transmit that data to a form on another site. In other words, visitor goes to oursite.com and completes a form, which we then transmit to "form" on theirsite.com. The purpose is to monitor registration at theirsite that originates on oursite. Does anyone have any clues or experience or ideas?

The site (oursite) is Joomla 1.5.26.

We receive payments from "theirsite.com" for each customer we refer. Lately they have been failing to pay us unless we specify that "visitor-xxx" is our contact so I want to capture some data. We do not control any code on "theirsite" and they have never executed any coding that they have promised to do over several years.

Right now, we embed their application form on a page on oursite. Our visitors enter our promo code when applying. This is no longer being monitored by "theirsite" so we lose the revenue.
Last Edit: 11 years 8 months ago by randall.prue. Reason: Clarity
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!