fixed a bug (missing ;) in authenticate.php and defined usefull constants for valid return codes
made scan create less output and formatted better