Completed
Pull Request — master (#526)
by Michael
16:45 queued 06:57
created

StatsInactiveUsers   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
dl 0
loc 50
ccs 0
cts 30
cp 0
rs 10
c 1
b 0
f 0
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 28 2
A isProtected() 0 3 1
A requiresWikiDatabase() 0 3 1
A getPageName() 0 3 1
A getPageTitle() 0 3 1
1
<?php
2
/**************************************************************************
3
**********      English Wikipedia Account Request Interface      **********
4
***************************************************************************
5
** Wikipedia Account Request Graphic Design by Charles Melbye,           **
6
** which is licensed under a Creative Commons                            **
7
** Attribution-Noncommercial-Share Alike 3.0 United States License.      **
8
**                                                                       **
9
** All other code are released under the Public Domain                   **
10
** by the ACC Development Team.                                          **
11
**                                                                       **
12
** See CREDITS for the list of developers.                               **
13
***************************************************************************/
14
15
class StatsInactiveUsers extends StatisticsPage
16
{
17
	protected function execute()
18
	{
19
		global $smarty;
20
21
		// this is horrible.
22
		// yes, there is business logic in the templates
23
		// yes, there was some there before
24
		// yes, I have just added to it.
25
		//
26
		// I'm sorry.
27
		//
28
		// newinternal will fix this.
29
		$date = new DateTime();
30
		$date->modify("-90 days");
31
32
		$smarty->assign('datelimit', $date);
33
34
		$showImmune = false;
35
		if (isset($_GET['showimmune'])) {
36
			$showImmune = true;
37
		}
38
		$smarty->assign("showImmune", $showImmune);
39
40
		$inactiveUsers = User::getAllInactive(gGetDb());
41
42
		$smarty->assign("inactiveUsers", $inactiveUsers);
43
44
		return $smarty->fetch("statistics/inactiveusers.tpl");
45
	}
46
47
	public function getPageName()
48
	{
49
		return "InactiveUsers";
50
	}
51
52
	public function getPageTitle()
53
	{
54
		return "Inactive tool users";
55
	}
56
57
	public function isProtected()
58
	{
59
		return true;
60
	}
61
62
	public function requiresWikiDatabase()
63
	{
64
		return false;
65
	}
66
}
67