Skip to content

Commit 70b3c21

Browse files
authored
Revert Changes
1 parent e0a23f2 commit 70b3c21

19 files changed

Lines changed: 971 additions & 1337 deletions

config/var/www/admin/control-panel/api.php

Lines changed: 966 additions & 96 deletions
Large diffs are not rendered by default.

config/var/www/admin/control-panel/classes/BaseController.php

Lines changed: 0 additions & 82 deletions
This file was deleted.

config/var/www/admin/control-panel/classes/Router.php

Lines changed: 0 additions & 75 deletions
This file was deleted.

config/var/www/admin/control-panel/classes/SystemCommand.php

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public static function getNetworkIP() {
7171
* @return string Service status output
7272
*/
7373
public static function getServiceStatus($service) {
74-
// Validate service name (alphanumeric, dash, underscore only, and dots)
75-
if (!preg_match('/^[a-zA-Z0-9_\.\-]+$/', $service)) {
74+
// Validate service name (alphanumeric, dash, underscore only)
75+
if (!preg_match('/^[a-zA-Z0-9_-]+$/', $service)) {
7676
return false;
7777
}
7878

@@ -81,23 +81,6 @@ public static function getServiceStatus($service) {
8181
return self::execute($command);
8282
}
8383

84-
/**
85-
* Check if service is active (lightweight check)
86-
* @param string $service Service name (validated)
87-
* @return bool True if active, false otherwise
88-
*/
89-
public static function isServiceActive($service) {
90-
// Validate service name (alphanumeric, dash, underscore only, and dots)
91-
if (!preg_match('/^[a-zA-Z0-9_\.\-]+$/', $service)) {
92-
return false;
93-
}
94-
95-
// Input is validated with regex pattern before this call
96-
$command = sprintf('systemctl is-active %s 2>/dev/null', escapeshellarg($service)); // codacy:ignore - escapeshellarg() required for shell command safety, input validated
97-
$output = self::execute($command);
98-
return $output === 'active';
99-
}
100-
10184
/**
10285
* Get Nginx version
10386
* @return string Nginx version output

config/var/www/admin/control-panel/controllers/ActivityController.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

config/var/www/admin/control-panel/controllers/ExternalServicesController.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

config/var/www/admin/control-panel/controllers/MonitoringController.php

Lines changed: 0 additions & 75 deletions
This file was deleted.

config/var/www/admin/control-panel/controllers/SecurityController.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)