Difference between revisions of "Extension:UserLoginLog.php"

From Organic Design wiki
(make a start)
 
m
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<?php
+
{{svn|extensions|UserLoginLog/}}
# Extension:User login log{{Category:Extensions}}{{#Security:*|dev}}{{#Security:view|*}}{{php}}
 
# - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
 
# - Author: [http://www.organicdesign.co.nz/nad User:Nad]{{Category:Extensions created with Template:Extension}}
 
 
 
if (!defined('MEDIAWIKI')) die('Not an entry point.');
 
 
 
define('USER LOGIN LOG_VERSION','1.0.0, 2007-07-26');
 
 
 
$wgExtensionCredits['other'][] = array(
 
'name'        => 'User login log',
 
'author'      => '[http://www.organicdesign.co.nz/nad User:Nad]',
 
'description' => 'Creates a new MediaWiki log for user logins and logout events',
 
'url'        => 'http://www.mediawiki.org/wiki/Extension:User_login_log',
 
'version'    => USER LOGIN LOG_VERSION
 
);
 
 
 
# Add a new log type
 
$wgLogTypes[]                    = 'userlogin';
 
$wgLogNames  ['userlogin']        = 'userloginlogpage';
 
$wgLogHeaders['userlogin']        = 'userloginlogpagetext';
 
$wgLogActions['userlogin/ok']    = 'userlogin-ok';
 
$wgLogActions['userlogin/fail']  = 'userlogin-fail';
 
$wgLogActions['userlogin/logout'] = 'userlogin-logout';
 
 
 
# Add hooks to the login/logout events
 
#$wgHooks
 
 
 
function wfSetupUserLoginLog() {
 
global $wgLanguageCode,$wgMessageCache;
 
if ($wgLanguageCode == 'en') {
 
$wgMessageCache->addMessages(array(
 
'userlogin'            => "User login log",
 
'userloginlogpage'    => "User login log",
 
'userloginlogpagetext' => "This is a log of events associated with users logging in or out of the wiki.",
 
'userlogin/ok'        => "User '''[[User:$1|$1]]''' has successfully logged in.",
 
'userlogin/fail'      => "User '''[[User:$1|$1]]''' failed to logged in.",
 
'userlogin/logout'    => "User '''[[User:$1|$1]]''' has successfully logged out.",
 
'userloginlogentry'    => ""
 
));
 
}
 
 
}
 
?>
 

Latest revision as of 13:30, 17 May 2012

Info.svg This code is in our Git repository here.

Note: If there is no information in this page about this code and it's a MediaWiki extension, there may be something at mediawiki.org.