| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Id: mail_edit.php,v 1.6 2006/01/12 01:10:48 anarcat 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 |
|---|
| 27 | Purpose of file: Edit a mailbox. |
|---|
| 28 | ---------------------------------------------------------------------- |
|---|
| 29 | */ |
|---|
| 30 | require_once("../class/config.php"); |
|---|
| 31 | include_once("head.php"); |
|---|
| 32 | |
|---|
| 33 | $fields = array ( |
|---|
| 34 | "email" => array ("request", "string", ""), |
|---|
| 35 | "domain" => array ("request", "string", ""), |
|---|
| 36 | ); |
|---|
| 37 | getFields($fields); |
|---|
| 38 | |
|---|
| 39 | if (!$res=$mail->get_mail_details($email)) |
|---|
| 40 | { |
|---|
| 41 | $error=$err->errstr(); |
|---|
| 42 | echo $error; |
|---|
| 43 | } |
|---|
| 44 | else |
|---|
| 45 | { |
|---|
| 46 | |
|---|
| 47 | ?> |
|---|
| 48 | <h3><?php printf(_("Edit an email address of the domain %s"),$domain); ?> : </h3> |
|---|
| 49 | <hr id="topbar"/> |
|---|
| 50 | <br /> |
|---|
| 51 | <?php |
|---|
| 52 | if ($error_edit) { |
|---|
| 53 | echo "<p class=\"error\">$error_edit</p>"; |
|---|
| 54 | $error_edit=""; |
|---|
| 55 | |
|---|
| 56 | } else { |
|---|
| 57 | $pop=$res["pop"]; |
|---|
| 58 | $pass=$res["password"]; |
|---|
| 59 | $alias=$res["alias"]; |
|---|
| 60 | } ?> |
|---|
| 61 | |
|---|
| 62 | <form action="mail_doedit.php" method="post" name="main" id="main"> |
|---|
| 63 | <table class="tedit"> |
|---|
| 64 | <tr><th colspan="2"><input type="hidden" name="email" value="<?php echo $email; ?>" /> |
|---|
| 65 | <input type="hidden" name="domain" value="<?php echo $domain; ?>" /> |
|---|
| 66 | <?php printf(_("Edit the email address <b>%s</b>"),$email); ?></th></tr> |
|---|
| 67 | <?php if (! is_null($res['trash_info']) && $res['trash_info']->is_trash ) { ?> |
|---|
| 68 | <tr><th colspan="2"><span style="color: red"><?php __("This account is a temporary account.<br/>It will be delete on "); echo $res['trash_info']->human_display(); ?></span></th></tr> |
|---|
| 69 | <?php } ?> |
|---|
| 70 | <tr><td><label for="pop"><?php __("Is it a POP/IMAP account?"); ?></label></td> |
|---|
| 71 | <td> |
|---|
| 72 | <p> |
|---|
| 73 | <input type="radio" name="pop" id="pop0" class="inc" value="0"<?php cbox($pop==0); ?> onclick="hide('poptbl');"><label for="pop0"><?php __("No"); ?></label> |
|---|
| 74 | <input type="radio" name="pop" id="pop1" class="inc" value="1"<?php cbox($pop==1); ?> onclick="show('poptbl');"><label for="pop1"><?php __("Yes"); ?></label> |
|---|
| 75 | </p> |
|---|
| 76 | <div id="poptbl"> |
|---|
| 77 | <table class="tedit" > |
|---|
| 78 | <tr><td><label for="pass"><?php __("POP/IMAP password"); ?></label></td><td><input type="password" class="int" name="pass" id="pass" value="<?php ehe($pass); ?>" size="20" maxlength="32" /></td></tr> |
|---|
| 79 | <tr><td><label for="passconf"><?php __("Confirm password"); ?></label></td><td><input type="password" class="int" name="passconf" id="passconf" value="<?php echo $pass; ?>" size="20" maxlength="32" /></td></tr> |
|---|
| 80 | </table> |
|---|
| 81 | </div> |
|---|
| 82 | <br /> |
|---|
| 83 | <?php if ($pop==1) { |
|---|
| 84 | echo "<div class=\"warningmsg\">"._("WARNING: turning POP/IMAP off will DELETE the stored messages in this email address. This email address will become a simple redirection.")."</div>"; |
|---|
| 85 | } ?> |
|---|
| 86 | </td></tr> |
|---|
| 87 | |
|---|
| 88 | <tr><td><label for="alias"><?php __("Redirections<br />Other recipients:"); ?></label></td><td>(<?php __("one email per line"); ?>)<br /><textarea class="int" cols="32" rows="5" name="alias" id="alias"><?php echo $alias; ?></textarea></td></tr> |
|---|
| 89 | <!-- |
|---|
| 90 | <tr><td> |
|---|
| 91 | <?php echo __("Is it a temporary mail account?"); ?><br/> |
|---|
| 92 | </td><td> |
|---|
| 93 | <?php include_once("trash_dateselect.php"); ?> |
|---|
| 94 | </td></tr> |
|---|
| 95 | --> |
|---|
| 96 | <tr class="trbtn"><td colspan="2"> |
|---|
| 97 | <input type="submit" class="inb" name="submit" value="<?php __("Change this email address"); ?>" /> |
|---|
| 98 | <input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='mail_list.php?domain=<?php echo urlencode($domain); ?>'"/> |
|---|
| 99 | </td></tr> |
|---|
| 100 | </table> |
|---|
| 101 | </form> |
|---|
| 102 | |
|---|
| 103 | <p><small> |
|---|
| 104 | <?php __("help_mail_edit"); ?> |
|---|
| 105 | </small></p> |
|---|
| 106 | <?php |
|---|
| 107 | } |
|---|
| 108 | ?> |
|---|
| 109 | <script type="text/javascript"> |
|---|
| 110 | document.forms['main'].email.focus(); |
|---|
| 111 | <?php if ($pop==0) { ?> |
|---|
| 112 | hide('poptbl'); |
|---|
| 113 | <?php } ?> |
|---|
| 114 | document.forms['main'].setAttribute('autocomplete', 'off'); |
|---|
| 115 | </script> |
|---|
| 116 | <?php include_once("foot.php"); ?> |
|---|