Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/controllers/CControllerModuleUpdate.php')
-rw-r--r--ui/app/controllers/CControllerModuleUpdate.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/ui/app/controllers/CControllerModuleUpdate.php b/ui/app/controllers/CControllerModuleUpdate.php
index 3fcd763c5c1..f4a8a592df8 100644
--- a/ui/app/controllers/CControllerModuleUpdate.php
+++ b/ui/app/controllers/CControllerModuleUpdate.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types = 0);
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
@@ -26,12 +26,10 @@ class CControllerModuleUpdate extends CController {
/**
* List of modules to update.
- *
- * @var array
*/
- private $modules = [];
+ private array $modules = [];
- protected function checkInput() {
+ protected function checkInput(): bool {
$fields = [
'moduleids' => 'required|array_db module.moduleid',
@@ -49,7 +47,7 @@ class CControllerModuleUpdate extends CController {
return $ret;
}
- protected function checkPermissions() {
+ protected function checkPermissions(): bool {
if (!$this->checkAccess(CRoleHelper::UI_ADMINISTRATION_GENERAL)) {
return false;
}
@@ -65,7 +63,7 @@ class CControllerModuleUpdate extends CController {
return (count($this->modules) == count($moduleids));
}
- protected function doAction() {
+ protected function doAction(): void {
$set_status = ($this->getAction() === 'module.update')
? ($this->hasInput('status') ? MODULE_STATUS_ENABLED : MODULE_STATUS_DISABLED)
: ($this->getAction() === 'module.enable' ? MODULE_STATUS_ENABLED : MODULE_STATUS_DISABLED);
@@ -78,8 +76,8 @@ class CControllerModuleUpdate extends CController {
'preservekeys' => true
]);
- $module_manager = new CModuleManager(APP::ModuleManager()->getModulesDir());
- $module_manager_enabled = new CModuleManager(APP::ModuleManager()->getModulesDir());
+ $module_manager = new CModuleManager(APP::getRootDir());
+ $module_manager_enabled = new CModuleManager(APP::getRootDir());
foreach ($db_modules as $moduleid => $db_module) {
$new_status = array_key_exists($moduleid, $this->modules) ? $set_status : $db_module['status'];