function custom_user($op, &$edit, &$account, $category=NULL) { switch($op) { case 'validate': if(is_array($account)) // checking to make sure we're only doing this on register. { $edit['profile_name'] = $edit['name']; // setting profile name as username (name) $edit['name'] = $edit['mail']; // setting username (name) as mail address } break; } }