Buy Now
Sign in

Joomla Login and Save User not working after update

rmpaolillo , December 12 2017
Answered
rmpaolillo
Hi Max,

do not know if this has been reported, but I have noticed that from a certain point in time (maybe after the previous 2 updates) all my "custom" joomla login made with chronoforms stopped working.

The registration process is smooth (it generates the database rows and password hashes correctly) but at the custom "login" endpoint (created with chronoforms) I get the "username/password" error.

If I copy and paste a password hash from a use created before the problem, and that logins without any issue, I can login correctly.

I have noticed this problem since a week now and I have waited before posting this...

How come?

Marco
Ruggiero Marco Paolillo
rmpaolillo
After debugging I have noticed that the hash generated is different from that saved in the DB.
Array
(
[validate_fields2] => Array
(
[log] => Automatic validation enabled.
[var] => 1
)

[php12] => Array
(
[returned] => $2y$10$Mrru9rwPzi9AFOlWsp2OvOqzsrFb0X5NQApmwZiBST5U9CVtJ8OzO
[var] => $2y$10$Mrru9rwPzi9AFOlWsp2OvOqzsrFb0X5NQApmwZiBST5U9CVtJ8OzO
)

[joomla_user3] => Array
(
[_success] => User saved successfully under id 998
[var] => Array
(
[name] => Ruggiero Marco Paolillo
[username] => rmpaolillo
[email] => rmpaolillo@libero.it
[password] => $2y$10$50CDvjKAAY6dG3uc4NzyveFz3ztSvWeaUX6wNO76XC9dvGNIBIxpK
[block] => 1
[activation] => e384fde6-0f89-4922-8120-fb653ad9a31b
[registerDate] => 2017-12-12 12:16:14
[id] => 998
)

)


Moreover I have generated in the php12 custom code...

    $password = $this->data["password"];     
$hash = JUserHelper::hashPassword($password);
return $hash;


As a matter of fact if I copy and paste the hash generated by the php12 custom code I can login successfully.
None of the hashes generated in the submit action (both that visible in the debug action and that written in the database) work.

Hope this helps for any help that is always welcome.

Marco
Ruggiero Marco Paolillo
rmpaolillo
The only "workaround" at the moment is to use a Save Data action with update action on the "success" event of "joomla_user" action.
But I guess this is not what joomla_user is meant to do.
Attachments
Ruggiero Marco Paolillo
GreyHead
Hi Marco,

In a reply to a Contact Us email Max recently posted: "Yes, it looks like there was a small issue with the password saving, I have uploaded an update for the GCore2 library which should appear in your Joomla admin, please apply that and it should fix the issue."

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
rmpaolillo
Thank you Bob.

I have tried with the GCore2 update 2.09 (if I am not wrong), cleared cache an whatever but the problem still remains. At the moment I keep going with the custome code
$password = $this->data["password"]; 
$hash = JUserHelper::hashPassword($password);
return $hash;


and update as in my previous reply.

Marco
Ruggiero Marco Paolillo
Fredolino
Hello,

I have exactly the same problem. Where exactly did you insert your code?
The screen is unfortunately not readable.

Best regards
F.
rmpaolillo
Do not open the image. Download it and you will see the screenshot in real size with any imaging vieweing software.
Of course you have to zoom in.
OK I have uploaded a demo form for any of you may need this.
Attachments
register_13_Dec_2017_08_27_12.cf6bak
(17.97 KiB)
51 Downloads/Views
Ruggiero Marco Paolillo
jj135
Hi! I am having the same issue with my registration form (action). The password is saved incorrectly somehow. After filling in the same password from the user component in the CMS the password does work. But the password saved by Chronoforms 6 is not working.

Is this a bug that is being checked / fixed?

Is there a fix for now? We use this on a live site where we have multiple registrations every day, so we need to fix this asap...

Any help is appreciated much.

Kind regards,
Jip
Fredolino
Hi,

Thank you for your help.
I have now tried the script in different places. But without success.
That's because I also use the form as a login at the same time.
I hope there will be a fix soon. Yesterday I searched half the night for the error. :-)
Enclosed a screen of my design view.

Best regards
F.
jj135
I just installed a ChronoengineGcore2 update and unfortunately that did not fix this issue for me... Not sure what version I installed now (2.09?), I do not see a version number in the backend?

Any toughs?
rmpaolillo
Hi,

just have a look at my demo form posted before. It is enclosed in this post.

With a couple of correction/extra code you can make your registration form (in production) works back again.

I am sure Max and Bob will come back quickly back with a definitive fix.

Marco
Ruggiero Marco Paolillo
jj135
Thanks Marco, but our form has a lot more fields and some other custom action. I rather not change the user save function for a more general save data function. I hope Max can fix this soon and release patch and/or new version.
jj135
Hi Marco, I see this topic is marked as 'answered'. But I think it is not yet answered / fixed?
Fredolino
Hi for me is CEGCore2 - library installed in the latest Joomla and CF6 (including last problem update).
The registration worked already yesterday evening. The problem is the logins, which does not work even with a password (eg "pswort4711") entered per hidden or directly in the CF6 login in the password input field.
:-)

F.
rmpaolillo
Well,
the solution I propose is very easy.
Juste create the password hash as joomla does:

$password = $this->data["password"];
$hash = JUserHelper::hashPassword($password);
return $hash;

the code snippet is taken from the official joomla documentation....so not tricks.
And later on on the success event of the joomla user registration I replace the "wrong password" with the "correct one" I generated from the code above. I use a data save action forcing update f password field.

If you have a form in production this is the only solution at the moment.

I have a complicated form too where I store additional information about the users (in another table...) but my proposal just update the password field in the Joomla user table.

If you need more help please post your form without any reference to your production environment and I will be happy to help you.

Marco
Ruggiero Marco Paolillo
rmpaolillo
Yes the problem is in the registration form.

As I said before the solution I propose is very easy....no matter how complicated is your form.

Marco
Ruggiero Marco Paolillo
rmpaolillo
Hi jj135,

well "answered" does not mean "solved".

Bob Janes, citing Max Payne, admitted there is a bug.

So you have two options:
1. wait for the next update (check regularly with updated button in the Joomla admin area).
2. use my workaround.

Best Regards.

Marco
Ruggiero Marco Paolillo
admin
Hello everybody,

Apologizes for the late reply here.

You can find attached the file needed to fix the problem before the next update, the file should be installed using the "Install feature" page in the Chronoforms6 admin area.

As Marco has already posted, the password hash is saved incorrectly and new created users would need to do a password reset in order to login.

Best regards
Attachments
function.joomla_user.zip
(2.88 KiB)
40 Downloads/Views
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
jj135
Hi Max, the fixed worked. Thanks!
Fredolino
Hi,

does the patch work for all?
For me the login only works once after registering. And if I log in again with the stored data, then I get an error message from the Save User function.
It looks as if the user is registered again on the second login.
Has anyone an idea of the reasons why?

Best regards
F.