VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Quality & Testing VirtueMart 1.1.x => Virtuemart 1.1 Development (Archiv) => Q&T Resolved => Topic started by: sobers_2002 on September 16, 2008, 21:06:05 PM

Title: username is editable
Post by: sobers_2002 on September 16, 2008, 21:06:05 PM
Hi,

I found that a user can change his username after registration from the a/c maintenance panel. I am pretty sure this is not desirable for most of the shop owners as a practice.

Description:
Editable username field in the account maintenance panel

Virtuemart Version:
1.1.2

Joomla Version:
1.5.6

Steps to replicate:
Just go to account maintenance after logging in

Proposed fixes:

It can be fixed with the following code edit in account.billing.php below // Handle NO_REGISTRATION
$skip_fields = array();
if ( VM_REGISTRATION_TYPE != 'NO_REGISTRATION' ) {
global $default;
$default['email'] = $db->f('user_email');
$skip_fields = array( 'username', 'password', 'password2' );
}


add // Handle no username edit for registered
if ($auth['user_id']) {
global $default;
$default['email'] = $db->f('user_email');
$skip_fields = array( 'username' );
}


This prevents registered from changing their username from the account panel.

System Info:
Dreamhost
Title: Re: username is editable
Post by: aravot on October 14, 2008, 00:07:45 AM
This is not necessary, in Virtuemart administration 'Manage User Fields' you can set any field 'read only'
Title: Re: username is editable
Post by: sobers_2002 on October 14, 2008, 12:37:19 PM
You're absolutely correct! I never saw this option while going through the options :)

Thank you!

If this would be the default option, it would be very convenient.