opensmtpdadmin/templates/list-virtuals.tpl

112 lines
6.1 KiB
Smarty

<div id="overview">
<form name="select_domain" method="get">
<select name="domain" onChange="this.form.submit()";>
<?php
if (count($list_domains) > 0) {
foreach ($list_domains as $row) {
echo '<option value="' . $row['domain'] . '"';
if (isset($domain) && $domain == $row['domain']) echo ' selected';
echo ">" . $row['domain'] . "</option>\n";
}
}
if ($list_domains[$domain_key]['aliases'] == 0) $list_domains[$domain_key]['aliases'] = $PALANG['pOverview_unlimited'];
if ($list_domains[$domain_key]['aliases'] < 0) $list_domains[$domain_key]['aliases'] = $PALANG['pOverview_disabled'];
if ($list_domains[$domain_key]['mailboxes'] == 0) $list_domains[$domain_key]['mailboxes'] = $PALANG['pOverview_unlimited'];
if ($list_domains[$domain_key]['mailboxes'] < 0) $list_domains[$domain_key]['mailboxes'] = $PALANG['pOverview_disabled'];
if ($list_domains[$domain_key]['maxquota'] == 0) $list_domains[$domain_key]['maxquota'] = $PALANG['pOverview_unlimited'];
if ($list_domains[$domain_key]['maxquota'] < 0) $list_domains[$domain_key]['maxquota'] = $PALANG['pOverview_disabled'];
?>
</select>
<input type="hidden" name="offset" value="0">
<input class="button" type="submit" name="go" value="<?php echo $PALANG['pOverview_button']; ?>" />
</form>
<h4><?php echo $PALANG['pOverview_welcome'] . $domain; ?></h4>
<p><?php echo $PALANG['pOverview_alias_alias_count'] . ": " . $list_domains[$domain_key]['alias_count'] . " / " . $list_domains[$domain_key]['aliases']; ?></p>
<p><?php echo $PALANG['pOverview_alias_mailbox_count'] . ": " . $list_domains[$domain_key]['mailbox_count'] . " / " . $list_domains[$domain_key]['mailboxes']; ?></p>
<form name="search" method="post" action="search.php">
<input type="textbox" name="search" size="25">
</form>
</div>
<?php
if ($list_domains[$domain_key]['alias_count'] > $limit || $list_domains[$domain_key]['mailbox_count'] > $limit) {
echo "<div id=\"nav_bar\">\n";
if ($offset >= $limit) {
echo "<a href=\"overview.php?domain=" . $_GET['domain'] . "&offset=" . ($offset - $limit) . "\"><img border=\"0\" src=\"images/arrow-l.png\" title=\"" . $PALANG['pOverview_left_arrow'] . "\"></a>\n";
}
if (($list_domains[$domain_key]['alias_count'] > $limit) || ($list_domains[$domain_key]['mailbox_count'] > $limit)) {
echo "<a href=\"overview.php?domain=" . $_GET['domain'] . "&offset=0\"><img border=\"0\" src=\"images/arrow-u.png\" title=\"" . $PALANG['pOverview_up_arrow'] . "\"></a>\n";
}
if ((($offset + $limit) < $list_domains[$domain_key]['alias_count']) || (($offset + $limit) < $list_domains[$domain_key]['mailbox_count'])) {
echo "<a href=\"overview.php?domain=" . $_GET['domain'] . "&offset=" . ($offset + $limit) . "\"><img border=\"0\" src=\"images/arrow-r.png\" title=\"" . $PALANG['pOverview_right_arrow'] . "\"></a>\n";
}
echo "</div>\n";
}
if (count($list_alias) > 0) {
echo "<table id=\"alias_table\">\n";
echo " <tr>\n";
echo " <td colspan=\"5\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>";
echo " </tr>";
echo " <tr class=\"header\">\n";
echo " <td>" . $PALANG['pOverview_alias_address'] . "</td>\n";
echo " <td>" . $PALANG['pOverview_alias_goto'] . "</td>\n";
echo " <td>" . $PALANG['pOverview_alias_modified'] . "</td>\n";
echo " <td colspan=\"2\">&nbsp;</td>\n";
echo " </tr>\n";
foreach ($list_alias as $row) {
echo " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
echo " <td>" . $row['address'] . "</td>\n";
echo " <td>" . preg_replace("/,/", "<br>", $row['goto']) . "</td>\n";
echo " <td>" . $row['modified'] . "</td>\n";
if ($CONF['special_alias_control'] == 'YES') {
echo " <td><a href=\"edit-alias.php?address=" . urlencode($row['address']) . "&domain=" . $list_domains[$domain_key]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . urlencode($row['address']) . "&domain=" . $list_domains[$domain_key]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
} else {
if (!in_array($row['goto'], $CONF['default_aliases'])) {
echo " <td><a href=\"edit-alias.php?address=" . urlencode($row['address']) . "&domain=" . $row['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . urlencode($row['address']) . "&domain=" . $row['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
} else {
echo " <td>&nbsp;</td>\n";
echo " <td>&nbsp;</td>\n";
}
}
echo " </tr>\n";
}
echo "</table>\n";
}
if (count($list_mailbox) > 0) {
echo "<table id=\"mailbox_table\">\n";
echo " <tr>\n";
echo " <td colspan=\"7\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>";
echo " </tr>";
echo " <tr class=\"header\">\n";
echo " <td>" . $PALANG['pOverview_mailbox_username'] . "</td>\n";
echo " <td>" . $PALANG['pOverview_mailbox_name'] . "</td>\n";
echo " <td>" . $PALANG['pOverview_mailbox_modified'] . "</td>\n";
echo " <td>" . $PALANG['pOverview_mailbox_active'] . "</td>\n";
echo " <td colspan=\"2\">&nbsp;</td>\n";
echo " </tr>\n";
foreach ($list_mailbox as $row) {
echo " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
echo " <td>" . $row['username'] . "</td>\n";
echo " <td>" . $row['name'] . "</td>\n";
echo " <td>" . $row['modified'] . "</td>\n";
$active = ($row['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
echo " <td><a href=\"edit-active.php?username=" . urlencode($row['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
echo " <td><a href=\"edit-mailbox.php?username=" . urlencode($row['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . urlencode($row['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $row['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
echo " </tr>\n";
}
echo "</table>\n";
}
?>