Adding the below Changes the username of the user to the portion of the email address before the @ sign.
Thought this might be a good patch to add, too.
(Around line 380)
if (empty($user->mail)) {
$newname = substr ($prevname, 0, strpos($form_state['values']['name'], "@") );
$userinfo = array(
'name' => $newname,
'mail' => $form_state['values']['name']
);
user_save($user, $userinfo);
}
Comments
Comment #1
acb commentedWHOOPS!
Posted wrong code:
here it is:
But it doesn't work!
It posts the new(shortened) username into the DB, but it seems impossible to log in with the drupal Username, and seems to be setting the password to something random, rather than the password that authenticates from OSCommerce...
Am I missing something? I think it is not so secure to post the username AS email address in the drupal side of the site.
Ideas?
Comment #2
acb commentedOK:
FIXED IT.
Changed a few things:
around line 380
delete this line
so it reads
My entire module file (just in case):