2006-05-22 09:03:51 +00:00
< ? php
/*
$Id : adm_mxacount . php , v 1.2 2006 / 02 / 17 18 : 57 : 02 olivier Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright ( C ) 2002 by the AlternC Development Team .
http :// alternc . org /
----------------------------------------------------------------------
Based on :
Valentin Lacambre ' s web hosting softwares : http :// altern . org /
----------------------------------------------------------------------
LICENSE
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License ( GPL )
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
To read the license please visit http :// www . gnu . org / copyleft / gpl . html
----------------------------------------------------------------------
Original Author of file : Benjamin Sonntag
Purpose of file : Manage list of allowed accounts for secondary mx
----------------------------------------------------------------------
*/
require_once ( " ../class/config.php " );
if ( ! $admin -> enabled ) {
__ ( " This page is restricted to authorized staff " );
exit ();
}
2009-09-08 05:29:38 +00:00
$fields = array (
" delaccount " => array ( " request " , " string " , " " ),
" newlogin " => array ( " request " , " string " , " " ),
" newpass " => array ( " request " , " string " , " " ),
);
getFields ( $fields );
2006-05-22 09:03:51 +00:00
if ( $delaccount ) {
// Delete an account
if ( $mail -> del_slave_account ( $delaccount )) {
$error = _ ( " The requested account has been deleted. It is now denied. " );
}
}
if ( $newlogin ) {
// Add an account
if ( $mail -> add_slave_account ( $newlogin , $newpass )) {
$error = _ ( " The requested account address has been created. It is now allowed. " );
2012-08-31 16:00:47 +00:00
$newlogin = false ; $newpass = false ;
2006-05-22 09:03:51 +00:00
}
}
2009-09-08 05:29:38 +00:00
include_once ( " head.php " );
2006-05-22 09:03:51 +00:00
?>
</ head >
< body >
< h3 >< ? php __ ( " Manage allowed accounts for secondary mx " ); ?> </h3>
2010-06-02 22:42:03 +00:00
< hr id = " topbar " />
< br />
2006-05-22 09:03:51 +00:00
< ? php
2012-08-23 14:10:38 +00:00
if ( isset ( $error ) && $error ) {
2006-05-22 09:03:51 +00:00
echo " <p class= \" error \" > $error </p> " ;
}
$c = $mail -> enum_slave_account ();
if ( is_array ( $c )) {
?>
< p >
< ? 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. " ); ?>
</ p >
2013-02-04 08:42:06 +00:00
< table border = " 0 " cellpadding = " 4 " cellspacing = " 0 " class = 'tlist' >
2006-05-22 09:03:51 +00:00
< tr >< th >< ? php __ ( " Action " ); ?> </th><th><?php __("Login"); ?></th><th><?php __("Password"); ?></th></tr>
< ? php
$col = 1 ;
for ( $i = 0 ; $i < count ( $c ); $i ++ ) {
$col = 3 - $col ;
?>
< tr class = " lst<?php echo $col ; ?> " >
2010-06-02 22:42:03 +00:00
< td class = " center " >< div class = " ina " >< a href = " adm_mxaccount.php?delaccount=<?php echo urlencode( $c[$i] [ " login " ]); ?> " >< img src = " images/delete.png " alt = " <?php __( " Delete " ); ?> " />< ? php __ ( " Delete " ); ?> </a></div></td>
2006-05-22 09:03:51 +00:00
< td >< ? php echo $c [ $i ][ " login " ]; ?> </td>
< td >< ? php echo $c [ $i ][ " pass " ]; ?> </td>
</ tr >
< ? php
}
?>
</ table >
< ? php } ?>
< p >< ? php __ ( " If you want to allow a new server to access your mx-hosted domain list, give him an account. " ); ?> </p>
2010-06-02 22:42:03 +00:00
< form method = " post " action = " adm_mxaccount.php " name = " main " id = " main " >
< table class = " tedit " >
2006-05-22 09:03:51 +00:00
< tr >< th >< label for = " newlogin " >< ? php __ ( " Login " ); ?> </label></th><th><label for="newpass"><?php __("Password"); ?></label></th></tr>
< tr >
2012-11-22 09:43:41 +00:00
< td >< input type = " text " class = " int " value = " <?php ehe( $newlogin ); ?> " id = " newlogin " name = " newlogin " maxlength = " 64 " size = " 32 " />< br />< br /></ td >
2013-01-23 13:34:01 +00:00
< 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>
2006-05-22 09:03:51 +00:00
</ tr >
2010-06-02 22:42:03 +00:00
< tr class = " trbtn " >< td colspan = " 2 " >
2006-05-22 09:03:51 +00:00
< input type = " submit " value = " <?php __( " Add this account to the allowed list " ); ?> " class = " inb " />
</ table >
</ form >
2010-06-02 22:42:03 +00:00
< script type = " text/javascript " >
document . forms [ 'main' ] . newlogin . focus ();
document . forms [ 'main' ] . setAttribute ( 'autocomplete' , 'off' );
</ script >
2009-09-08 05:29:38 +00:00
< ? php include_once ( " foot.php " ); ?>