From 65d830b1d20fb1c205a1e667ac1b1ac47bd1195a Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 17 Aug 2007 19:15:45 +0000 Subject: [PATCH] - 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 --- templates/admin_search.tpl | 8 +++++ templates/search.tpl | 60 +++++++++++++++++++++++++++++++------- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/templates/admin_search.tpl b/templates/admin_search.tpl index d5a63339..6081410b 100644 --- a/templates/admin_search.tpl +++ b/templates/admin_search.tpl @@ -1,3 +1,9 @@ + +
@@ -99,4 +105,6 @@ if (sizeof ($tMailbox) > 0) } print "
\n"; } + +/* */ ?> diff --git a/templates/search.tpl b/templates/search.tpl index f9552b78..83b55100 100644 --- a/templates/search.tpl +++ b/templates/search.tpl @@ -8,9 +8,14 @@ : - -'; +} else { + print ' - + + + + + +
@@ -46,12 +63,16 @@ if (sizeof ($tAlias) > 0) print " " . $tAlias[$i]['address'] . "\n"; print " " . ereg_replace (",", "
", $tAlias[$i]['goto']) . "\n"; print " " . $tAlias[$i]['modified'] . "\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 " " . $active . "\n"; print " " . $PALANG['edit'] . "\n"; - print " " . $PALANG['del'] . "\n"; + print " " . $PALANG['del'] . "\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 "  \n"; print " \n"; @@ -105,20 +130,33 @@ if (sizeof ($tMailbox) > 0) print " " . $tMailbox[$i]['modified'] . "\n"; $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; print " " . $active . "\n"; - if ($CONF['vacation_control_admin'] == 'YES') - { - $v_active = ($tMailbox[$i]['v_active'] == 1) ? $PALANG['pOverview_vacation_edit'] : ''; - print " " . $v_active . "\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 " " . $v_active . "\n"; + } } - if ($CONF['alias_control_admin'] == 'YES') + if ($has_alias_control == 1) { print " " . $PALANG['pOverview_alias_edit'] . "\n"; } + print " " . $PALANG['edit'] . "\n"; - print " " . $PALANG['del'] . "\n"; + print " " . $PALANG['del'] . "\n"; print " \n"; } } print "\n"; } +# vim: ts=3 expandtab ft=php ?>