1 | <?php |
||
22 | class UserSecurityReport extends Report |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * Columns in the report |
||
27 | * |
||
28 | * @var array |
||
29 | * @config |
||
30 | */ |
||
31 | private static $columns = array( |
||
32 | 'ID' => 'User ID', |
||
33 | 'FirstName' => 'First Name', |
||
34 | 'Surname' => 'Surname', |
||
35 | 'Email' => 'Email', |
||
36 | 'Created' => 'Date Created', |
||
37 | 'LastLoggedIn' => 'Last Logged In', |
||
38 | 'GroupsDescription' => 'Groups', |
||
39 | 'PermissionsDescription' => 'Permissions', |
||
40 | ); |
||
41 | |||
42 | protected $dataClass = Member::class; |
||
43 | |||
44 | /** |
||
45 | * Returns the report title |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function title() |
||
53 | |||
54 | /** |
||
55 | * Builds a report description which is the current hostname with the current date and time |
||
56 | * |
||
57 | * @return string e.g. localhost/sitename - 21/12/2112 |
||
58 | */ |
||
59 | public function description() |
||
67 | |||
68 | /** |
||
69 | * Returns the column names of the report |
||
70 | * |
||
71 | * @return array |
||
72 | */ |
||
73 | public function columns() |
||
81 | |||
82 | /** |
||
83 | * Alias of columns(), to support the export to csv action |
||
84 | * in {@link GridFieldExportButton} generateExportFileData method. |
||
85 | * @return array |
||
86 | */ |
||
87 | public function getColumns() |
||
91 | |||
92 | /** |
||
93 | * @return array |
||
94 | */ |
||
95 | public function summaryFields() |
||
99 | |||
100 | /** |
||
101 | * Defines the sortable columns on the report gridfield |
||
102 | * |
||
103 | * @return array |
||
104 | */ |
||
105 | public function sortColumns() |
||
109 | |||
110 | /** |
||
111 | * Get the source records for the report gridfield |
||
112 | * |
||
113 | * @return DataList |
||
114 | */ |
||
115 | public function sourceRecords() |
||
120 | |||
121 | /** |
||
122 | * Restrict access to this report to users with security admin access |
||
123 | * |
||
124 | * @param Member $member |
||
125 | * @return boolean |
||
126 | */ |
||
127 | public function canView($member = null) |
||
131 | |||
132 | /** |
||
133 | * Return a field, such as a {@link GridField} that is |
||
134 | * used to show and manipulate data relating to this report. |
||
135 | * |
||
136 | * @return FormField subclass |
||
137 | */ |
||
138 | public function getReportField() |
||
151 | } |
||
152 |