fix register redirect bug

modified checks for User:withValues and logic for  validate_login and
user.php