Serghey Rodin 12 лет назад
Родитель
Сommit
a0d4354b38

+ 8 - 1
web/add/mail/index.php

@@ -139,9 +139,16 @@ if (!empty($_POST['ok_acc'])) {
         }
 
         if (empty($_SESSION['error_msg'])) {
+            exec (VESTA_CMD."v-list-sys-config json", $output, $return_var);
+            $sys = json_decode(implode('', $output), true);
+            unset($output);
+
             list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
+            $webmail = "http://".$http_host."/webmail/";
+            if (!empty($sys['config']['MAIL_URL'])) $webmail = $sys['config']['MAIL_URL'];
+
             $_SESSION['ok_msg'] = __('MAIL_ACCOUNT_CREATED_OK',$_POST['v_account'],$_POST[v_domain],$_POST['v_account'],$_POST[v_domain]);
-            $_SESSION['ok_msg'] .= " / <a href=http://".$http_host."/webmail target='_blank'>" . __('open webmail') . "</a>";
+            $_SESSION['ok_msg'] .= " / <a href=".$webmail." target='_blank'>" . __('open webmail') . "</a>";
             unset($v_account);
             unset($v_password);
             unset($v_password);

+ 6 - 0
web/list/mail/index.php

@@ -13,6 +13,12 @@ top_panel($user,$TAB);
 
 // Data
 if (empty($_GET['domain'])){
+
+    // SYS
+    exec (VESTA_CMD."v-list-sys-config json", $output, $return_var);
+    $sys = json_decode(implode('', $output), true);
+    unset($output);
+
     exec (VESTA_CMD."v-list-mail-domains $user json", $output, $return_var);
     $data = json_decode(implode('', $output), true);
     $data = array_reverse($data, true);

+ 4 - 1
web/templates/admin/list_mail.html

@@ -31,6 +31,9 @@
             <table class="data">
                 <?php
                     list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
+                    $webmail = "http://".$http_host."/webmail/";
+                    if (!empty($sys['config']['MAIL_URL'])) $webmail = $sys['config']['MAIL_URL'];
+
                     foreach ($data as $key => $value) {
                         ++$i;
                         if ($data[$key]['SUSPENDED'] == 'yes') {
@@ -81,7 +84,7 @@
                                 <?php print __('edit');?> 
                             </span>
                         </a>
-                        <a href="<?php echo "http://".$http_host."/webmail/"; ?>" target="_blank" class="data-controls">
+                        <a href="<?php echo $webmail; ?>" target="_blank" class="data-controls">
                             <span>
                                 <img src="/images/new_window.png" width="8px" height="8px">
                                 <?php print __('open webmail');?> 

+ 4 - 1
web/templates/user/list_mail.html

@@ -29,6 +29,9 @@
             <table class="data">
                 <?php
                     list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"] . ":");
+                    $webmail = "http://".$http_host."/webmail/";
+                    if (!empty($sys['config']['MAIL_URL'])) $webmail = $sys['config']['MAIL_URL'];
+
                     foreach ($data as $key => $value) {
                         ++$i;
                         if ($data[$key]['SUSPENDED'] == 'yes') {
@@ -67,7 +70,7 @@
                                 <?php print __('edit');?> 
                             </span>
                         </a>
-                        <a href="<?php echo "http://".$http_host."/webmail/"; ?>" target="_blank" class="data-controls">
+                        <a href="<?php echo $webmail; ?>" target="_blank" class="data-controls">
                             <span>
                                 <img src="/images/new_window.png" width="8px" height="8px">
                                 <?php print __('open webmail');?>