- merged admin_search.tpl into search.tpl (using some check_admin() switches)

- admin_search.tpl now simply require()s search.tpl
- admin_search.tpl still contains the old code for reference (commented out)

- note: maybe some cleanup about the admin/superadmin diffs can/should be done
  in search.tpl. I just did the merge for now.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@34 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
Christian Boltz 18 years ago
parent bf472e9f16
commit 65d830b1d2

@ -1,3 +1,9 @@
<?php
require(dirname(__FILE__) . '/search.tpl');
/* old code, should be deleted after testing the merge with templates/search.php
?>
<div id="overview">
<form name="search" method="post" action="search.php">
<table width=750><tr>
@ -99,4 +105,6 @@ if (sizeof ($tMailbox) > 0)
}
print "</table>\n";
}
/* */
?>

@ -8,9 +8,14 @@
<?php print $PALANG['pSearch']; ?>:<input type="textbox" name="search">
</td>
<td></td>
<td align=right><select class="flat" name="domain" >
<?php
if (check_admin($SESSID_USERNAME)) {
print '<td></td>';
print '<td align=right><select class="flat" name="domain" >';
} else {
print '<td align=right><select class="flat" name="fDomain" >';
}
print "<option value=\"$list_domains[0]\" selected>$list_domains[0]</option>\n";
for ($i = 1; $i < sizeof ($list_domains); $i++)
{
@ -18,7 +23,19 @@ for ($i = 1; $i < sizeof ($list_domains); $i++)
}
?>
</select>
<?php
if (check_admin($SESSID_USERNAME)) {
# TODO: make "Return to" translatable
?>
<input class="button" type="submit" name="fGo" value="Return to <?php print $PALANG['pAdminMenu_list_virtual']; ?>" /></td>
<?php
} else {
?>
<input class="button" type="submit" name="fgo" value="Return to <?php print $PALANG['pMenu_overview']; ?>" /></td>
<?php
}
?>
</tr></table>
</form>
</div>
@ -46,12 +63,16 @@ if (sizeof ($tAlias) > 0)
print " <td>" . $tAlias[$i]['address'] . "</td>\n";
print " <td>" . ereg_replace (",", "<br>", $tAlias[$i]['goto']) . "</td>\n";
print " <td>" . $tAlias[$i]['modified'] . "</td>\n";
if ($CONF['special_alias_control'] == 'YES')
if ($CONF['special_alias_control'] == 'YES' || check_admin($SESSID_USERNAME))
{
$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";
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";
print " <td><a href=\"delete.php?";
if (check_admin($SESSID_USERNAME)) {
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";
}
else
{
@ -91,6 +112,10 @@ if (sizeof ($tMailbox) > 0)
$colspan=2;
if ($CONF['vacation_control_admin'] == 'YES') $colspan=$colspan+1;
if ($CONF['alias_control_admin'] == 'YES') $colspan=$colspan+1;
if (check_admin($SESSID_USERNAME) && $CONF['alias_control'] == 'YES') {
$colspan = 3;
}
print " <td colspan=\"$colspan\">&nbsp;</td>\n";
print " </tr>\n";
@ -105,20 +130,33 @@ if (sizeof ($tMailbox) > 0)
print " <td>" . $tMailbox[$i]['modified'] . "</td>\n";
$active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
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";
$has_alias_control = 0; # temporary variable to simplify admin vs. superadmin code
if (check_admin($SESSID_USERNAME)) {
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";
}
if ($CONF['alias_control_admin'] == 'YES')
}
if ($has_alias_control == 1)
{
print " <td><a href=\"edit-alias.php?address=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $PALANG['pOverview_alias_edit'] . "</a></td>\n";
}
print " <td><a href=\"edit-mailbox.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?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";
print " <td><a href=\"delete.php?";
if (check_admin($SESSID_USERNAME)) {
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";
print " </tr>\n";
}
}
print "</table>\n";
}
# vim: ts=3 expandtab ft=php
?>

Loading…
Cancel
Save