readded partial checkaccess handling from original code

(needed login page when guest accesses pages that need authorization)