Extension:LastUserLogin: Difference between revisions

From mediawiki.org
Tomfox (talk | contribs)
m added Clear Template
m moved Extension:SpecialLastUserLoginEx to Extension:LastUserLogin over redirect: namefix according to code
(No difference)

Revision as of 11:39, 28 October 2011

MediaWiki extensions manual
SpecialLastUserLoginEx
Release status: stable
Implementation Special page , User activity
Description Displays the last time a user logged in
Author(s) Justin G. Cramer, Danila Ulyanov, Thomas Klein
Latest version 1.2.0 (November 8, 2008)
MediaWiki 1.11 and higher
License GNU General Public License version 2 or later
Download
lastlogin
Quarterly downloads 21 (Ranked 128th)
Translate the LastUserLogin extension if it is available at translatewiki.net

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.

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

 if( CountEdits( $user, false ) == 0 && CountImages( $user, false ) == 0 && CountLogs( $user, false ) ==0 ) {
                        # User has no edits or images, mark them for deletion
                        $del[] = $user;
                        $count++;
                }

change to that

 if( CountEdits( $user, false ) == 0 && CountImages( $user, false ) == 0 && CountLogs( $user, false ) <= 1 ) {
                        # User has no edits or images, mark them for deletion
                        $del[] = $user;
                        $count++;
                }

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

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

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

Changes in version 1.2.0

  • MediaWiki versions older than 1.11 are no longer supported
  • Better standards compliance (see Manual:Coding conventions)
  • Uses class autoloading → less server-intensive than before
  • Internationalization messages are only loaded when needed
  • Indentation fixes; uses now tab indentation rather than messy space indentation

Installation

Changing configuration

Add the following line to LocalSettings.php:

require_once($IP.'/extensions/SpecialLastUserLogin/SpecialLastUserLogin.php');

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

$wgGroupPermissions['sysop']['lastlogin']       = true;

Source Code

See download section in info box.