I have a requirement to prevent users from using the site whilst a database upgrade is in process. We can tell that an upgrade is in progress by checking for the existence of a record in a specific table.
What I would like to happen is for the user to be allowed to log in, but then immediately redirected to a maintenance page and logged out.
Is this a reasonable requirement and if so how should I approach this?