Forums

[solved] Profile page: Userdata not updated in user Database

pat01 13 Jan, 2011
Hi

I use CF to have an extended register form (see this topic here).

This works perfect so far - whenever a new user registers, a new user is createt in the database table jos_users a well.

But if an user later updates his profile (using a CF Form here as well with the Profile Plugin), all data which is stored in the table jos_users is not updated.

For example: If the user changes his password, it's changed in the jos_chronoforms_Register, but not in the jos_users table.
Result: The user must login by using his old password.

I was thinking that the Profile Plugin not only makes sure that new users are created in the jos_users, but updated there as well...?

I hope someone can give me an idea on how to solve this.

Thank you very much.
Regards
Patrick
GreyHead 13 Jan, 2011
Hi Patrick,

Hmm, if you add a second DB Connection to the jos_users table AND you are very careful then you can update most of the user fields this way.

BUT I recommend that you don't so this at all. Much better practice to use the Joomla! User Object to update the User info. That way you can keep it clean and there are some built in protections.

For the password in particular you need to encrypt it correctly and not save the plain-text version.

Much of the code you need can be borrowed from the Joomla! Registration Plug-in.

Bob

PS If you don't mind a few dollars, I wrote most of the basics (including the password code) up here.
pat01 14 Jan, 2011

PS If you don't mind a few dollars, I wrote most of the basics (including the password code) up here.


Hi Bob

No, I don't mind a few dollars for a very helpful tutorial. 😀

I did buy it an implemented your example there, because it comes very close to what I need.

What can I say: Everything works perfect! Those very few dollars did save mit hours of trying (and crying)! 😀

Best regards
Patrick
GreyHead 14 Jan, 2011
Hi Patrick,

Excellent, thank you.

Bob
gbarone 15 Apr, 2011
Hallo,
I just bought the tutorial, because i need to do that exact thing.
but I started coding "before" reading the tutorial, using the "profile page" plugin, which brings me to have a complete detail page with data filled inside my fields (gathered from the additional table, and by the user table).
now i cannot see how to merge this with the tutorial, in order to save data.
in the tutorial you use a different logic to retrieve details from data, so I do not know what happens, it does not seem to work.
maybe should i have to turn off the profile page plugin, and follow only your tutorial?
GreyHead 26 Apr, 2011
Hi gbarone,

The Profile page works in a similar way to the tutorial method for saving information in a new table but automates some of the work for you. Which is the best route does depend on exactly what you need to do.

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