AlternC/bureau/admin/mail_list.php

104 lines
3.4 KiB
PHP
Raw Normal View History

<?php
/*
$Id: mail_list.php, author: squidly
----------------------------------------------------------------------
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
----------------------------------------------------------------------
Purpose of file: listing of mail accounts
----------------------------------------------------------------------
*/
require_once("../class/config.php");
2009-09-08 05:29:38 +00:00
include_once("head.php");
2009-09-08 05:29:38 +00:00
$fields = array (
"domain" => array ("request", "string", ""),
"domain_id" => array ("request", "integer", ""),
2009-09-08 05:29:38 +00:00
);
$champs=getFields($fields);
if( !$domain && !$domain_id )
2009-09-08 05:29:38 +00:00
{
include("main.php");
exit();
}
$domain_id=$champs["domain_id"];
if(!$mails_list = $mail->enum_domain_mails($domain_id)){
$error=$err->errstr();
}
2010-04-06 20:29:08 +00:00
?>
<?php
if (isset($error)) {
echo "<p class=\"error\">$error</p>";
}
//Mail creation.
if ($quota->cancreate("mail")) { ?>
<h3><?php __("Create a new mail account");?></h3>
<form method="post" action="mail_doadd.php" id="main" name="mail_create" onsubmit="return is_valid_mail2()">
<input type="text" class="int" name="mail_arg" value="" size="20" id="mail_arg" maxlength="32" /><span id="emaildom" class="int" > <?php echo "@".$domain; ?></span>
<input type="hidden" name="domain_id" value="<?php echo $domain_id;?>" />
<input type="hidden" name="domain" value="<?php echo $domain;?>" />
<input type="submit" name="submit" class="inb" value="<?php __("Create"); ?>" />
</form>
<?php
}
if (empty($mails_list)){ // If there is no mail for this domain
__("No mail for this domain");
} else {
?>
<h3><?php printf(_("Email addresses of the domain %s"),$domain); ?> : </h3>
<table class="tlist">
<tr><th><?php __("Active");?></th><th align=center><?php __("Address"); ?></th><th><?php __("State"); ?></th></tr>
<?php
$col=1;
//listing of every mail of the current domain.
while (list($key,$val)=each($mails_list)){
$col=3-$col;
?>
<tr class="lst_clic<?php echo $col; ?>" onclick="javascript:window.location.href='mail_properties.php?mail_id=<?php echo $val["id"]; ?>'">
<td><?php if ($val["enabled"] ) { ?>
<img src="images/check_ok.png" alt="<?php __("Enabled"); ?>" />
<?php } else { ?>
<img src="images/check_no.png" alt="<?php __("Disabled"); ?>" />
<?php } // if enabled ?>
</td>
<td align=right><?php echo $val["address"]."@".$domain ?></td>
<td><div class="ina"><a href="mail_properties.php?mail_id=<?php echo $val["id"] ?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" /><?php __("Edit"); ?></a></div></td>
</tr>
<?php
}
} // end if no mail for this domain
?>
</table>
2009-09-08 05:29:38 +00:00
<?php include_once("foot.php"); ?>