loginauth updated with code from Nikolai
Layout change not added to all pages.
Query file corrected to require the right path