Hi,
unfortunately there is not a efficient way to do this, for following reasons:
1) You need to make username available in registration form because it is required by Joomla and it need to be available a value
2) You does not have any user ID because user is still not registered
How to deal with these problems
Problem 1
- you can hide username with a CSS code like
.control-group.username-group {display:none !important;}
- you can assign a temporary random value with a javascript code like
jQuery(document).ready(function(){jQuery('#member-registration #jform_username').val(Math.random().toString(36).substring(7))});
Problem 2
You can change username after user has registered with a plugin:
- Download (at the end of docs page at
http://docs.easy-profile.com/index.php/article/triggers ), install and enable (Extensions->Plugins) skeleton plugin
- Open the edit the file at /plugins/jsn/skeleton/skeleton.php
- Replace entire code with this
<?php
defined('_JEXEC') or die;
class PlgJsnSkeleton extends JPlugin
{
public function triggerProfileUpdate($user, &$data, $changed, $isNew)
{
if($isNew && $user->id > 0)
{
$new_username = 'int'.date(Y).$user->id;
$db = JFactory::getDbo();
$query = 'UPDATE #__users SET username = ' . $db->quote($new_username) . ' WHERE id = '. (int) $user->id;
$db->setQuery($query);
$db->execute();
}
}
}
Other Problems
When a user register an account then it will receive an email with username and password. Unfortunately the email will contain the temp username.
You cannot solve this problem without hack Joomla code (not recommended), so you can only remove login data from generated email with language override.