Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 15 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
LogTemporaryAccountAccessJob | |
0.00% |
0 / 15 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
run | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace MediaWiki\CheckUser\Jobs; |
4 | |
5 | use Job; |
6 | use MediaWiki\MediaWikiServices; |
7 | |
8 | /** |
9 | * Log when a user views the IP addresses of a temporary account. |
10 | */ |
11 | class LogTemporaryAccountAccessJob extends Job { |
12 | /** |
13 | * @inheritDoc |
14 | */ |
15 | public function __construct( $title, $params ) { |
16 | parent::__construct( 'checkuserLogTemporaryAccountAccess', $params ); |
17 | } |
18 | |
19 | /** |
20 | * @return bool |
21 | */ |
22 | public function run() { |
23 | $services = MediaWikiServices::getInstance(); |
24 | |
25 | $performer = $services |
26 | ->getUserIdentityLookup() |
27 | ->getUserIdentityByName( $this->params['performer'] ); |
28 | $tempUser = $this->params['tempUser']; |
29 | $timestamp = $this->params['timestamp']; |
30 | |
31 | if ( !$performer ) { |
32 | $this->setLastError( 'Invalid performer' ); |
33 | return false; |
34 | } |
35 | |
36 | $logger = $services |
37 | ->get( 'CheckUserTemporaryAccountLoggerFactory' ) |
38 | ->getLogger(); |
39 | $logger->logViewIPs( $performer, $tempUser, $timestamp ); |
40 | |
41 | return true; |
42 | } |
43 | } |