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

Change to Version 1.0.7 (Note: Tested with postgresql and mysql only on versions 1.10.0 and 1.11.0 only)
 * Fixed update timestamp query to be database agnostic for MediaWiki Version >=1.6

Change to Version 1.1.0
 * Separate file for i18n and a better i18n code
 * Added Dutch (nl) translation
 * Starting French (fr) and Latin (la) translations
 * Better English messages
 * New directory 'extensions/SpecialLastUserLogin/' for holding the new i18n file and the normal file together

Changing configuration
Add the following line to LocalSettings.php:

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

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

';   $wgOut->addHTML( $out ); } }  SpecialPage::addPage( new SpecialLastUserLogin ); global $wgMessageCache, $wgSpecialLastUserLoginMessages; require_once( 'SpecialLastUserLogin.i18n.php'); foreach( $wgSpecialLastUserLoginMessages as $key => $value ) { $wgMessageCache->addMessages( $wgSpecialLastUserLoginMessages[$key], $key );} }