I've started recreating an application for my employer that was built with a "drag n drop" software that created horrible code. With that being said, here is what I'm trying to do.
I have a login page that uses LDAP authentication (which works great). I'm trying to do a secondary query before the user is taken to the page they requested. After a user has been authenticated in AD, I need to query another database to see if their usernname exists in it and then see if their account is active. I then need to direct them to the appropriate page to explain why they can't login if either one of the items fail.