I use Codeigniter framework + Tank_Auth registiration library. They work great but I just need to change register form a bit.
I want to generate username from email address instead of getting it from registeration form. I added a simple function to libraries/Tank_auth.php file. Here is my username generator function:
function _create_username_from_email($email)
{
$user = strstr($email, '@', true); // As of PHP 5.3.0
return $user;
}
Please let me know where I need to run my function and write it to database.
I will also need to remove username field from register form. So I need how I can pass form validation for username field in my controller.
I will be really happy if any of you can help me about these problem.
Thanks