Empty field at login

  • Posts: 1057
  • Thank you received: 11
9 years 1 month ago #218105

-- 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]http://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.

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
9 years 1 month ago #218141

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.

  • Posts: 1057
  • Thank you received: 11
9 years 1 month ago #218165

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: 9 years 1 month ago by nicolas.

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

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
9 years 1 month ago #218231

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.

  • Posts: 1057
  • Thank you received: 11
9 years 1 month ago #218279

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: 9 years 1 month ago by verzevoul. Reason: wrong code

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

  • Posts: 1057
  • Thank you received: 11
9 years 1 month ago #218321

Can I do something like that to make that condition work for username also?

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.

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
9 years 1 month ago #218324

Hi,

No, it should be:

if (empty($credentials['password']) || empty($credentials['username']))

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

  • Posts: 1057
  • Thank you received: 11
9 years 1 month ago #218404

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

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.

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
9 years 1 month ago #218513

Hi,

Ok, then instead, add the line:

$app->enqueueMessage(JText::_('JGLOBAL_AUTH_EMPTY_PASS_NOT_ALLOWED'));
after the line:
}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.

  • Posts: 1057
  • Thank you received: 11
9 years 1 month ago #218592

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

Attachments:

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

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
9 years 1 month ago #218635

Hi,

Then, add that code instead:

$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.073 seconds
Powered by Kunena Forum