andre преди 7 месеца
родител
ревизия
c24c3ab54c
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      controllers/QuotaController.php

+ 4 - 4
controllers/QuotaController.php

@@ -16,9 +16,9 @@ class QuotaController {
         if ($GLOBALS['debug'] == true) {error_log("Get Quota for User: " . $username); }
         exec("sudo /usr/bin/quota -p --hide-device -w $username | tail -n +3 | column -t -n quota -N blocks,soft,hard,grace,inodes,isoft,ihard,igrace -H 5 -J 2>&1", $userOutput, $userReturnCode);
         if ($userReturnCode !== 0) {
-            error_log("getquota: ERROR: Getting Quota for $username failed, details => " . implode("\n", $userOutput));
+            error_log("getquota: ERROR: Getting Quota for $username failed, details => " . implode($userOutput));
             http_response_code(500);
-            echo json_encode(['error' => 'Failed to get user quota', 'details' => implode("\n", $userOutput)]);
+            echo json_encode(['error' => 'Failed to get user quota', 'details' => implode($userOutput)]);
             return;
         }
 //        error_log("DEBUG: Getting Quota for $username  => " . implode("", $userOutput));
@@ -29,9 +29,9 @@ class QuotaController {
         if ($GLOBALS['debug'] == true) {error_log("Getting Quota Stats"); }
         exec("sudo /usr/sbin/xfs_quota -x -c 'report -u' /home | tail -n +7 | column -t -n quota -N user,used,soft,hard,limit,grace -H 5 -J 2>&1", $userOutput, $userReturnCode);
         if ($userReturnCode !== 0) {
-            error_log("getstats: ERROR: Getting Quota Stats failed, details => " . implode("\n", $userOutput));
+            error_log("getstats: ERROR: Getting Quota Stats failed, details => " . implode($userOutput));
             http_response_code(500);
-            echo json_encode(['error' => 'Failed to get quota stats', 'details' => implode("\n", $userOutput)]);
+            echo json_encode(['error' => 'Failed to get quota stats', 'details' => implode($userOutput)]);
             return;
         }
         echo (implode($userOutput));