For small intranet MediaWikis, I have written a very short patch which does what
I call auto-login with auto-account-creation by the detected hostname. It uses
php gethostbyaddr()) for intranet MediaWikis in Setup.php and some few lines of
code in user.php and Special:Userlogin and Special:Userlogout.
This patch means, that users are automatically logged-in into their accounts (if
existing) or that such an account is created on-the-fly, when a user visits the
wiki.
A short table such as a plain text file holds a look-up table for
correspondences between hostnames (e.g. IP addresses, personal staff numbers or
something else depending on the intranet structure), full names and perhaps the
email address in the intranet.
The special:login and logout functions are disabled to prevent logging into a
certain user account with other methods than the auto-login. The login and
logout links in the skins are removed, but should a user come across the special
functions by special knowledge, s/he sees a short notice "disabled ..." and is
redirected to the Main_page .
This patch can be enabled or disabled by a global Admin option
$wgHostnameAutoLogin in LocalSettings.php and is potentially useful for
MediaWikis, which run in safe intranet environments: users do not have to learn
how to set up or create user accounts, they are logged-in as they visited the
wiki URL.
Should the hostname detection fail or the hostname being not listed in the
lookup-table, then the visiting user is treated as anonymous user and whitelist
or blacklist options apply according to the wiki installation parameters as before.
Version: 1.4.x
Severity: enhancement