CMS  Version 3.9
login_attempts.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("login");
3 
4 $menu_item = "Login Attempts";
5 
7 
8 $attempt->filter = new InclusionFilter("date_received");
9 $attempt->fromGET();
10 $filterForm = new FilterForm($attempt);
11 new DateRangeFilterRenderer($filterForm, "date_received", "", "month");
12 
13 $constraint = $filterForm->getConstraint();
14 
15 $attempts = Query::create(LoginAttempt, "$constraint ORDER BY date_received")->execute();
16 
17 $table = new DataListView($attempts, "login_attempts");
18 $table->column("Username", "<b>{username:htmlSafe}</b>", true)
19  ->column("Date", "{date_received}", true, "text-align: center", null, null, "{date_received:YmdHis}")
20  ->column("IP Address", "{ip_address}", true, "text-align: center")
21  ->column("Login Type", "{login_mode:prettify}", true, "text-align: center")
22  ->column("Result", "{result:prettify}", true, "text-align: center");
23 
24 $table->pageSize = 20;
25 $table->sortable = true;
26 $table->filter = true;
27 $table->emptyMessage = "There have been no login attempts for this time period";
28 $table->excelFile = "login_attempts.xls";
29 
30 $script .= $filterForm->writeScript();
31 $filterForm->drawForm();
32 
33 $script .= $table->writeScript();
34 $table->drawView();
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
$attempt
$constraint
$filterForm
$menu_item
$attempts
$table
$script