Extension:LastUserLogin

Last User Login displays a simple table of users and the last time they logged in. This can be useful, if your wiki is used as a knowledge base for outside personnel. If you have a requirement that they check the wiki prior to placing a call or email Last User Login can be used to verify that this policy is being enforced.

Security
While this extension only shows up in the restricted extension list for sysops, there is nothing in the code that authorizes the user to ensure they should be able to view this special page (i.e., 'if you type the path to this extension directly, it will show anyone your user list').

If you only want sysops to be able to see the user information you can add the following code at the top of the execte function (~line 71) JT 04:35, 19 December 2005 (UTC)

Add the following:


 * Thank you for your reference. I built it into the new version. --Thomas Klein 11:42, 20 December 2005 (UTC)

Impact to other functions
Adding a log entry for every user login impacts the script /maintenance/removeUnusedAccounts.php as the script checks for the number of page-edits, image-uploads and log-entries. However you can patch removeUnusedAccounts.php to ignore the first login which is very common for spamming robots:

original

change to that

Modified Version
This is yet another minor modified


 * version of the SpecialLastUserLogin extension by User:Yazheirx.

The following is new in the version:
 * Installation in the path extensions
 * Internationalization of the texts (s. MediaWiki:Lastuserlogin and next)
 * Internationalization of the format of date
 * Internationalization the output of database

Change to Version 1.0.1
 * Make a link to the user page

Change to Version 1.0.2
 * The code checked the user authorizes

Change to Version 1.0.3
 * Fixed problems with varibale $_COOKIE and $PHPSELF
 * Translation to german
 * Insert sytel cellpadding in table

Change to Version 1.0.4
 * Fixed problems with MediaWiki 1.6

Change to Version 1.0.5
 * Fixed some formals problems

Change to Version 1.0.6
 * Specialpage is only display, when user have right 'lastlogin'
 * Change name of COOKIE variable
 * Fixed problem with MediaWiki 1.5.x

Changing configuration
Add the following line to LocalSettings.php:

and expand the rights in LocalSettings.php (sample):

Source Code
Copy the following code in to extensions/SpecialLastUserLogin.php

';   $wgOut->addHTML( $out ); } }  SpecialPage::addPage( new SpecialLastUserLogin ); global $wgMessageCache, $wgLanguageCode; if ($wgLanguageCode == 'de') { $wgMessageCache->addMessage('lastuserlogin' ,'Letzte Anmeldungen'); $wgMessageCache->addMessage('lastuserlogin_userid', 'Anmeldename'); $wgMessageCache->addMessage('lastuserlogin_username', 'Benutzername'); $wgMessageCache->addMessage('lastuserlogin_useremail', 'E-Mail-Adresse'); $wgMessageCache->addMessage('lastuserlogin_lastlogin', 'Letzte Anmeldung'); $wgMessageCache->addMessage('lastuserlogin_daysago', 'Tage'); } else { $wgMessageCache->addMessage('lastuserlogin' ,'Last User Login'); $wgMessageCache->addMessage('lastuserlogin_userid', 'User ID'); $wgMessageCache->addMessage('lastuserlogin_username', 'User Name'); $wgMessageCache->addMessage('lastuserlogin_useremail', 'User Email'); $wgMessageCache->addMessage('lastuserlogin_lastlogin', 'Last Login'); $wgMessageCache->addMessage('lastuserlogin_daysago', 'Days Ago'); } }

?>