26 require_once(
"../class/config.php");
27 include_once(
"head.php");
30 "mail_arg" => array (
"request",
"integer",
""),
31 "domain_id" => array (
"request",
"integer",
""),
32 "show_systemmails" => array (
"request",
"integer",
""),
33 "search" => array (
"request",
"string",
""),
34 "offset" => array (
"request",
"integer", 0),
35 "count" => array (
"request",
"integer", 50),
40 $counts=array(
"10" =>
"10",
"20" =>
"20",
"30" =>
"30",
"50" =>
"50",
"100" =>
"100",
"200" =>
"200",
"500" =>
"500",
"1000" =>
"1000");
48 $mails_list = $mail->enum_domain_mails($domain_id,$search,$offset,$count,$show_systemmails);
49 $allmails_list = $mail->enum_domain_mails($domain_id,$search,$offset,$count,
'true');
56 <?php
if ($quota->cancreate(
"mail")) {
57 echo
'<h3>'._(
"Create a new mail account").
"</h3>";
59 echo
'<h3>'._(
"Manage Catch-all").
"</h3>";
62 echo
$msg->msg_html_all(
true,
true);
68 <?php
if ($quota->cancreate(
"mail")) { ?>
69 <form method=
"post" action=
"mail_doadd.php" id=
"main" name=
"mail_create">
71 <input type=
"text" class=
"int intleft" style=
"text-align: right" name=
"mail_arg" value=
"<?php ehe($mail_arg); ?>" size=
"24" id=
"mail_arg" maxlength=
"255" /><span
id=
"emaildom" class=
"int intright"><?php echo
"@".$domain; ?></span>
72 <input type=
"hidden" name=
"domain_id" value=
"<?php ehe($domain_id); ?>" />
73 <input type=
"submit" name=
"submit" class=
"inb add" value=
"<?php __("Create
this email address
"); ?>" onClick=
"return false_if_empty('mail_arg', '<?php echo addslashes(_("Can
't have empty mail."));?>');
" />
75 <?php } // $quota->cancreate("mail
") ?>
78 <span class="inb settings
" valign='bottom'><a href="mail_manage_catchall.php?domain_id=<?php echo $domain_id?>
"><?php __("Manage Catch-all
for this domain
");?></a></span>
85 <h3><?php printf(_("Email addresses of the domain %s
"),$domain); ?> : </h3>
87 if (empty($allmails_list) && empty($search)) {
88 $msg->raise("ERROR
", 'mail', _("No mails
for this domain.
"));
89 echo $msg->msg_html_all();
94 <table class="searchtable
"><tr><td>
95 <form method="get" name="formlist1
" id="formlist1
" action="mail_list.php
">
96 <input type="hidden
" name="domain_id
" value="<?php
ehe($domain_id); ?>
" />
97 <input type="hidden
" name="offset
" value="0
" />
98 <span class="int intleft
"><img alt="<?php
__(
"Search"); ?>
" title="<?php
__(
"Search"); ?>
" src="/images/search.png
" style="vertical-align: middle
"/> </span><input type="text
" name="search
" value="<?php
ehe($search); ?>
" size="20
" maxlength="64
" class="int intright
" />
100 <?php pager($offset,$count,$mail->total,"mail_list.php?domain_id=
".$domain_id."&count=
".$count."&search=
".urlencode($search)."&offset=%%offset%%
"); ?>
102 <td style="text-align:center
">
103 <input type="checkbox
" id="show_systemmails
" name="show_systemmails
" <?php if($show_systemmails) { echo "checked
"; } ?> value="1
" onclick="document.getElementById(
'formlist1').submit();
" /><label for="show_systemmails
" ><?php __("Show system emails
");?></label>
106 <td style="text-align:right
">
107 <form method="get" name="formlist2
" id="formlist2
" action="mail_list.php
">
108 <input type="hidden
" name="domain_id
" value="<?php
ehe($domain_id); ?>
" />
109 <input type="hidden
" name="offset
" value="0
" />
110 <?php __("Items per page:
"); ?> <select name="count
" class="inl
" onchange="submit()
"><?php eoption($counts,$count); ?></select>
114 <form method="post
" action="mail_del.php
">
116 <input type="hidden
" name="domain_id
" value="<?php
ehe($domain_id); ?>
" />
117 <table class="tlist
">
118 <tr><th></th><th></th><th><?php __("Enabled
");?></th><th style="text-align:right
"><?php __("Address
"); ?></th><th><?php __("Pop/Imap
"); ?></th><th><?php __("Other recipients
"); ?></th><th><?php __("Last login time
"); ?></th></tr>
122 //listing of every mail of the current domain.
123 if(!empty($mails_list)) {
124 while (list($key,$val)=each($mails_list)) {
128 <?php if ($val["mail_action
"]=="DELETING
") { $grey="grey
"; ?>
129 <td colspan="3
"><?php __("Deleting...
"); ?></td>
130 <?php } else if ($val["mail_action
"]=="DELETE
") { $grey="grey
"; ?>
133 <?php if ($val['type'] =='') { ?>
134 <div class="ina
"><a href="mail_undelete.php?search=<?php
ehe($search); ?>&offset=<?php
ehe($offset); ?>&count=<?php
ehe($count); ?>&domain_id=<?php
ehe($domain_id); ?>&mail_id=<?php echo
$val[
"id"] ?>
" title="<?php
__(
"This email will be deleted soon. You may still be able to undelete it by clicking here"); ?>
"><img src="images/undelete.png
" alt="<?php
__(
"Undelete"); ?>
" /><?php __("Undelete
"); ?></a></div>
135 <?php } // if val[type] ?>
137 <td><img src="images/check_no.png
" alt="<?php
__(
"Disabled"); ?>
" /></td>
138 <?php } else if (!$val["type
"]) { ?>
140 <input class="inc
" type="checkbox
" id="del_<?php
ehe(
$i); ?>
" name="d[]
" value="<?php
ehe(
$val[
"id"]); ?>
" />
142 <td class="<?php echo $grey; ?>
">
143 <div class="ina edit
"><a href="mail_edit.php?mail_id=<?php echo
$val[
"id"] ?>
"><?php __("Edit
"); ?></a></div></td>
144 <td class="<?php echo $grey; ?>
"><?php if ($val["enabled"] ) { ?>
145 <img src="images/check_ok.png
" alt="<?php
__(
"Enabled"); ?>
" />
147 <img src="images/check_no.png
" alt="<?php
__(
"Disabled"); ?>
" />
148 <?php } // if enabled ?>
151 <td colspan="3
"></td>
153 <td class="<?php echo $grey; ?>
" style="text-align:right
"><?php echo $val["address
"]."@".$domain ?></td>
154 <?php if ($val["type
"]) { ?>
155 <td colspan="3
"><?php echo $val["typedata
"]; ?></td>
157 <td class="<?php echo $grey; ?>
"><?php if ($val["islocal
"]) echo format_size($val["used
"]).( ($val["quotabytes
"]==0)?'':"/
".format_size($val["quotabytes
"])) ; else __("No
"); ?></td>
158 <td class="<?php echo $grey; ?>
"><?php echo $val["recipients
"]; /* TODO : if >60chars, use "...
" + js close/open */ ?></td>
159 <td class="<?php echo $grey; ?>
"><?php if ($val["islocal
"]) {
160 if (date("Y-m-
d")==substr($val["lastlogin
"],0,10)) echo substr($val["lastlogin
"],11,5); else if (substr($val["lastlogin
"],0,10)=="0000-00-00
") __("Never
"); else echo format_date(_('%3$d-%2$d-%1$d'),$val["lastlogin
"]);
171 <p><input type="submit
" class="inb
delete" name="submit
" value="<?php
__(
"Delete the checked email addresses"); ?>
" /></p>
175 } // end if no mail for this domain
179 <h3><?php __("Mails configuration information
");?></h3>
181 <?php __("Here are some configuration information you will need to configure your mail application.
");?>
185 <div id="tabs-mailhelp
">
188 <li class="help
"><a href="#tabs-mailhelp-out
"><?php __("Outgoing mail (SMTP)
"); ?></a></li>
189 <li class="help
"><a href="#tabs-mailhelp-in
"><?php __("Incoming mail
"); ?></a></li>
192 <div id="tabs-mailhelp-out
">
194 <?php __("Which protocol shall you use?
"); ?>
195 <div id="accordion-mailout
">
196 <?php if ($mail->srv_postfix) { ?>
197 <h4><?php __("Submission
");?></h4>
200 <li><b><?php __("Server name:
");?></b> <?php __($mail->srv_postfix); ?></li>
201 <li><b><?php __("Username:
");?></b> <?php __("The mail address you want to access <i>(example : myuser@example.tld)</i>
");?></li>
202 <li><b><?php __("Port:
");?></b> 587</li>
203 <li><b><?php __("Authentication:
");?></b><?php __("Yes
")?></li>
204 <li><b><?php __("Authentication method:
");?></b><?php __("Normal password
")?></li>
205 <li><b><?php __("Connection security:
");?></b> STARTTLS</li>
209 <?php if ($mail->srv_postfix) { ?>
210 <h4><?php __("SMTP
");?></h4>
213 <li><b><?php __("Server name:
");?></b> <?php __($mail->srv_postfix); ?></li>
214 <li><b><?php __("Username:
");?></b> <?php __("The mail address you want to access <i>(example : myuser@example.tld)</i>
");?></li>
215 <li><b><?php __("Port:
");?></b> 25</li>
216 <li><b><?php __("Authentication:
");?></b><?php __("Yes
")?></li>
217 <li><b><?php __("Authentication method:
");?></b><?php __("Normal Password
")?></li>
218 <li><b><?php __("Connection security:
");?></b> STARTTLS</li>
222 <?php if ($mail->srv_postfix) { ?>
223 <h4><?php __("SMTPS
");?></h4>
226 <li><b><?php __("Server name:
");?></b> <?php __($mail->srv_postfix); ?></li>
227 <li><b><?php __("Username:
");?></b> <?php __("The mail address you want to access <i>(example : myuser@example.tld)</i>
");?></li>
228 <li><b><?php __("Port:
");?></b> 465</li>
229 <li><b><?php __("Authentication:
");?></b><?php __("Yes
")?></li>
230 <li><b><?php __("Authentication method:
");?></b><?php __("Normal Password
")?></li>
231 <li><b><?php __("Connection security:
");?></b> SSL</li>
235 </div><!-- accordion-mailout -->
237 </div><!-- tabs-mailhelp-out -->
239 <div id="tabs-mailhelp-in
">
241 <?php __("Which protocol shall you use?
"); ?>
242 <div id="accordion-mailin
">
243 <h4><?php __("IMAP
");?></h4>
246 <li><b><?php __("Server name:
");?></b> <?php __($mail->srv_dovecot); ?></li>
247 <li><b><?php __("Port:
");?></b> 143</li>
248 <li><b><?php __("Authentication:
");?></b><?php __("Yes
")?></li>
249 <li><b><?php __("Authentication method:
");?></b><?php __("Normal password
")?></li>
250 <li><b><?php __("Connection security:
");?></b> STARTTLS</li>
254 <h4><?php __("IMAPS
");?></h4>
257 <li><b><?php __("Server name:
");?></b> <?php __($mail->srv_dovecot); ?></li>
258 <li><b><?php __("Port:
");?></b> 993</li>
259 <li><b><?php __("Authentication:
");?></b><?php __("Yes
")?></li>
260 <li><b><?php __("Authentication method:
")?></b><?php __("Normal password
")?></li>
261 <li><b><?php __("Connection security:
");?></b> SSL</li>
265 <h4><?php __("POP3
");?></h4>
268 <li><b><?php __("Server name:
");?></b> <?php __($mail->srv_dovecot); ?></li>
269 <li><b><?php __("Port:
");?></b> 110</li>
270 <li><b><?php __("Authentication:
");?></b><?php __("Yes
")?></li>
271 <li><b><?php __("Authentication method:
");?></b><?php __("Normal password
")?></li>
272 <li><b><?php __("Connection security:
");?></b> STARTTLS</li>
276 <h4><?php __("POP3S
");?></h4>
279 <li><b><?php __("Server name:
");?></b> <?php __($mail->srv_dovecot); ?></li>
280 <li><b><?php __("Port:
");?></b> 995</li>
281 <li><b><?php __("Authentication:
");?></b><?php __("Yes
")?></li>
282 <li><b><?php __("Authentication method:
");?></b><?php __("Normal password
")?></li>
283 <li><b><?php __("Connection security:
");?></b> SSL</li>
287 </div><!-- tabs-mailhelp-in -->
288 </div><!-- tabs-mailhelp -->
290 <script type="text/javascript
">
293 $( "#accordion-mailout
" ).accordion({
294 collapsible: true, active: false, header: "h4
", heightStyle: "content
"
299 $( "#accordion-mailin
" ).accordion({
300 collapsible: true, active: false, header: "h4
", heightStyle: "content
"
305 $(function() {$( "#tabs-mailhelp
" ).tabs();});
310 <?php include_once("foot.php
"); ?>
d($mess)
Debug function that print infos.
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...
$fields
List the email account of a domain.