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

Check webmail alias when editing mail accounts

Kristan Kenney 6 лет назад
Родитель
Сommit
86829f45df
2 измененных файлов с 5 добавлено и 3 удалено
  1. 4 3
      web/add/mail/index.php
  2. 1 0
      web/edit/mail/index.php

+ 4 - 3
web/add/mail/index.php

@@ -53,6 +53,10 @@ if (!empty($_POST['ok'])) {
     // Set domain name to lowercase and remove www prefix
     $v_domain = preg_replace("/^www./i", "", $_POST['v_domain']);
     $v_domain = strtolower($v_domain);
+    exec (HESTIA_CMD."v-list-mail-domain ".$user." ".escapeshellarg($v_domain)." json", $output, $return_var);
+    $data = json_decode(implode('', $output), true);
+    unset($output);
+    $v_webmail_alias = $data[$v_domain]['WEBMAIL_ALIAS'];
 
     // Add mail domain
     if (empty($_SESSION['error_msg'])) {
@@ -78,9 +82,6 @@ if (!empty($_POST['ok_acc'])) {
         exit();
     }
 
-    // Set webmail alias
-    $v_webmail_alias = $data[$v_domain]['WEBMAIL_ALIAS'];
-    
     // Check empty fields
     if (empty($_POST['v_domain'])) $errors[] = __('domain');
     if (empty($_POST['v_account'])) $errors[] = __('account');

+ 1 - 0
web/edit/mail/index.php

@@ -98,6 +98,7 @@ if ((!empty($_GET['domain'])) && (!empty($_GET['account']))) {
     $v_quota = $data[$v_account]['QUOTA'];
     $v_autoreply = $data[$v_account]['AUTOREPLY'];
     $v_suspended = $data[$v_account]['SUSPENDED'];
+    $v_webmail_alias = $data[$v_account]['WEBMAIL_ALIAS'];
     if ( $v_suspended == 'yes' ) {
         $v_status =  'suspended';
     } else {