You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
190 lines
9.1 KiB
PHTML
190 lines
9.1 KiB
PHTML
18 years ago
|
<div id="overview">
|
||
|
<form name="search" method="post" action="search.php">
|
||
18 years ago
|
<table width=750><tr>
|
||
|
<td>
|
||
|
<h4><?php print $PALANG['pSearch_welcome'] . $fSearch; ?></h4>
|
||
|
</td>
|
||
|
<td>
|
||
18 years ago
|
<?php print $PALANG['pSearch']; ?>:<input type="textbox" name="search">
|
||
18 years ago
|
</td>
|
||
|
|
||
|
<?php
|
||
17 years ago
|
if (authentication_has_role('global-admin')) {
|
||
18 years ago
|
print '<td></td>';
|
||
17 years ago
|
print '<td align=right><select class="flat" name="fDomain" >';
|
||
|
|
||
18 years ago
|
} else {
|
||
|
print '<td align=right><select class="flat" name="fDomain" >';
|
||
|
}
|
||
|
|
||
18 years ago
|
print "<option value=\"$list_domains[0]\" selected>$list_domains[0]</option>\n";
|
||
|
for ($i = 1; $i < sizeof ($list_domains); $i++)
|
||
|
{
|
||
|
print "<option value=\"$list_domains[$i]\">$list_domains[$i]</option>\n";
|
||
|
}
|
||
|
?>
|
||
|
</select>
|
||
18 years ago
|
<?php
|
||
17 years ago
|
if (authentication_has_role('global-admin')) {
|
||
18 years ago
|
?>
|
||
17 years ago
|
<input class="button" type="submit" name="fGo" value="<?php print $PALANG['pReturn_to'] . ' ' . $PALANG['pAdminMenu_list_virtual']; ?>" /></td>
|
||
18 years ago
|
<?php
|
||
|
} else {
|
||
|
?>
|
||
17 years ago
|
<input class="button" type="submit" name="fGo" value="<?php print $PALANG['pReturn_to'] . ' ' . $PALANG['pMenu_overview']; ?>" /></td>
|
||
18 years ago
|
<?php
|
||
|
}
|
||
|
?>
|
||
|
|
||
18 years ago
|
</tr></table>
|
||
18 years ago
|
</form>
|
||
|
</div>
|
||
|
|
||
|
<?php
|
||
|
if (sizeof ($tAlias) > 0)
|
||
|
{
|
||
|
print "<table id=\"alias_table\">\n";
|
||
|
print " <tr>\n";
|
||
|
print " <td colspan=\"5\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>";
|
||
|
print " </tr>";
|
||
|
print " <tr class=\"header\">\n";
|
||
|
print " <td>" . $PALANG['pOverview_alias_address'] . "</td>\n";
|
||
|
print " <td>" . $PALANG['pOverview_alias_goto'] . "</td>\n";
|
||
|
print " <td>" . $PALANG['pOverview_alias_modified'] . "</td>\n";
|
||
18 years ago
|
print " <td>" . $PALANG['pOverview_alias_active'] . "</td>\n";
|
||
18 years ago
|
print " <td colspan=\"2\"> </td>\n";
|
||
|
print " </tr>\n";
|
||
|
|
||
|
for ($i = 0; $i < sizeof ($tAlias); $i++)
|
||
|
{
|
||
|
if ((is_array ($tAlias) and sizeof ($tAlias) > 0))
|
||
|
{
|
||
|
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
|
||
17 years ago
|
//highlight search string
|
||
17 years ago
|
$tAlias[$i]['display_address'] = $tAlias[$i]['address'];
|
||
|
if (stristr($tAlias[$i]['display_address'],$fSearch))
|
||
17 years ago
|
{
|
||
|
$new_address = str_ireplace($fSearch, "<span style='background-color: lightgreen'>" .
|
||
17 years ago
|
$fSearch . "</span>", $tAlias[$i]['display_address']);
|
||
|
$tAlias[$i]['display_address'] = $new_address;
|
||
17 years ago
|
}
|
||
17 years ago
|
print " <td>" . $tAlias[$i]['display_address'] . "</td>\n";
|
||
17 years ago
|
if (stristr($tAlias[$i]['goto'],$fSearch))
|
||
|
{
|
||
|
$new_goto = str_ireplace($fSearch, "<span style='background-color: lightgreen'>" .
|
||
|
$fSearch . "</span>", $tAlias[$i]['goto']);
|
||
|
$tAlias[$i]['goto'] = $new_goto;
|
||
|
}
|
||
18 years ago
|
print " <td>" . ereg_replace (",", "<br>", $tAlias[$i]['goto']) . "</td>\n";
|
||
|
print " <td>" . $tAlias[$i]['modified'] . "</td>\n";
|
||
17 years ago
|
if ($CONF['special_alias_control'] == 'YES' || authentication_has_role('global-admin'))
|
||
18 years ago
|
{
|
||
18 years ago
|
$active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
|
||
|
print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "&return=search.php?search=" . urlencode ($fSearch) . "\">" . $active . "</a></td>\n";
|
||
18 years ago
|
print " <td><a href=\"edit-alias.php?address=" . urlencode ($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
|
||
18 years ago
|
print " <td><a href=\"delete.php?";
|
||
17 years ago
|
if (authentication_has_role('global-admin')) {
|
||
18 years ago
|
print "table=alias&";
|
||
|
}
|
||
|
print "delete=" . urlencode ($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
|
||
18 years ago
|
}
|
||
|
else
|
||
|
{
|
||
|
if (check_alias_owner ($SESSID_USERNAME, $tAlias[$i]['address']))
|
||
|
{
|
||
18 years ago
|
$active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
|
||
|
print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "&return=search.php?search=" . urlencode ($fSearch) . "\">" . $active . "</a></td>\n";
|
||
18 years ago
|
print " <td><a href=\"edit-alias.php?address=" . urlencode ($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
|
||
|
print " <td><a href=\"delete.php?delete=" . urlencode ($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
print " <td> </td>\n";
|
||
|
print " <td> </td>\n";
|
||
|
}
|
||
|
}
|
||
|
print " </tr>\n";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
print "</table>\n";
|
||
|
}
|
||
|
|
||
|
if (sizeof ($tMailbox) > 0)
|
||
|
{
|
||
|
print "<table id=\"mailbox_table\">\n";
|
||
|
print " <tr>\n";
|
||
|
print " <td colspan=\"7\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>";
|
||
|
print " </tr>";
|
||
|
print " <tr class=\"header\">\n";
|
||
|
print " <td>" . $PALANG['pOverview_mailbox_username'] . "</td>\n";
|
||
|
print " <td>" . $PALANG['pOverview_mailbox_name'] . "</td>\n";
|
||
|
if ($CONF['quota'] == 'YES') print " <td>" . $PALANG['pOverview_mailbox_quota'] . "</td>\n";
|
||
|
print " <td>" . $PALANG['pOverview_mailbox_modified'] . "</td>\n";
|
||
|
print " <td>" . $PALANG['pOverview_mailbox_active'] . "</td>\n";
|
||
|
print " <td colspan=\"2\"> </td>\n";
|
||
|
$colspan=2;
|
||
|
if ($CONF['vacation_control_admin'] == 'YES') $colspan=$colspan+1;
|
||
|
if ($CONF['alias_control_admin'] == 'YES') $colspan=$colspan+1;
|
||
18 years ago
|
|
||
17 years ago
|
if (authentication_has_role('global-admin') && $CONF['alias_control'] == 'YES') {
|
||
18 years ago
|
$colspan = 3;
|
||
|
}
|
||
18 years ago
|
print " <td colspan=\"$colspan\"> </td>\n";
|
||
|
print " </tr>\n";
|
||
|
|
||
|
for ($i = 0; $i < sizeof ($tMailbox); $i++)
|
||
|
{
|
||
|
if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0))
|
||
|
{
|
||
|
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
|
||
17 years ago
|
$tMailbox[$i]['display_username'] = $tMailbox[$i]['username'];
|
||
|
if (stristr($tMailbox[$i]['display_username'],$fSearch))
|
||
17 years ago
|
{
|
||
|
$new_name = str_ireplace($fSearch, "<span style='background-color: lightgreen'>" .
|
||
17 years ago
|
$fSearch . "</span>", $tMailbox[$i]['display_username']);
|
||
|
$tMailbox[$i]['display_username'] = $new_name;
|
||
17 years ago
|
}
|
||
17 years ago
|
print " <td>" . $tMailbox[$i]['display_username'] . "</td>\n";
|
||
17 years ago
|
if (stristr($tMailbox[$i]['name'],$fSearch))
|
||
|
{
|
||
|
$new_name = str_ireplace($fSearch, "<span style='background-color: lightgreen'>" .
|
||
|
$fSearch . "</span>", $tMailbox[$i]['name']);
|
||
|
$tMailbox[$i]['name'] = $new_name;
|
||
|
}
|
||
18 years ago
|
print " <td>" . $tMailbox[$i]['name'] . "</td>\n";
|
||
|
if ($CONF['quota'] == 'YES') print " <td>" . divide_quota ($tMailbox[$i]['quota']) . "</td>\n";
|
||
|
print " <td>" . $tMailbox[$i]['modified'] . "</td>\n";
|
||
|
$active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
|
||
18 years ago
|
print " <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "&return=search.php?search=" . urlencode ($fSearch) . "\">" . $active . "</a></td>\n";
|
||
18 years ago
|
|
||
|
$has_alias_control = 0; # temporary variable to simplify admin vs. superadmin code
|
||
17 years ago
|
if (authentication_has_role('global-admin')) {
|
||
18 years ago
|
if ($CONF['alias_control'] == 'YES') $has_alias_control = 1;
|
||
|
} else {
|
||
|
if ($CONF['alias_control_admin'] == 'YES') $has_alias_control = 1;
|
||
|
if ($CONF['vacation_control_admin'] == 'YES')
|
||
|
{
|
||
|
$v_active = ($tMailbox[$i]['v_active'] == 1) ? $PALANG['pOverview_vacation_edit'] : '';
|
||
|
print " <td><a href=\"edit-vacation.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $v_active . "</a></td>\n";
|
||
|
}
|
||
18 years ago
|
}
|
||
18 years ago
|
if ($has_alias_control == 1)
|
||
18 years ago
|
{
|
||
|
print " <td><a href=\"edit-alias.php?address=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $PALANG['pOverview_alias_edit'] . "</a></td>\n";
|
||
|
}
|
||
18 years ago
|
|
||
18 years ago
|
print " <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
|
||
18 years ago
|
print " <td><a href=\"delete.php?";
|
||
17 years ago
|
if (authentication_has_role('global-admin')) {
|
||
18 years ago
|
print "table=mailbox&";
|
||
|
}
|
||
|
print "delete=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
|
||
18 years ago
|
print " </tr>\n";
|
||
|
}
|
||
|
}
|
||
|
print "</table>\n";
|
||
|
}
|
||
18 years ago
|
# vim: ts=3 expandtab ft=php
|
||
18 years ago
|
?>
|