Skip to content

Commit 89e826a

Browse files
author
Kristan Kenney
committed
Update webmail URL
1 parent 5fb5e2c commit 89e826a

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

web/add/mail/index.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,8 @@
5252

5353
// Set domain name to lowercase and remove www prefix
5454
$v_domain = preg_replace("/^www./i", "", $_POST['v_domain']);
55+
$v_domain = escapeshellarg($v_domain);
5556
$v_domain = strtolower($v_domain);
56-
exec (HESTIA_CMD."v-list-mail-domain ".$user." ".escapeshellarg($v_domain)." json", $output, $return_var);
57-
$data = json_decode(implode('', $output), true);
58-
unset($output);
59-
$v_webmail_alias = $data[$v_domain]['WEBMAIL_ALIAS'];
6057

6158
// Add mail domain
6259
if (empty($_SESSION['error_msg'])) {
@@ -170,6 +167,13 @@
170167
unset($output);
171168
}
172169

170+
// Get webmail url
171+
if (empty($_SESSION['error_msg'])) {
172+
list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":");
173+
$webmail = "http://".$hostname."/".$v_webmail_alias."/";
174+
if (!empty($_SESSION['WEBMAIL_ALIAS'])) $webmail = $_SESSION['WEBMAIL_ALIAS'];
175+
}
176+
173177
// Email login credentials
174178
if ((!empty($v_send_email)) && (empty($_SESSION['error_msg']))) {
175179
$to = $v_send_email;

web/templates/admin/add_mail_acc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
</tr>
191191
<tr>
192192
<td><?=__('Webmail URL')?>:</td>
193-
<td><div><a class="vst" href="<?=$v_webmail_alias?>" target="_blank"><?=$v_webmail_alias?> <i></i></a></div></td>
193+
<td><div><a class="vst" href="http://<?=$v_webmail_alias?>" target="_blank">http://<?=$v_webmail_alias?> <i></i></a></div></td>
194194
</tr>
195195
</table>
196196
</div>

web/templates/admin/edit_mail_acc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
</tr>
202202
<tr>
203203
<td><?=__('Webmail URL')?>:</td>
204-
<td><div><a class="vst" href="<?=$v_webmail_alias?>" target="_blank"><?=$v_webmail_alias?> <i></i></a></div></td>
204+
<td><div><a class="vst" href="http://<?=$v_webmail_alias?>" target="_blank">http://<?=$v_webmail_alias?> <i></i></a></div></td>
205205
</tr>
206206
</table>
207207
</div>

0 commit comments

Comments
 (0)