Skip to main content

Empty field at login

More
10 years 11 months ago #218105 by verzevoul
-- url of the page with the problem -- : www.telchines.gr/
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.4

Hello!
If someone wants to login to buy a product, there are two fields to fill in: 1) email and 2) password.
Now, if i write my email but leave the password field empty, the page loads to the next step of the checkout progress.
For example: [url=http://http://www.telchines.gr/el/top-sellers/checkout] www.telchines.gr/el/top-sellers/checkout [/url]
Try to login without writting a password to see what i mean.
Is there any way to have a popup message in that case?

Thank you in advance

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #218141 by nicolas
Replied by nicolas on topic Empty field at login
Hi,

I tried to look at your checkout on your website but everything is in Greek and I couldn't find a product I could add to the cart.
Could you provide a link to one so that we could look at the situation ?

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago - 10 years 11 months ago #218165 by verzevoul
Replied by verzevoul on topic Empty field at login
www.telchines.gr/index.php?option=com_hi...y_pathway=24&lang=el

click the red button "Προσθήκη στο καλάθι"
and then click the red button at the top right corner "Ολοκλήρωση παραγγελίας"
After that you will go automatically at the checkout page which requires login or register if you want to shop.
Once you are there, try to login like i mentioned previously.

Thank you!
Last edit: 10 years 11 months ago by nicolas.

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #218231 by nicolas
Replied by nicolas on topic Empty field at login
Hi,

I tried to login with an email address and without a password, and I got that error:
take.ms/y7xkQ
So it seems that it's already working like you want no ?

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago - 10 years 11 months ago #218279 by verzevoul
Replied by verzevoul on topic Empty field at login
No, please do the opposite. Blanc email and a random password. I found this public_html/plugins/authentication/joomla/joomla.php
======

public function onUserAuthenticate($credentials, $options, &$response)
{
$response->type = 'Joomla';

// Joomla does not like blank passwords
if (empty($credentials))
{
$response->status = JAuthentication::STATUS_FAILURE;
$response->error_message = JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED');

return;
}
================
from line 32 to 41 that does the job for blanc email.

I tried to change the code there and add the 'password' somehow but , I didnt make it.
Joomla bug I believe but I would really appriciate it if you could paste the correct code.
Last edit: 10 years 11 months ago by verzevoul. Reason: wrong code

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #218321 by verzevoul
Replied by verzevoul on topic Empty field at login
Can I do something like that to make that condition work for username also?
Code:
public function onUserAuthenticate($credentials, $options, &$response) { $response->type = 'Joomla'; // Joomla does not like blank passwords if (empty($credentials['password','username'])) { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED'); return; }


I believe I tried it but it diesn t work

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #218324 by nicolas
Replied by nicolas on topic Empty field at login
Hi,

No, it should be:
Code:
if (empty($credentials['password']) || empty($credentials['username']))

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #218404 by verzevoul
Replied by verzevoul on topic Empty field at login
thanks for the code nikolas!
Unfortunately it doesn t stop to empty username. If you can give it a try...

I have in
public_html/plugins/authentication/joomla/joomla.php
Code:
public function onUserAuthenticate($credentials, $options, &$response) { $response->type = 'Joomla'; // Joomla does not like blank passwords if (empty($credentials['password']) || empty($credentials['username'])) { $response->status = JAuthentication::STATUS_FAILURE; $response->error_message = JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED'); return; }

but still if you try login it goes to step 2

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #218513 by nicolas
Replied by nicolas on topic Empty field at login
Hi,

Ok, then instead, add the line:
Code:
$app->enqueueMessage(JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED'));
after the line:
Code:
}elseif(empty($name) && empty($username) && $messDisplay == 0){
in the file components/com_hikashop/controllers/checkout.php
That should handle that.

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #218592 by verzevoul
Replied by verzevoul on topic Empty field at login
Hi Nicolas!
It did work, just one detail that needs to be fixed, the message is correct but it appears as a success message with green background and letters. Also when the message pops, it's not on the step 0 of the checkout progress, so as result i have to click the button "Επόμενο" to go back to login.
I m sending screenshots to see.

Thank you

Please Log in or Create an account to join the conversation.

More
10 years 10 months ago #218635 by nicolas
Replied by nicolas on topic Empty field at login
Hi,

Then, add that code instead:
Code:
$app->enqueueMessage(JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED'),'error'); return false;

Please Log in or Create an account to join the conversation.

Time to create page: 0.220 seconds
Powered by Kunena Forum