Unfortunately, the username and password you have entered do not match!

Registration

Unfortunately, this username is already taken!

Unfortunately, this e-mail address is already used!

Please retype the verification code.

All fields are required

can rs forms be used to register a new site user?

Welcome, Guest
Username Password: Remember me

can rs forms be used to register a new site user?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: can rs forms be used to register a new site user?

can rs forms be used to register a new site user? 3 years, 2 months ago #6706

Is it possible to use rs forms to register new users to your joomla site
Last Edit: 2 years, 10 months ago by Bogdan Nicolae.

Re:can rs forms be used to register a new site user? 3 years, 2 months ago #6791

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

thanks.

Re:can rs forms be used to register a new site user? 3 years, 2 months ago #6814

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

Re:can rs forms be used to register a new site user? 2 years, 8 months ago #8398

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 1.5.6
RSTickets!
RSFormPro!
RSEvents!

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

  • Leolll
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
Replace:
global $database;


With this:
$database =& JFactory::getDBO();

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

Mapping Plugin for user registration 2 years, 7 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.

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

  • gm
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
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...

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

@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

Re:can rs forms be used to register a new site user? 2 years, 6 months ago #8879

  • Samklu
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
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: 2 years, 6 months ago by Samklu.

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

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?
"If I wanted a stable machine I would build an inclined plane."

Re:can rs forms be used to register a new site user? 2 years, 1 month 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?

Re:can rs forms be used to register a new site user? 1 year, 8 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

Re:can rs forms be used to register a new site user? 1 year, 8 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

Re:can rs forms be used to register a new site user? 1 year, 7 months ago #11721

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

Re:can rs forms be used to register a new site user? 1 year, 6 months ago #11857

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>
"If I wanted a stable machine I would build an inclined plane."
Last Edit: 1 year, 6 months ago by Stephen Nims. Reason: added placeholders for further explanation

Re:can rs forms be used to register a new site user? 1 year, 3 months ago #12760

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

Re:can rs forms be used to register a new site user? 1 year, 3 months ago #12770

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

Re:can rs forms be used to register a new site user? 1 year, 2 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?

Re:can rs forms be used to register a new site user? 1 year, 2 months ago #13020

  • Dave
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
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.

Re:can rs forms be used to register a new site user? 1 year, 1 month ago #13183

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

Re:can rs forms be used to register a new site user? 1 year, 1 month ago #13296

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();
}
 

Re:can rs forms be used to register a new site user? 1 year ago #13503

  • Pam
  • 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.

Re:can rs forms be used to register a new site user? 1 year ago #13580

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();
}
 

Re:can rs forms be used to register a new site user? 4 months, 1 week ago #16012

Muito obrigado, isso foi uma grande ajuda! Thanks!

Re:can rs forms be used to register a new site user? 5 hours, 1 minute ago #0

Hello,
This is an automatically generated message.
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 wish to receive our 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: http://www.rsjoomla.com/support-policy.html.

Thank You!
PLEASE NOTE: This topic is NOT locked and you can add replies to it. Other users are free to reply as well. This message has been generated by a bot and has no effect on the topic whatsoever.
  • Page:
  • 1
Time to create page: 2.31 seconds
Feedback