-
Notifications
You must be signed in to change notification settings - Fork 0
/
event_wiki.php
executable file
·33 lines (23 loc) · 1023 Bytes
/
event_wiki.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
# Nicholas Mossor Rathmann 2010
if (!defined('MEDIAWIKI')) die('Not an entry point.');
require_once('/files/scripts/commonWebLibrary_eventlogger.php');
define('EVENTLOGGER_VERSION','0.1 May 2010');
$wgServerUser = 1; # User ID to use for logging if no user exists
#$wgExtensionFunctions[] = 'wfSetupUserLoginLog';
$wgExtensionCredits['other'][] = array(
'name' => 'EventLogger',
'author' => 'Nichoals Mossor Rathmann',
'description' => 'Logs events to MySQL',
'url' => '',
'version' => EVENTLOGGER_VERSION
);
$wgHooks['UserLoginComplete'][] = 'wfUserLogin';
#$wgHooks['EditFilter'][] = 'wfUserEditedPage';
function wfUserLogin(&$user) {
return EventLogger::setEvent(strtolower($user->getName()), EventLogger::EVENT_WIKI_LOGIN);
}
function wfUserEditedPage(&$EditPage, $text, &$resultArr) {
global $wgUser;
return EventLogger::setEvent(strtolower($wgUser->getName()), EventLogger::EVENT_WIKI_PAGE_EDIT, array('articleID' => $EditPage->mTitle->mArticleID));
}