|
251 | 251 | $v_aliases = str_replace(' ', "\n", $waliases); |
252 | 252 | $result = array_diff($valiases, $aliases); |
253 | 253 | foreach ($result as $alias) { |
254 | | - if (empty($_SESSION['error_msg'])) { |
255 | | - exec (VESTA_CMD."v_delete_mail_account_alias ".$v_username." ".$v_domain." ".$v_account." '".$alias, $output, $return_var); |
| 254 | + if ((empty($_SESSION['error_msg'])) && (!empty($alias))) { |
| 255 | + exec (VESTA_CMD."v_delete_mail_account_alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var); |
256 | 256 | if ($return_var != 0) { |
257 | 257 | $error = implode('<br>', $output); |
258 | 258 | if (empty($error)) $error = 'Error: vesta did not return any output.'; |
|
263 | 263 | } |
264 | 264 | $result = array_diff($aliases, $valiases); |
265 | 265 | foreach ($result as $alias) { |
266 | | - if (empty($_SESSION['error_msg'])) { |
267 | | - exec (VESTA_CMD."v_add_mail_account_alias ".$v_username." ".$v_domain." ".$v_account." '".$alias, $output, $return_var); |
| 266 | + if ((empty($_SESSION['error_msg'])) && (!empty($alias))) { |
| 267 | + exec (VESTA_CMD."v_add_mail_account_alias ".$v_username." ".$v_domain." ".$v_account." '".$alias."'", $output, $return_var); |
268 | 268 | if ($return_var != 0) { |
269 | 269 | $error = implode('<br>', $output); |
270 | 270 | if (empty($error)) $error = 'Error: vesta did not return any output.'; |
|
285 | 285 | $v_fwd = str_replace(' ', "\n", $wfwd); |
286 | 286 | $result = array_diff($vfwd, $fwd); |
287 | 287 | foreach ($result as $forward) { |
288 | | - if (empty($_SESSION['error_msg'])) { |
| 288 | + if ((empty($_SESSION['error_msg'])) && (!empty($forward))) { |
289 | 289 | exec (VESTA_CMD."v_delete_mail_account_forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var); |
290 | 290 | if ($return_var != 0) { |
291 | 291 | $error = implode('<br>', $output); |
|
297 | 297 | } |
298 | 298 | $result = array_diff($fwd, $vfwd); |
299 | 299 | foreach ($result as $forward) { |
300 | | - if (empty($_SESSION['error_msg'])) { |
| 300 | + if ((empty($_SESSION['error_msg'])) && (!empty($forward))) { |
301 | 301 | exec (VESTA_CMD."v_add_mail_account_forward ".$v_username." ".$v_domain." ".$v_account." '".$forward."'", $output, $return_var); |
302 | 302 | if ($return_var != 0) { |
303 | 303 | $error = implode('<br>', $output); |
|
0 commit comments