2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2012-04-06 10:10:36 +00:00
|
|
|
$Id: mail_list.php, author: squidly
|
2006-04-26 12:28:53 +00:00
|
|
|
----------------------------------------------------------------------
|
|
|
|
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
|
|
|
|
----------------------------------------------------------------------
|
2012-04-06 10:10:36 +00:00
|
|
|
Purpose of file: listing of mail accounts
|
2006-04-26 12:28:53 +00:00
|
|
|
----------------------------------------------------------------------
|
|
|
|
*/
|
2012-04-06 10:10:36 +00:00
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
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", ""),
|
2012-04-06 10:10:36 +00:00
|
|
|
"domain_id" => array ("request", "integer", ""),
|
2009-09-08 05:29:38 +00:00
|
|
|
);
|
|
|
|
|
2012-04-06 10:10:36 +00:00
|
|
|
$champs=getFields($fields);
|
|
|
|
|
|
|
|
if( !$domain && !$domain_id )
|
2009-09-08 05:29:38 +00:00
|
|
|
{
|
|
|
|
include("main.php");
|
|
|
|
exit();
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
|
|
|
|
2012-04-06 10:10:36 +00:00
|
|
|
$domain_id=$champs["domain_id"];
|
|
|
|
|
|
|
|
if(!$mails_list = $mail->enum_domain_mails($domain_id)){
|
|
|
|
$error=$err->errstr();
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
2010-04-06 20:29:08 +00:00
|
|
|
?>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
|
|
<?php
|
2012-04-06 10:10:36 +00:00
|
|
|
if (isset($error)) {
|
|
|
|
echo "<p class=\"error\">$error</p>";
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
|
|
|
|
2012-04-06 10:10:36 +00:00
|
|
|
//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
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
|
|
|
|
2012-04-06 10:10:36 +00:00
|
|
|
if (empty($mails_list)){ // If there is no mail for this domain
|
|
|
|
__("No mail for this domain");
|
|
|
|
} else {
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
|
|
|
|
2012-04-06 10:10:36 +00:00
|
|
|
<h3><?php printf(_("Email addresses of the domain %s"),$domain); ?> : </h3>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
2012-04-06 10:10:36 +00:00
|
|
|
<table class="tlist">
|
|
|
|
<tr><th><?php __("Active");?></th><th align=center><?php __("Address"); ?></th><th><?php __("State"); ?></th></tr>
|
2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
2012-04-06 10:10:36 +00:00
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
$col=1;
|
2012-04-06 10:10:36 +00:00
|
|
|
//listing of every mail of the current domain.
|
|
|
|
while (list($key,$val)=each($mails_list)){
|
2006-04-26 12:28:53 +00:00
|
|
|
$col=3-$col;
|
2012-04-06 10:10:36 +00:00
|
|
|
?>
|
|
|
|
<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
|
2006-04-26 12:28:53 +00:00
|
|
|
}
|
2012-04-06 10:10:36 +00:00
|
|
|
} // end if no mail for this domain
|
2006-04-26 12:28:53 +00:00
|
|
|
?>
|
2012-04-06 10:10:36 +00:00
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
</table>
|
|
|
|
|
2009-09-08 05:29:38 +00:00
|
|
|
<?php include_once("foot.php"); ?>
|