| 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 | { |
|---|
| 48 | $error=$err->errstr(); |
|---|
| 49 | |
|---|
| 50 | ?> |
|---|
| 51 | <h3><?php printf(_("Mailbox list of the domain %s"), $domain); ?></h3> |
|---|
| 52 | <?php |
|---|
| 53 | if ($error) { |
|---|
| 54 | echo "<p class=\"error\">$error</p>"; |
|---|
| 55 | } |
|---|
| 56 | echo "<p><a href=\"mail_add.php?domain=" . $domain . "\">".sprintf(_("Add a mailbox on <b>%s</b>"), $domain)."</a><br />"; |
|---|
| 57 | echo " <a href=\"mail_add.php?many=1&domain=" . $domain . "\">".sprintf(_("Add many mailboxes on <b>%s</b>"), $domain)."</a></p>"; |
|---|
| 58 | |
|---|
| 59 | } |
|---|
| 60 | else |
|---|
| 61 | { |
|---|
| 62 | |
|---|
| 63 | ?> |
|---|
| 64 | <h3><?php printf(_("Mailbox list of the domain %s"), $domain); ?></h3> |
|---|
| 65 | <?php |
|---|
| 66 | if ($error) { |
|---|
| 67 | echo "<p class=\"error\">$error</p>"; |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | echo "<p><a href=\"mail_add.php?domain=" . $domain . "\">".sprintf(_("Add a mailbox on <b>%s</b>"), $domain)."</a><br />"; |
|---|
| 71 | echo " <a href=\"mail_add.php?many=1&domain=" . $domain . "\">".sprintf(_("Add many mailboxes on <b>%s</b>"), $domain)."</a></p>"; |
|---|
| 72 | |
|---|
| 73 | if(!$letters=$mail->enum_doms_mails_letters($domain)) |
|---|
| 74 | $error=$err->errstr(); |
|---|
| 75 | else{ |
|---|
| 76 | for($i=0;$i<count($letters);$i++){ |
|---|
| 77 | $val=$letters[$i]; |
|---|
| 78 | echo " <a href=\"mail_list.php?domain=$domain&letter=$val\">$val </a>"; |
|---|
| 79 | } |
|---|
| 80 | echo " <a href=\"mail_list.php?domain=$domain\">".sprintf(_("All"))."</a>"; |
|---|
| 81 | } |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | ?> |
|---|
| 85 | <form method="post" action="mail_del.php" id="main"> |
|---|
| 86 | |
|---|
| 87 | <table cellspacing="0" cellpadding="4"> |
|---|
| 88 | |
|---|
| 89 | <tr><th><input type="hidden" name="domain" value="<?php echo $domain ?>" /> |
|---|
| 90 | <?php __("Delete"); ?></th><th><?php __("Email address"); ?></th><th><?php __("Action"); ?></th><th><?php __("Size"); ?></th></tr> |
|---|
| 91 | <?php |
|---|
| 92 | $col=1; |
|---|
| 93 | for($i=0;$i<$res["count"];$i++) { |
|---|
| 94 | $col=3-$col; |
|---|
| 95 | $val=$res[$i]; |
|---|
| 96 | echo "<tr class=\"lst$col\">"; |
|---|
| 97 | echo "<td align=\"center\"><input class=\"inc\" type=\"checkbox\" id=\"del_$i\" name=\"d[]\" value=\"".$val["mail"]."\" /></td> |
|---|
| 98 | <td><label for=\"del_$i\">".$val["mail"]."</label></td> |
|---|
| 99 | <td class=\"center\"><a href=\"mail_edit.php?email=".urlencode($val["mail"])."&domain=".urlencode($domain)."\"><img src=\"images/edit.png\" alt=\""._("Edit")."\" /></a></td>"; |
|---|
| 100 | if ($val["pop"]) { |
|---|
| 101 | echo "<td>".format_size($val["size"])."</td>"; |
|---|
| 102 | } else { |
|---|
| 103 | echo "<td> </td>"; |
|---|
| 104 | } |
|---|
| 105 | echo "</tr>"; |
|---|
| 106 | |
|---|
| 107 | } |
|---|
| 108 | ?> |
|---|
| 109 | <tr><td colspan="5"><input type="submit" class="inb" name="submit" value="<?php __("Delete the selected mailboxes"); ?>" /></td></tr> |
|---|
| 110 | </table> |
|---|
| 111 | </form> |
|---|
| 112 | |
|---|
| 113 | <?php |
|---|
| 114 | } |
|---|
| 115 | ?> |
|---|
| 116 | <script type="text/javascript"> |
|---|
| 117 | deploy("menu-mail"); |
|---|
| 118 | </script> |
|---|
| 119 | <?php include_once("foot.php"); |
|---|