2006-05-22 09:03:51 +00:00
< ? php
/*
----------------------------------------------------------------------
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
----------------------------------------------------------------------
*/
2017-10-12 15:54:48 +00:00
/**
* Manage the list of allowed accounts to operate as secondary MX
* those account are allowed to list the hosted domains
* to configure their postfix as a secondary MX
*
* @ copyright AlternC - Team 2000 - 2017 https :// alternc . com /
*/
2006-05-22 09:03:51 +00:00
require_once ( " ../class/config.php " );
if ( ! $admin -> enabled ) {
2017-10-06 16:04:36 +00:00
$msg -> raise ( " ERROR " , " admin " , _ ( " This page is restricted to authorized staff " ));
2017-08-15 15:03:56 +00:00
echo $msg -> msg_html_all ();
2006-05-22 09:03:51 +00:00
exit ();
}
2009-09-08 05:29:38 +00:00
$fields = array (
" delaccount " => array ( " request " , " string " , " " ),
2016-05-23 13:03:13 +00:00
" newlogin " => array ( " post " , " string " , " " ),
" newpass " => array ( " post " , " string " , " " ),
2009-09-08 05:29:38 +00:00
);
getFields ( $fields );
2006-05-22 09:03:51 +00:00
if ( $delaccount ) {
// Delete an account
if ( $mail -> del_slave_account ( $delaccount )) {
2017-10-06 16:04:36 +00:00
$msg -> raise ( " INFO " , " admin " , _ ( " The requested account has been deleted. It is now denied. " ));
2006-05-22 09:03:51 +00:00
}
}
if ( $newlogin ) {
// Add an account
if ( $mail -> add_slave_account ( $newlogin , $newpass )) {
2017-10-06 16:04:36 +00:00
$msg -> raise ( " INFO " , " admin " , _ ( " The requested account address has been created. It is now allowed. " ));
2014-03-27 13:50:44 +00:00
$newlogin = '' ; $newpass = '' ;
2006-05-22 09:03:51 +00:00
}
}
2009-09-08 05:29:38 +00:00
include_once ( " head.php " );
2017-08-15 15:03:56 +00:00
$c = $admin -> listPasswordPolicies ();
$passwd_classcount = $c [ 'adm' ][ 'classcount' ];
2006-05-22 09:03:51 +00:00
?>
< 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
$c = $mail -> enum_slave_account ();
2017-08-15 15:03:56 +00:00
echo $msg -> msg_html_all ();
2006-05-22 09:03:51 +00:00
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
2013-05-23 16:18:56 +00:00
for ( $i = 0 ; $i < count ( $c ); $i ++ ) { ?>
2006-05-22 09:03:51 +00:00
2013-05-23 16:18:56 +00:00
< tr class = " lst " >
2013-04-25 12:39:24 +00:00
< td class = " center " >< div class = " ina delete " >< a href = " adm_mxaccount.php?delaccount=<?php echo urlencode( $c[$i] [ " login " ]); ?> " >< ? 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>
2016-01-14 15:24:00 +00:00
< form method = " post " action = " adm_mxaccount.php " name = " main " id = " main " autocomplete = " off " >
2016-05-20 12:21:47 +00:00
< ? php csrf_get (); ?>
2016-01-14 15:24:00 +00:00
<!-- honeypot fields -->
< input type = " text " style = " display: none " id = " fakeUsername " name = " fakeUsername " value = " " />
< input type = " password " style = " display: none " id = " fakePassword " name = " fakePassword " value = " " />
2010-06-02 22:42:03 +00:00
< 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 >
2017-08-15 15:03:56 +00:00
< td >< input type = " password " class = " int " autocomplete = " off " value = " <?php ehe( $newpass ); ?> " id = " newpass " name = " newpass " maxlength = " 64 " size = " 32 " />< ? php display_div_generate_password ( DEFAULT_PASS_SIZE , " #newpass " , " " , $passwd_classcount ); ?> </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 " />
2013-04-23 23:32:55 +00:00
</ td ></ tr >
2006-05-22 09:03:51 +00:00
</ table >
</ form >
2010-06-02 22:42:03 +00:00
< script type = " text/javascript " >
document . forms [ 'main' ] . newlogin . focus ();
</ script >
2009-09-08 05:29:38 +00:00
< ? php include_once ( " foot.php " ); ?>