1 | <?php |
||
10 | class AdminServices extends Service{ |
||
11 | |||
12 | /** |
||
13 | * @Inyectable |
||
14 | * @var \PSFS\base\config\Config Servicio de configuración |
||
15 | */ |
||
16 | protected $config; |
||
17 | /** |
||
18 | * @Inyectable |
||
19 | * @var \PSFS\base\Security Servicio de autenticación |
||
20 | */ |
||
21 | protected $security; |
||
22 | /** |
||
23 | * @Inyectable |
||
24 | * @var \PSFS\base\Template Servicio de gestión de plantillas |
||
25 | */ |
||
26 | protected $tpl; |
||
27 | |||
28 | /** |
||
29 | * Servicio que devuelve las cabeceras de autenticación |
||
30 | * @return string HTML |
||
31 | */ |
||
32 | 1 | public function setAdminHeaders() |
|
33 | { |
||
34 | 1 | $platform = trim(Config::getInstance()->get("platform_name")); |
|
35 | 1 | header('HTTP/1.1 401 Unauthorized'); |
|
36 | header('WWW-Authenticate: Basic Realm="' . $platform. '"'); |
||
37 | echo _("Zona restringida"); |
||
38 | exit(); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Servicio que devuelve los administradores de la plataforma |
||
43 | * @return array|mixed |
||
44 | */ |
||
45 | public function getAdmins() |
||
58 | |||
59 | /** |
||
60 | * Servicio que parsea los administradores para mostrarlos en la gestión de usuarios |
||
61 | * @param array $admins |
||
62 | */ |
||
63 | private function parseAdmins(&$admins) |
||
80 | |||
81 | /** |
||
82 | * Servicio que lee los logs y los formatea para listarlos |
||
83 | * @return array |
||
84 | */ |
||
85 | public function getLogFiles() |
||
106 | |||
107 | /** |
||
108 | * Servicio que parsea el fichero de log seleccionado |
||
109 | * @param string|null $selectedLog |
||
110 | * |
||
111 | * @return array |
||
112 | */ |
||
113 | public function formatLogFile($selectedLog) |
||
146 | |||
147 | /** |
||
148 | * Servicio que trata la línea del log para procesarle en el front end |
||
149 | * @param $line |
||
150 | * @param $match |
||
151 | * |
||
152 | * @return array |
||
153 | */ |
||
154 | private function parseLogLine($line, $match) |
||
194 | } |
||
195 |
According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.
}
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.