Update LoginForm.class.php

if the usernamefield is an email, save it as email for the registration not as username