Просмотр исходного кода

Fix fclose() incorrect variable

fclose() is using incorrect variable $new_conf should be $fp to properly close fopen
Joe Mattos 9 лет назад
Родитель
Сommit
ea85928ab6
1 измененных файлов с 9 добавлено и 9 удалено
  1. 9 9
      web/edit/server/dovecot/index.php

+ 9 - 9
web/edit/server/dovecot/index.php

@@ -30,7 +30,7 @@ if (!empty($_POST['save'])) {
         $new_conf = $mktemp_output[0];
         $fp = fopen($new_conf, 'w');
         fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config']));
-        fclose($new_conf);
+        fclose($fp);
         exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot ".$v_restart, $output, $return_var);
         check_return_code($return_var,$output);
         unset($output);
@@ -43,7 +43,7 @@ if (!empty($_POST['save'])) {
         $new_conf = $mktemp_output[0];
         $fp = fopen($new_conf, 'w');
         fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config1']));
-        fclose($new_conf);
+        fclose($fp);
         exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-1 " .$v_restart, $output, $return_var);
         check_return_code($return_var,$output);
         unset($output);
@@ -56,7 +56,7 @@ if (!empty($_POST['save'])) {
         $new_conf = $mktemp_output[0];
         $fp = fopen($new_conf, 'w');
         fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config2']));
-        fclose($new_conf);
+        fclose($fp);
         exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-2 " .$v_restart, $output, $return_var);
         check_return_code($return_var,$output);
         unset($output);
@@ -69,7 +69,7 @@ if (!empty($_POST['save'])) {
         $new_conf = $mktemp_output[0];
         $fp = fopen($new_conf, 'w');
         fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config3']));
-        fclose($new_conf);
+        fclose($fp);
         exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-3 " .$v_restart, $output, $return_var);
         check_return_code($return_var,$output);
         unset($output);
@@ -82,7 +82,7 @@ if (!empty($_POST['save'])) {
         $new_conf = $mktemp_output[0];
         $fp = fopen($new_conf, 'w');
         fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config4']));
-        fclose($new_conf);
+        fclose($fp);
         exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-4 " .$v_restart, $output, $return_var);
         check_return_code($return_var,$output);
         unset($output);
@@ -95,7 +95,7 @@ if (!empty($_POST['save'])) {
         $new_conf = $mktemp_output[0];
         $fp = fopen($new_conf, 'w');
         fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config5']));
-        fclose($new_conf);
+        fclose($fp);
         exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-5 " .$v_restart, $output, $return_var);
         check_return_code($return_var,$output);
         unset($output);
@@ -108,7 +108,7 @@ if (!empty($_POST['save'])) {
         $new_conf = $mktemp_output[0];
         $fp = fopen($new_conf, 'w');
         fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config6']));
-        fclose($new_conf);
+        fclose($fp);
         exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-6 " .$v_restart, $output, $return_var);
         check_return_code($return_var,$output);
         unset($output);
@@ -121,7 +121,7 @@ if (!empty($_POST['save'])) {
         $new_conf = $mktemp_output[0];
         $fp = fopen($new_conf, 'w');
         fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config7']));
-        fclose($new_conf);
+        fclose($fp);
         exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-7 " .$v_restart, $output, $return_var);
         check_return_code($return_var,$output);
         unset($output);
@@ -134,7 +134,7 @@ if (!empty($_POST['save'])) {
         $new_conf = $mktemp_output[0];
         $fp = fopen($new_conf, 'w');
         fwrite($fp, str_replace("\r\n", "\n",  $_POST['v_config8']));
-        fclose($new_conf);
+        fclose($fp);
         exec (VESTA_CMD."v-change-sys-service-config ".$new_conf." dovecot-8 " .$v_restart, $output, $return_var);
         check_return_code($return_var,$output);
         unset($output);