add test of smtp config before trying to send email on registration
add username in admin.php
optimize sql on admin.php