Registering with existing username displays no error message

Started by ymedia, March 04, 2015, 02:01:28 AM

Previous topic - Next topic

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

julos0877

Hello Milbo,

Just installed the new version and the problem is still there.
If I create an account with an username already used and I press the register button, the system comme back to the home shop page without error message.

ReJigged

+1 on this.

Although slight difference in that if user tries to register again with same or existing username we see the page refresh and a message saying 'Please register to checkout' and customer ends up going in circles.

vm3.0.6.2

Will try 3.0.6.3 when stable release.

Dudebaker

I've fixed it... with a dirty hack but hey... if the VM-Developers don't get it run... ;)

J2.5:

libraries\joomla\database\table\user.php [227-228]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_USERNAME_INUSE'));

libraries\joomla\database\table\user.php [241-242]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_EMAIL_INUSE'));


J3:

libraries\joomla\table\user.php [231-233]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_USERNAME_INUSE'));

libraries\joomla\table\user.php [247-259]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_EMAIL_INUSE'));



Edit:
added missing '

ReJigged

Great work. Thanks!

Although you had a missing ' in the first J3 hack

Use:

J3:

libraries\joomla\table\user.php [231-233]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_USERNAME_INUSE'));

libraries\joomla\table\user.php [247-259]
Add this line before the return:
JError::raiseWarning('1', JText::_('JLIB_DATABASE_ERROR_EMAIL_INUSE'));

Dudebaker

I've now tried the latest version (J3.4, VM3.0.6.3) with a clear installation and it seems to be fixed (at least with the default template).
But all input-fields get cleared if there's an error.

At least in J2.5 VM2.6 the input-fields keep the values, even with my hack.

julos0877

Hello All,

Thank you to try to solve this problem.

This hack is working for the Register and checkout page but it does not work if the customer want to create an account before add to cart.
I we try to create an account by using the virtuemart menu "Account maintenance" (eq. http://demo.virtuemart.net/account) we have no error message if the email or username is already used we are redirected to the Shop home page..

Milbo

lol

Quote from: Dudebaker on March 20, 2015, 10:31:45 AM
I've fixed it... with a dirty hack but hey... if the VM-Developers don't get it run... ;)

No, you just did obsolete stuff. Hacking joomla is the worst you can do. Additionally you guys do not tell which joomla version you are using.

It is also fixed already and if you want to understand how I fixed it, learn to use the provided tools, they are there to help you.

http://dev.virtuemart.net/projects/virtuemart/repository/diff/trunk/virtuemart/administrator/components/com_virtuemart/models/user.php?utf8=%E2%9C%93&rev=8777&rev_to=8754

that is the fix.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Dudebaker

Quote from: Milbo on March 22, 2015, 16:05:38 PM
No, you just did obsolete stuff.

That's the reason for calling it dirty... sorry for my nasty words, but such a serious bug which hasn't been fixed since month if not years?

But you're right, I found this lines after trying the latest version but didn't post it.
So guy's change the user.php file from virtuemart/models instead of the user.php file from joomla/libraries.

administrator/components/com_virtuemart/models/user.php [666]
change:
vmError(vmText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED',$user->getError()));
to:
$msg = vmText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED',$user->getError());
vmError($msg,$msg);

julos0877

Up !

Modification is working fine for "Register and checkout" but it does not work for the creation of the new account. Test can be done here : http://demo.virtuemart.net/account
The customer has not to be oblige to buy something to create an account.

It becomes to be a critical issue ! If a customer want to create an account before buy something with an username already used and if he receives no error message during the registration, he will go away !

Milbo

yepp Dudebaker, :-) The funny thing is, I felt in my own "security". vmError shows the info only to the administrator, to prevent that programmers reveal unintended sensitive data.

I must admit I dont understand, why it should not work with vm3.0.4 for the account maintenance, both uses the same model, the same function,...


Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

julos0877

Hey Milbo,

I'm trying to create an account with the same username since the beginning but in fact no new account can be created with the simple registration page.
It works for the Register and Chekout but not for the account maintenance.

Maybe that can help you.

julos0877

Hallo Milbo,

Do you have a status about this topic. Now it's impossible to create a new account by using the virtuemart register form except for the register and checkout.
Did you give up ?

Thanks in advance

Milbo

Quote from: julos08 on March 25, 2015, 14:08:46 PM
Hey Milbo,

I'm trying to create an account with the same username since the beginning but in fact no new account can be created with the simple registration page.
That is intended.

Quote from: julos08 on March 25, 2015, 14:08:46 PM
It works for the Register and Chekout but not for the account maintenance.

As guest it should "work", but you do not register then (check topic)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/