1 | <?php |
||
21 | class UserSecurityReport extends Report |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Columns in the report |
||
26 | * |
||
27 | * @var array |
||
28 | * @config |
||
29 | */ |
||
30 | private static $columns = array( |
||
|
|||
31 | 'ID' => 'User ID', |
||
32 | 'FirstName' => 'First Name', |
||
33 | 'Surname' => 'Surname', |
||
34 | 'Email' => 'Email', |
||
35 | 'Created' => 'Date Created', |
||
36 | 'GroupsDescription' => 'Groups', |
||
37 | 'PermissionsDescription' => 'Permissions', |
||
38 | ); |
||
39 | |||
40 | protected $dataClass = Member::class; |
||
41 | |||
42 | /** |
||
43 | * Returns the report title |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function title() |
||
51 | |||
52 | /** |
||
53 | * Builds a report description which is the current hostname with the current date and time |
||
54 | * |
||
55 | * @return string e.g. localhost/sitename - 21/12/2112 |
||
56 | */ |
||
57 | public function description() |
||
65 | |||
66 | /** |
||
67 | * Returns the column names of the report |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | public function columns() |
||
75 | |||
76 | /** |
||
77 | * Alias of columns(), to support the export to csv action |
||
78 | * in {@link GridFieldExportButton} generateExportFileData method. |
||
79 | * @return array |
||
80 | */ |
||
81 | public function getColumns() |
||
85 | |||
86 | /** |
||
87 | * @return array |
||
88 | */ |
||
89 | public function summaryFields() |
||
93 | |||
94 | /** |
||
95 | * Defines the sortable columns on the report gridfield |
||
96 | * |
||
97 | * @return array |
||
98 | */ |
||
99 | public function sortColumns() |
||
103 | |||
104 | /** |
||
105 | * Get the source records for the report gridfield |
||
106 | * |
||
107 | * @return DataList |
||
108 | */ |
||
109 | public function sourceRecords() |
||
114 | |||
115 | /** |
||
116 | * Restrict access to this report to users with security admin access |
||
117 | * |
||
118 | * @param Member $member |
||
119 | * @return boolean |
||
120 | */ |
||
121 | public function canView($member = null) |
||
125 | |||
126 | /** |
||
127 | * Return a field, such as a {@link GridField} that is |
||
128 | * used to show and manipulate data relating to this report. |
||
129 | * |
||
130 | * @return FormField subclass |
||
131 | */ |
||
132 | public function getReportField() |
||
145 | } |
||
146 |
This check marks private properties in classes that are never used. Those properties can be removed.