From ecd296182e82187958c3e17bb672b5e768398a23 Mon Sep 17 00:00:00 2001 From: dogukanoksuz Date: Wed, 11 Oct 2023 06:29:14 +0000 Subject: [PATCH] fix: WinRM service status --- app/Http/Controllers/API/Server/DetailsController.php | 3 --- app/Http/Controllers/API/Server/UserController.php | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/API/Server/DetailsController.php b/app/Http/Controllers/API/Server/DetailsController.php index 7dba80c6..73606089 100644 --- a/app/Http/Controllers/API/Server/DetailsController.php +++ b/app/Http/Controllers/API/Server/DetailsController.php @@ -184,7 +184,6 @@ public function specs() * @return Application|Factory|View * * @throws GuzzleException - * @throws GuzzleException */ public function topCpuProcesses() { @@ -209,7 +208,6 @@ public function topCpuProcesses() * @return Application|Factory|View * * @throws GuzzleException - * @throws GuzzleException */ public function topMemoryProcesses() { @@ -234,7 +232,6 @@ public function topMemoryProcesses() * @return Application|Factory|View * * @throws GuzzleException - * @throws GuzzleException */ public function topDiskUsage() { diff --git a/app/Http/Controllers/API/Server/UserController.php b/app/Http/Controllers/API/Server/UserController.php index 02a3eb60..fc769194 100644 --- a/app/Http/Controllers/API/Server/UserController.php +++ b/app/Http/Controllers/API/Server/UserController.php @@ -32,6 +32,7 @@ public function __construct() */ public function getLocalUsers() { + $users = []; if (server()->isLinux()) { $output = Command::runSudo( "cut -d: -f1,3 /etc/passwd | egrep ':[0-9]{4}$' | cut -d: -f1" @@ -50,7 +51,7 @@ public function getLocalUsers() } if (server()->isWindows() && server()->canRunCommand()) { - $output = Command::runSudo( + $output = Command::run( 'Get-LocalUser | Where { $_.Enabled -eq $True} | Select-Object Name' ); $output = trim($output); @@ -113,6 +114,7 @@ public function addLocalUser() */ public function getLocalGroups() { + $groups = []; if (server()->isLinux()) { $output = Command::runSudo("getent group | cut -d ':' -f1"); $output = trim($output); @@ -130,7 +132,7 @@ public function getLocalGroups() } if (server()->isWindows() && server()->canRunCommand()) { - $output = Command::runSudo( + $output = Command::run( 'Get-LocalGroup | Select-Object Name' ); $output = trim($output);