| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Id: mail_list.php,v 1.8 2005/04/01 16:05:26 benjamin Exp $ |
|---|
| 4 | ---------------------------------------------------------------------- |
|---|
| 5 | AlternC - Web Hosting System |
|---|
| 6 | Copyright (C) 2002 by the AlternC Development Team. |
|---|
| 7 | http://alternc.org/ |
|---|
| 8 | ---------------------------------------------------------------------- |
|---|
| 9 | Based on: |
|---|
| 10 | Valentin Lacambre's web hosting softwares: http://altern.org/ |
|---|
| 11 | ---------------------------------------------------------------------- |
|---|
| 12 | LICENSE |
|---|
| 13 | |
|---|
| 14 | This program is free software; you can redistribute it and/or |
|---|
| 15 | modify it under the terms of the GNU General Public License (GPL) |
|---|
| 16 | as published by the Free Software Foundation; either version 2 |
|---|
| 17 | of the License, or (at your option) any later version. |
|---|
| 18 | |
|---|
| 19 | This program is distributed in the hope that it will be useful, |
|---|
| 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 22 | GNU General Public License for more details. |
|---|
| 23 | |
|---|
| 24 | To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|---|
| 25 | ---------------------------------------------------------------------- |
|---|
| 26 | Original Author of file: Benjamin Sonntag, Franck Missoum |
|---|
| 27 | Purpose of file: Show the mail account list on domain $dom |
|---|
| 28 | ---------------------------------------------------------------------- |
|---|
| 29 | */ |
|---|
| 30 | require_once("../class/config.php"); |
|---|
| 31 | include_once("head.php"); |
|---|
| 32 | |
|---|
| 33 | $fields = array ( |
|---|
| 34 | "domain" => array ("request", "string", ""), |
|---|
| 35 | |
|---|
| 36 | "letter" => array ("get", "string", ""), |
|---|
| 37 | ); |
|---|
| 38 | getFields($fields); |
|---|
| 39 | |
|---|
| 40 | if(!$domain) |
|---|
| 41 | { |
|---|
| 42 | include("main.php"); |
|---|
| 43 | exit(); |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | if(!$res=$mail->enum_doms_mails($domain,1,$letter)) { |
|---|
| 47 | $error=$err->errstr(); |
|---|
| 48 | ?> |
|---|
| 49 | <h3><?php printf(_("Email addresses of the domain %s"),$domain); ?> : </h3> |
|---|
| 50 | <?php |
|---|
| 51 | if ($error) { |
|---|
| 52 | echo "<p class=\"error\">$error</p>"; |
|---|
| 53 | } |
|---|
| 54 | ?> |
|---|
| 55 | <hr id="topbar"/> |
|---|
| 56 | <br /> |
|---|
| 57 | <p> |
|---|
| 58 | <span class="inb"><a href="mail_add.php?domain=<?php echo $domain; ?>"><?php printf(_("Add a mailbox on <b>%s</b>"),$domain); ?></a></span> |
|---|
| 59 | <span class="inb"><a href="mail_add.php?many=1&domain=<?php echo $domain; ?>"><?php printf(_("Add many mailboxes on <b>%s</b>"),$domain); ?></a></span> |
|---|
| 60 | </p> |
|---|
| 61 | <? |
|---|
| 62 | } |
|---|
| 63 | else |
|---|
| 64 | { |
|---|
| 65 | |
|---|
| 66 | ?> |
|---|
| 67 | <h3><?php printf(_("Email addresses of the domain %s"),$domain); ?> : </h3> |
|---|
| 68 | <?php |
|---|
| 69 | if ($error) { |
|---|
| 70 | echo "<p class=\"error\">$error</p>"; |
|---|
| 71 | } |
|---|
| 72 | ?> |
|---|
| 73 | <hr id="topbar"/> |
|---|
| 74 | <br /> |
|---|
| 75 | <p> |
|---|
| 76 | <span class="inb"><a href="mail_add.php?domain=<?php echo $domain; ?>"><?php printf(_("Add a mailbox on <b>%s</b>"),$domain); ?></a></span> |
|---|
| 77 | <span class="inb"><a href="mail_add.php?many=1&domain=<?php echo $domain; ?>"><?php printf(_("Add many mailboxes on <b>%s</b>"),$domain); ?></a></span> |
|---|
| 78 | </p> |
|---|
| 79 | <?php |
|---|
| 80 | |
|---|
| 81 | if(!$letters=$mail->enum_doms_mails_letters($domain)) |
|---|
| 82 | $error=$err->errstr(); |
|---|
| 83 | else{ |
|---|
| 84 | echo "<p>"; |
|---|
| 85 | __("Show only mail starting by:"); |
|---|
| 86 | echo " "; |
|---|
| 87 | for($i=0;$i<count($letters);$i++){ |
|---|
| 88 | $val=$letters[$i]; |
|---|
| 89 | echo " <a href=\"mail_list.php?domain=$domain&letter=$val\">$val </a>"; |
|---|
| 90 | } |
|---|
| 91 | echo " <a href=\"mail_list.php?domain=$domain\">".sprintf(_("All"))."</a>"; |
|---|
| 92 | echo "</p>"; |
|---|
| 93 | } |
|---|
| 94 | |
|---|
| 95 | if ($res["count"]) { |
|---|
| 96 | ?> |
|---|
| 97 | <form method="post" action="mail_del.php" id="main"> |
|---|
| 98 | |
|---|
| 99 | <table class="tlist"> |
|---|
| 100 | |
|---|
| 101 | <tr><th colspan="2"><input type="hidden" name="domain" value="<?php echo $domain ?>"/> </th> |
|---|
| 102 | <th><?php __("Email address"); ?></th><th><?php __("Size"); ?></th><th> </th></tr> |
|---|
| 103 | <?php |
|---|
| 104 | $col=1; |
|---|
| 105 | for($i=0;$i<$res["count"];$i++) { |
|---|
| 106 | $col=3-$col; |
|---|
| 107 | $val=$res[$i]; |
|---|
| 108 | echo "<tr class=\"lst$col\">"; |
|---|
| 109 | echo "<td align=\"center\"><input class=\"inc\" type=\"checkbox\" id=\"del_$i\" name=\"d[]\" value=\"".$val["mail"]."\" /></td>"; |
|---|
| 110 | ?> |
|---|
| 111 | <td><div class="ina"><a href="mail_edit.php?email=<?php echo urlencode($val["mail"]); ?>&domain=<?php echo urlencode($domain); ?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" /><?php __("Edit"); ?></a></div></td> |
|---|
| 112 | |
|---|
| 113 | <?php |
|---|
| 114 | echo "<td><label for=\"del_$i\">".$val["mail"]."</label></td>"; |
|---|
| 115 | if ($val["pop"]) { |
|---|
| 116 | echo "<td>".format_size($val["size"])."</td>"; |
|---|
| 117 | } else { |
|---|
| 118 | echo "<td> </td>"; |
|---|
| 119 | } |
|---|
| 120 | echo "<td>"; |
|---|
| 121 | if (! is_null($val['expiration_date'])) { |
|---|
| 122 | // It's a temporary account |
|---|
| 123 | echo __("Manage this temporary account"); |
|---|
| 124 | } else { |
|---|
| 125 | // It's a normal account |
|---|
| 126 | echo "<a href='mail_add.php?domain=".urlencode($domain)."&dst_mail=".urlencode($val["mail"])."'>"; |
|---|
| 127 | echo __("Create alias"); |
|---|
| 128 | echo "</a>"; |
|---|
| 129 | } |
|---|
| 130 | echo "</td>"; |
|---|
| 131 | echo "</tr>"; |
|---|
| 132 | |
|---|
| 133 | } |
|---|
| 134 | ?> |
|---|
| 135 | </table> |
|---|
| 136 | <br /> |
|---|
| 137 | <input type="submit" class="inb" name="submit" value="<?php __("Delete the checked email addresses"); ?>" /> |
|---|
| 138 | </form> |
|---|
| 139 | |
|---|
| 140 | <?php |
|---|
| 141 | } |
|---|
| 142 | } |
|---|
| 143 | ?> |
|---|
| 144 | <?php include_once("foot.php"); ?> |
|---|