| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 50% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | abstract class Admin extends AuthAdminController |
||
| 16 | { |
||
| 17 | const DOMAIN = 'ROOT'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @Injectable |
||
| 21 | * @var \PSFS\base\config\Config Configuration service |
||
| 22 | */ |
||
| 23 | protected $config; |
||
| 24 | /** |
||
| 25 | * @Injectable |
||
| 26 | * @var \PSFS\services\AdminServices Admin service |
||
| 27 | */ |
||
| 28 | protected $srv; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Método estático de login de administrador |
||
| 32 | * @return string HTML |
||
| 33 | * @throws UserAuthException |
||
| 34 | * @throws \PSFS\base\exception\GeneratorException |
||
| 35 | */ |
||
| 36 | 1 | public static function staticAdminLogon() |
|
| 37 | { |
||
| 38 | 1 | if (self::isTest()) { |
|
| 39 | throw new UserAuthException(); |
||
| 40 | } |
||
| 41 | 1 | if (file_exists(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json')) { |
|
| 42 | return AdminServices::getInstance()->setAdminHeaders(); |
||
| 43 | } else { |
||
| 44 | 1 | return UserController::showAdminManager(); |
|
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Método que gestiona el menú de administración |
||
| 50 | * @GET |
||
| 51 | * @route /admin |
||
| 52 | * @visible false |
||
| 53 | * @return string|null |
||
| 54 | */ |
||
| 55 | public function index() |
||
| 58 | } |
||
| 59 | |||
| 61 |