Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
adm_mxaccount.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: adm_mxacount.php,v 1.2 2006/02/17 18:57:02 olivier 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: Manage list of allowed accounts for secondary mx
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 
32 if (!$admin->enabled) {
33  __("This page is restricted to authorized staff");
34  exit();
35 }
36 
37 $fields = array (
38  "delaccount" => array ("request", "string", ""),
39  "newlogin" => array ("request", "string", ""),
40  "newpass" => array ("request", "string", ""),
41 );
43 
44 if ($delaccount) {
45  // Delete an account
46  if ($mail->del_slave_account($delaccount)) {
47  $error=_("The requested account has been deleted. It is now denied.");
48  }
49 }
50 if ($newlogin) {
51  // Add an account
52  if ($mail->add_slave_account($newlogin,$newpass)) {
53  $error=_("The requested account address has been created. It is now allowed.");
54  $newlogin=false;$newpass=false;
55  }
56 }
57 
58 include_once("head.php");
59 ?>
60 <h3><?php __("Manage allowed accounts for secondary mx"); ?></h3>
61 <hr id="topbar"/>
62 <br />
63 <?php
64  if (isset($error) && $error) {
65  echo "<p class=\"alert alert-danger\">$error</p>";
66  }
67 
68 $c=$mail->enum_slave_account();
69 
70 if (is_array($c)) {
71 
72 ?>
73 <p>
74 <?php __("Here is the list of the allowed accounts for secondary mx management. You can configure the alternc-secondarymx package on your secondary mx server and give him the login/pass that will grant him access to your server's mx-hosted domain list. "); ?>
75 </p>
76 
77 <table border="0" cellpadding="4" cellspacing="0" class='tlist'>
78 <tr><th><?php __("Action"); ?></th><th><?php __("Login"); ?></th><th><?php __("Password"); ?></th></tr>
79 <?php
80 for($i=0;$i<count($c);$i++) { ?>
81 
82 <tr class="lst">
83 <td class="center"><div class="ina delete"><a href="adm_mxaccount.php?delaccount=<?php echo urlencode($c[$i]["login"]); ?>"><?php __("Delete"); ?></a></div></td>
84 <td><?php echo $c[$i]["login"]; ?></td>
85 <td><?php echo $c[$i]["pass"]; ?></td>
86 </tr>
87 <?php
88 }
89 ?>
90 </table>
91  <?php } ?>
92 <p><?php __("If you want to allow a new server to access your mx-hosted domain list, give him an account."); ?></p>
93 <form method="post" action="adm_mxaccount.php" name="main" id="main">
94 <table class="tedit">
95 <tr><th><label for="newlogin"><?php __("Login"); ?></label></th><th><label for="newpass"><?php __("Password"); ?></label></th></tr>
96 <tr>
97  <td><input type="text" class="int" value="<?php ehe($newlogin); ?>" id="newlogin" name="newlogin" maxlength="64" size="32" /><br/><br/></td>
98  <td><input type="password" class="int" value="<?php ehe($newpass); ?>" id="newpass" name="newpass" maxlength="64" size="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass"); ?></td>
99 </tr>
100 <tr class="trbtn"><td colspan="2">
101  <input type="submit" value="<?php __("Add this account to the allowed list"); ?>" class="inb" />
102  </td></tr>
103 </table>
104 
105 </form>
106 
107 <script type="text/javascript">
108 document.forms['main'].newlogin.focus();
109 document.forms['main'].setAttribute('autocomplete', 'off');
110 </script>
111 <?php include_once("foot.php"); ?>