Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7409214
batchCAAntiSpoof.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
batchCAAntiSpoof.php
View Options
<?php
// Go through all usernames and calculate and record spoof thingies
namespace
MediaWiki\Extension\CentralAuth\Maintenance
;
use
BatchAntiSpoof
;
use
MediaWiki\Extension\CentralAuth\CentralAuthServices
;
use
MediaWiki\Extension\CentralAuth\User\CentralAuthSpoofUser
;
use
Wikimedia\Rdbms\IReadableDatabase
;
// @codeCoverageIgnoreStart
$IP
=
getenv
(
'MW_INSTALL_PATH'
);
if
(
$IP
===
false
)
{
$IP
=
__DIR__
.
'/../../..'
;
}
require_once
"$IP/extensions/AntiSpoof/maintenance/BatchAntiSpoofClass.php"
;
// @codeCoverageIgnoreEnd
class
BatchCAAntiSpoof
extends
BatchAntiSpoof
{
/**
* @param array $items
*/
protected
function
batchRecord
(
$items
)
{
CentralAuthSpoofUser
::
batchRecord
(
CentralAuthServices
::
getDatabaseManager
()->
getCentralPrimaryDB
(),
$items
);
}
/**
* @param int $db
* @param string|string[] $groups
* @param string|bool $wiki
* @return IReadableDatabase
* @suppress PhanParamSignatureMismatch
*/
protected
function
getDB
(
$db
,
$groups
=
[],
$wiki
=
false
)
{
if
(
$db
===
DB_PRIMARY
)
{
return
CentralAuthServices
::
getDatabaseManager
()->
getCentralPrimaryDB
();
}
else
{
return
CentralAuthServices
::
getDatabaseManager
()->
getCentralReplicaDB
();
}
}
/** @inheritDoc */
protected
function
getTableName
()
{
return
'globaluser'
;
}
/** @inheritDoc */
protected
function
getPrimaryKey
()
{
return
'gu_id'
;
}
/** @inheritDoc */
protected
function
getUserColumn
()
{
return
'gu_name'
;
}
/**
* @param string $name
* @return CentralAuthSpoofUser
*/
protected
function
makeSpoofUser
(
$name
)
{
return
CentralAuthServices
::
getAntiSpoofManager
()->
getSpoofUser
(
$name
);
}
}
// @codeCoverageIgnoreStart
$maintClass
=
BatchCAAntiSpoof
::
class
;
require_once
RUN_MAINTENANCE_IF_MAIN
;
// @codeCoverageIgnoreEnd
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 22:22 (1 d, 19 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
52/95/b1bd3aa69df0e75a131379df79a1
Default Alt Text
batchCAAntiSpoof.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment