Page MenuHomeWickedGov Phorge

UserMergeHookHandlers.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

UserMergeHookHandlers.php

<?php
/**
* This file is part of the CentralNotice Extension to MediaWiki
* https://www.mediawiki.org/wiki/Extension:CentralNotice
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
*/
use MediaWiki\Config\Config;
use MediaWiki\Extension\UserMerge\Hooks\AccountFieldsHook;
/**
* All hooks from the UserMerge extension which is optional to use with this extension.
*
* @ingroup Extensions
*/
class UserMergeHookHandlers implements AccountFieldsHook {
private Config $config;
public function __construct(
Config $config
) {
$this->config = $config;
}
/**
* Tell the UserMerge extension where we store user ids
* @param array[] &$updateFields
*/
public function onUserMergeAccountFields( array &$updateFields ): void {
if ( $this->config->get( 'NoticeInfrastructure' ) ) {
// array( tableName, idField, textField )
$updateFields[] = [ 'cn_notice_log', 'notlog_user_id' ];
$updateFields[] = [ 'cn_template_log', 'tmplog_user_id' ];
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Nov 23, 01:21 (3 d, 6 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1e/a6/e1655cdddaaf8fcdae5e6125ce02
Default Alt Text
UserMergeHookHandlers.php (1 KB)

Event Timeline