Move authentication logic from local.inc into the authentication plugin
There are plenty of code in local.inc that actually belongs to the authentication plugins. While this may be not be the right time to do can we at least try to move that to the authentication plugins when opportunity arise?
On the same page there is a lot of code at the end of local.inc about login in user. This is at best awkward to use with people including the local.inc into other files for the sole purpose of login a user. This would be better if we could move that to its own library.