[SOLVED] Password fields at profile update required

12 years 10 months ago - 12 years 10 months ago #168045 by vipzeus
Hello everybody

I have a big problem with user profile update.
At my site i use CB subs with sql action and cb queries because for many sites i use a unique registration from principal site. Everything works perfectly exept when user gone to modify them profile.

Some times users does not change the password so the field remain empty and CB queries send empty data (ext. DB UPDATE #__users SET `name`='[firstname] [lastname]', `username`='[username]', `email`='[email]', `password`=MD5('[password]') WHERE `id`='[user_id]')
Users can not login at the childrens sites when password miss.

I would like to know if there are way to do REQUIRED the password field at the profile update.

Please Log in to join the conversation.

12 years 10 months ago #168070 by krileon
Profile update only stores and checks password if something is supplied, you can't make this required. This feature is available to allow users to change their existing passwords. To force them to change or supply password on each profile update would be cumbersome to the user. Your query should check if this field has been supplied or not in the WHERE statement. Example as follows.
UPDATE `#__users` SET `name` = '[firstname] [lastname]', `username` = '[username]', `email` = '[email]', `password` = MD5( '[password]' ) WHERE `id` = '[user_id]' AND '[password]' != ''

I've no idea why you are performing the above however as when a user updates their profile in CB it also updates that information in Joomlas user table. The above is completely unnecessary.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 10 months ago #168081 by vipzeus
Thanks Krileon

I test the query statement and works properly for me. Now if Password is empty at profil update, query does not send empty datas.

Thank you again

Please Log in to join the conversation.

12 years 10 months ago #168591 by vipzeus
ooops... :whistle:

I think does not work properly.

CB Queries does not work anymore. i canceled AND '[password]' != from my string and now works properly. I have the same problem now with empty password fields send at other database...

Please Log in to join the conversation.

12 years 10 months ago #168613 by krileon

AND '[password]' !=


The above should be the following.
AND '[password]' != ''

Please ensure you've included the single brackets with no context indicating blank. Without it your query will fatally error.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 10 months ago - 12 years 10 months ago #168631 by vipzeus
Still not work...

Here is what ecsacly i used:
UPDATE #__users SET `name`='[firstname] [lastname]', `username`='[username]', `email`='[email]', `password`=MD5('[password]') WHERE `id`='[user_id]' AND '[password]' != ''
works properly with:
UPDATE #__users SET `name`='[firstname] [lastname]', `username`='[username]', `email`='[email]', `password`=MD5('[password]') WHERE `id`='[user_id]'
but i still have the problem of empty password.

:unsure:
AND '[password]' != ''

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.275 seconds

Facebook Twitter LinkedIn