Skip to content

Commit a0d4354

Browse files
committed
custom mail url
1 parent c60bda6 commit a0d4354

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

web/add/mail/index.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,16 @@
139139
}
140140

141141
if (empty($_SESSION['error_msg'])) {
142+
exec (VESTA_CMD."v-list-sys-config json", $output, $return_var);
143+
$sys = json_decode(implode('', $output), true);
144+
unset($output);
145+
142146
list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
147+
$webmail = "http://".$http_host."/webmail/";
148+
if (!empty($sys['config']['MAIL_URL'])) $webmail = $sys['config']['MAIL_URL'];
149+
143150
$_SESSION['ok_msg'] = __('MAIL_ACCOUNT_CREATED_OK',$_POST['v_account'],$_POST[v_domain],$_POST['v_account'],$_POST[v_domain]);
144-
$_SESSION['ok_msg'] .= " / <a href=http://".$http_host."/webmail target='_blank'>" . __('open webmail') . "</a>";
151+
$_SESSION['ok_msg'] .= " / <a href=".$webmail." target='_blank'>" . __('open webmail') . "</a>";
145152
unset($v_account);
146153
unset($v_password);
147154
unset($v_password);

web/list/mail/index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
// Data
1515
if (empty($_GET['domain'])){
16+
17+
// SYS
18+
exec (VESTA_CMD."v-list-sys-config json", $output, $return_var);
19+
$sys = json_decode(implode('', $output), true);
20+
unset($output);
21+
1622
exec (VESTA_CMD."v-list-mail-domains $user json", $output, $return_var);
1723
$data = json_decode(implode('', $output), true);
1824
$data = array_reverse($data, true);

web/templates/admin/list_mail.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
<table class="data">
3232
<?php
3333
list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
34+
$webmail = "http://".$http_host."/webmail/";
35+
if (!empty($sys['config']['MAIL_URL'])) $webmail = $sys['config']['MAIL_URL'];
36+
3437
foreach ($data as $key => $value) {
3538
++$i;
3639
if ($data[$key]['SUSPENDED'] == 'yes') {
@@ -81,7 +84,7 @@
8184
<?php print __('edit');?>
8285
</span>
8386
</a>
84-
<a href="<?php echo "http://".$http_host."/webmail/"; ?>" target="_blank" class="data-controls">
87+
<a href="<?php echo $webmail; ?>" target="_blank" class="data-controls">
8588
<span>
8689
<img src="/images/new_window.png" width="8px" height="8px">
8790
<?php print __('open webmail');?>

web/templates/user/list_mail.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
<table class="data">
3030
<?php
3131
list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"] . ":");
32+
$webmail = "http://".$http_host."/webmail/";
33+
if (!empty($sys['config']['MAIL_URL'])) $webmail = $sys['config']['MAIL_URL'];
34+
3235
foreach ($data as $key => $value) {
3336
++$i;
3437
if ($data[$key]['SUSPENDED'] == 'yes') {
@@ -67,7 +70,7 @@
6770
<?php print __('edit');?>
6871
</span>
6972
</a>
70-
<a href="<?php echo "http://".$http_host."/webmail/"; ?>" target="_blank" class="data-controls">
73+
<a href="<?php echo $webmail; ?>" target="_blank" class="data-controls">
7174
<span>
7275
<img src="/images/new_window.png" width="8px" height="8px">
7376
<?php print __('open webmail');?>

0 commit comments

Comments
 (0)