2006-04-26 12:28:53 +00:00
< ? php
/*
$Id : mail_list . php , v 1.8 2005 / 04 / 01 16 : 05 : 26 benjamin 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 , Franck Missoum
Purpose of file : Show the mail account list on domain $dom
----------------------------------------------------------------------
*/
require_once ( " ../class/config.php " );
2009-09-08 05:29:38 +00:00
include_once ( " head.php " );
2006-04-26 12:28:53 +00:00
2009-09-08 05:29:38 +00:00
$fields = array (
" domain " => array ( " request " , " string " , " " ),
" letter " => array ( " get " , " string " , " " ),
);
getFields ( $fields );
if ( ! $domain )
{
include ( " main.php " );
exit ();
2006-04-26 12:28:53 +00:00
}
if ( ! $res = $mail -> enum_doms_mails ( $domain , 1 , $letter )) {
$error = $err -> errstr ();
?>
2010-04-28 23:58:29 +00:00
< h3 >< ? php printf ( _ ( " Email addresses of the domain %s " ), $domain ); ?> : </h3>
2009-09-08 05:29:38 +00:00
< ? php
2006-04-26 12:28:53 +00:00
if ( $error ) {
echo " <p class= \" error \" > $error </p> " ;
}
2010-04-06 20:29:08 +00:00
?>
2010-04-29 21:31:46 +00:00
< hr id = " topbar " />
< br />
2010-04-06 20:29:08 +00:00
< p >
2011-03-27 13:00:19 +00:00
< span class = " inb " >< a href = " mail_add.php?domain=<?php echo $domain ; ?> " >< ? php printf ( _ ( " Add a mailbox on <b>%s</b> " ), $domain ); ?> </a></span>
</ p >< p >
< span class = " inb " >< a href = " mail_add.php?many=1&domain=<?php echo $domain ; ?> " >< ? php printf ( _ ( " Add many mailboxes on <b>%s</b> " ), $domain ); ?> </a></span>
2010-04-06 20:29:08 +00:00
</ p >
< ?
2006-04-26 12:28:53 +00:00
}
2009-09-08 05:29:38 +00:00
else
{
2006-04-26 12:28:53 +00:00
?>
2010-04-28 23:58:29 +00:00
< h3 >< ? php printf ( _ ( " Email addresses of the domain %s " ), $domain ); ?> : </h3>
2006-04-26 12:28:53 +00:00
< ? php
2011-03-06 22:37:34 +00:00
if ( isset ( $error ) && $error ) {
2006-04-26 12:28:53 +00:00
echo " <p class= \" error \" > $error </p> " ;
}
2010-04-06 20:29:08 +00:00
?>
2010-04-29 21:31:46 +00:00
< hr id = " topbar " />
< br />
2010-04-06 20:29:08 +00:00
< p >
2011-03-27 13:00:19 +00:00
< span class = " inb " >< a href = " mail_add.php?domain=<?php echo $domain ; ?> " >< ? php printf ( _ ( " Add a mailbox on <b>%s</b> " ), $domain ); ?> </a></span>
</ p >< p >
< span class = " inb " >< a href = " mail_add.php?many=1&domain=<?php echo $domain ; ?> " >< ? php printf ( _ ( " Add many mailboxes on <b>%s</b> " ), $domain ); ?> </a></span>
2010-04-06 20:29:08 +00:00
</ p >
< ? php
2006-04-26 12:28:53 +00:00
if ( ! $letters = $mail -> enum_doms_mails_letters ( $domain ))
$error = $err -> errstr ();
else {
2010-04-06 20:29:08 +00:00
echo " <p> " ;
__ ( " Show only mail starting by: " );
echo " " ;
2006-04-26 12:28:53 +00:00
for ( $i = 0 ; $i < count ( $letters ); $i ++ ){
$val = $letters [ $i ];
echo " <a href= \" mail_list.php?domain= $domain &letter= $val\ " > $val & nbsp ; </ a > " ;
}
echo " <a href= \" mail_list.php?domain= $domain\ " > " .sprintf(_( " All " )). " </ a > " ;
2010-04-06 20:29:08 +00:00
echo " </p> " ;
2006-04-26 12:28:53 +00:00
}
2009-09-08 05:29:38 +00:00
if ( $res [ " count " ]) {
2006-04-26 12:28:53 +00:00
?>
2006-05-16 19:42:25 +00:00
< form method = " post " action = " mail_del.php " id = " main " >
2006-04-26 12:28:53 +00:00
2010-04-06 20:29:08 +00:00
< table class = " tlist " >
2006-04-26 12:28:53 +00:00
2011-02-09 08:37:23 +00:00
< tr >< th colspan = " 2 " >< input type = " hidden " name = " domain " value = " <?php echo $domain ?> " /> </ th >
< th >< ? php __ ( " Email address " ); ?> </th><th><?php __("Size"); ?></th><th> </th></tr>
2006-04-26 12:28:53 +00:00
< ? php
$col = 1 ;
for ( $i = 0 ; $i < $res [ " count " ]; $i ++ ) {
$col = 3 - $col ;
$val = $res [ $i ];
echo " <tr class= \" lst $col\ " > " ;
2010-04-06 20:29:08 +00:00
echo " <td align= \" center \" ><input class= \" inc \" type= \" checkbox \" id= \" del_ $i\ " name = \ " d[] \" value= \" " . $val [ " mail " ] . " \" /></td> " ;
?>
< td >< div class = " ina " >< a href = " mail_edit.php?email=<?php echo urlencode( $val["mail"] ); ?>&domain=<?php echo urlencode( $domain ); ?> " >< img src = " images/edit.png " alt = " <?php __( " Edit " ); ?> " />< ? php __ ( " Edit " ); ?> </a></div></td>
< ? php
echo " <td><label for= \" del_ $i\ " > " . $val["mail"] . " </ label ></ td > " ;
2006-04-26 12:28:53 +00:00
if ( $val [ " pop " ]) {
echo " <td> " . format_size ( $val [ " size " ]) . " </td> " ;
} else {
echo " <td> </td> " ;
}
2010-12-20 15:04:19 +00:00
echo " <td> " ;
if ( ! is_null ( $val [ 'expiration_date' ])) {
2011-03-27 13:00:19 +00:00
// It's a temporary account
$trash_info = new m_trash ();
$trash_info -> set_from_db ( $val [ " expiration_date " ]);
echo __ ( " This account will be deleted on " ); echo " <br /> " . $trash_info -> human_display ();
2010-12-20 15:04:19 +00:00
}
echo " </td> " ;
2006-04-26 12:28:53 +00:00
echo " </tr> " ;
}
?>
</ table >
2010-04-06 20:29:08 +00:00
< br />
2010-04-28 23:58:29 +00:00
< input type = " submit " class = " inb " name = " submit " value = " <?php __( " Delete the checked email addresses " ); ?> " />
2006-04-26 12:28:53 +00:00
</ form >
< ? php
2009-09-08 05:29:38 +00:00
}
2006-04-26 12:28:53 +00:00
}
?>
2009-09-08 05:29:38 +00:00
< ? php include_once ( " foot.php " ); ?>