Build an Extended User Info Form Tutorial: Questions

mov2046 18 Jan, 2011
Hi,

I purchased a copy of "Build an Extended User Information Form", and I was able to add new fields to my Joomla registration form and got the values in the params. But, I am running into two issues.

First, I noticed that, on my jos_users table, there were two records for each user who registered. The first record listed out all the info fine. The second record listed out the username, name, and email. However, the password value was not encrypted. The registerDate and lastVisitDate were all 0s. The activation field was empty. The params was empty as well.

Second, when I tried to activate the account via Joomla's user account activation email, I got the following message:

This username/password already in use. Please try another.
Invalid Activation Link!
There is no such account in our database or the account has already been activated.

And, if I tried to manually activate the account via User Manager on Joomla, I couldn't register the user either. I got the following message:

Cannot save the user information
This username is already in use.



Below are the codes that I used in the OnSumit After code box:
<?php
// get the user id saved by the plug-in
$user_id = JRequest::getInt('cf_user_id', 0, 'post');
// get the Joomla! User object for the new user
$user =& JFactory::getUser($user_id);
// get the 'gender' value from the form data
$institution = JRequest::getString('institution', '', 'post');
$state = JRequest::getString('state', '', 'post');
$position = JRequest::getString('position', '', 'post');
// set the 'gender' parameter in the User Object
$user->setParam('institution', $institution);
$user->setParam('state', $state);
$user->setParam('position', $position);
// Save the user object
$user->save();
?>

Please let me know if I might have done something wrong to my Joomla's extended reg form. Thanks.
GreyHead 18 Jan, 2011
Hi mov2046,

The code you have here looks OK - and it should update the existing User info, not add a new user.

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob
GreyHead 18 Jan, 2011
Hi mov2046,

I've taken a very quick look as it's late this evening - but not changed anything so far.

I think that the problem is that you have the DB Connection set to save the data in the jos_user table; this is duplicating the update that is done when the user is created by the Joomla! Registration plug-in.

Please set the DB Connection to 'No' and see if that resolves all of the problems or not.

Bob
This topic is locked and no more replies can be posted.