andre 7 месяцев назад
Родитель
Сommit
a5f2986b92
1 измененных файлов с 11 добавлено и 14 удалено
  1. 11 14
      controllers/AccountController.php

+ 11 - 14
controllers/AccountController.php

@@ -84,22 +84,19 @@ class AccountController {
 
         // Create PHP-FPM User
         // /etc/php/8.2/fpm/user.in
-        if ($userExisted != true) {
-            if ($GLOBALS['debug'] == true) {error_log("Writing PHP-FPM Config for : " . $username); }
-            $phpContent = file_get_contents("/etc/php/8.2/fpm/user.in");
-            $phpContent = str_replace("USERNAME", $username, $phpContent);
-            file_put_contents("/etc/php/8.2/fpm/pool.d/" . $username . ".conf", $phpContent);
+        if ($GLOBALS['debug'] == true) {error_log("Writing PHP-FPM Config for : " . $username); }
+        $phpContent = file_get_contents("/etc/php/8.2/fpm/user.in");
+        $phpContent = str_replace("USERNAME", $username, $phpContent);
+        file_put_contents("/etc/php/8.2/fpm/pool.d/" . $username . ".conf", $phpContent);
 
-            if ($GLOBALS['debug'] == true) {error_log("Restarting PHP-FPM : " . $username);}
-            exec('sudo /usr/bin/systemctl reload php8.2-fpm', $phpOutput, $phpReturnCode);
-            if ($phpReturnCode !== 0) {
-                error_log("deploy: ERROR: PHP-FPM reload error, details => " . implode("\n", $phpOutput));
-                http_response_code(500);
-                echo json_encode(['error' => 'Failed to reload PHP-FPM', 'details' => implode("\n", $phpOutput)]);
-                return;
-            }
+        if ($GLOBALS['debug'] == true) {error_log("Restarting PHP-FPM : " . $username);}
+        exec('sudo /usr/bin/systemctl reload php8.2-fpm', $phpOutput, $phpReturnCode);
+        if ($phpReturnCode !== 0) {
+            error_log("deploy: ERROR: PHP-FPM reload error, details => " . implode("\n", $phpOutput));
+            http_response_code(500);
+            echo json_encode(['error' => 'Failed to reload PHP-FPM', 'details' => implode("\n", $phpOutput)]);
+            return;
         }
-
         echo json_encode(['success' => 'User creation successfully','details' => '']);
     }