25 require_once(
"../class/config.php");
26 include_once(
"head.php");
29 "domain_id" => array(
"get",
"integer",null),
30 "target_type" => array(
"post",
"string", null),
31 "target_mail" => array(
"post",
"string", null),
32 "target_domain" => array(
"post",
"string", null),
36 if (is_null($domain_id)) {
37 echo
"<p alert alert-danger>";
38 __(
"Problem with the domain");
40 include_once(
"foot.php");
44 if (!is_null($target_type)) {
45 switch ($target_type) {
47 $error=( ($mail->catchall_del($domain_id))?_(
"Catchall successfully deleted"):
$err->errstr() );
50 $error=( ($mail->catchall_set($domain_id, $target_domain))?_(
"Catchall successfully updated"):
$err->errstr() );
53 $error=( ($mail->catchall_set($domain_id, $target_mail))?_(
"Catchall successfully updated"):
$err->errstr() );
56 $error=_(
"Unknown target type");
60 $catch=$mail->catchall_getinfos($domain_id);
63 <h3><?php printf(_(
"Manage catch-all configuration of %s"),
$catch[
"domain"]); ?></h3>
69 echo
"<p class=\"alert alert-danger\">$error</p>";
72 __(
"You can choose what to do with emails sent to unexisting address of this domain");
76 <form action=
"mail_manage_catchall.php?domain_id=<?php echo $domain_id;?>" method=
"post" name=
"main" id=
"main">
80 <th colspan=
"3"><b><?php
__(
"No catch-all");?></b></th>
83 <td width=
"1px"><input type=
"radio" name=
"target_type" id=
'target_type_none' value=
"none" <?php
if (
$catch[
'type']==
'none') {echo
'checked="checked"';}?> /></td>
84 <td colspan=
'2' style=
"width: 50%; text-align: justify"><label
for=
'target_type_none'><?php echo
__(
"No catch-all for this domain.");?></label></td>
88 <th colspan=
"3"><b><?php
__(
"Redirect to same address on a different domain");?></b></th>
91 <td width=
"1px"><input type=
"radio" name=
"target_type" id=
'target_type_domain' value=
"domain" <?php
if (
$catch[
'type']==
'domain') {echo
'checked="checked"';}?> /></td>
92 <td
style=
"width: 50%; text-align: justify"><label
for=
'target_type_domain'><?php echo sprintf(_(
"Mails sent to john.doe@%s will be redirect to john.doe@anotherdomain.tld"),
$catch[
'domain']);?></label></td>
95 <i><?php
__(
"Enter the 'target' domain"); ?></i><br/>
96 <input type=
"text" id=
"target_domain" name=
"target_domain" value=
"<?php if($catch['type']=='domain') { echo substr($catch['target'],1); } ?>" placeholder=
"<?php __("example.tld
");?>" />
98 <i><?php
__(
"Or choose one of your own"); ?></i>
100 <?php
foreach (
$dom->enum_domains() as
$d) {
if (
$d==
$catch[
'domain']) {
continue;} echo
"<li><a href=\"javascript:set_target_domain_value('".addslashes(
$d).
"');\">$d</a></li>"; } ?>
106 <th colspan=
"3"><b><?php
__(
"Redirect to a specific email");?></b></th>
109 <td width=
"1px"><input type=
"radio" name=
"target_type" id=
'target_type_mail' value=
"mail" <?php
if (
$catch[
'type']==
'mail') {echo
'checked="checked"';}?> /></td>
110 <td style=
"width: 50%; text-align: justify"><label
for=
'target_type_mail'><?php echo sprintf(_(
"Mails sent to an unexisting email on '@%s' will be redirect to user@example.tld."),
$catch[
'domain']);?></label></td>
113 <input type=
"text" name=
"target_mail" size=
"30" value=
"<?php if($catch['type']=='mail') { echo $catch['target']; } ?>" placeholder=
"<?php __("john.doe@example.tld
");?>" />
121 <input type=
"submit" class=
"inb" name=
"submit" value=
"<?php __("Save
"); ?>" />
122 <input type=
"button" class=
"inb" name=
"cancel" value=
"<?php __("Cancel
"); ?>" onclick=
"window.history.go(-1);"/>
126 <script type=
"text/javascript">
127 function set_target_domain_value(value) {
128 $(
'#target_domain').val(value);
129 $(
'#target_type_domain').prop(
'checked',
true);
133 <?php include_once(
"foot.php"); ?>