From 3dcd56c77ae06368d34eeb1676fa810ab737096b Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 29 Jul 2011 20:34:36 +0000 Subject: [PATCH] Replaced motd*.txt with $CONF[motd_*] options config.inc.php: - new config options $CONF['motd_user'], $CONF['motd_admin'] and $CONF['motd_superadmin'] templates/index.tpl: - added $CONF[motd_*] handling css/default.css: - new style #motd templates/users_menu.tpl, templates/menu.tpl: - removed inclusion of motd-users.txt / $motd_file smarty.inc.php: - removed handling for motd*.txt files templates/motd-users.txt, templates/motd.txt: - deleted git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1142 a1433add-5e2c-0410-b055-b7f2511e0802 --- config.inc.php | 7 +++++++ css/default.css | 5 +++++ smarty.inc.php | 10 ---------- templates/index.tpl | 10 ++++++++++ templates/menu.tpl | 5 ----- templates/motd-users.txt | 7 ------- templates/motd.txt | 7 ------- templates/users_menu.tpl | 9 --------- 8 files changed, 22 insertions(+), 38 deletions(-) delete mode 100644 templates/motd-users.txt delete mode 100644 templates/motd.txt diff --git a/config.inc.php b/config.inc.php index 8863f1b7..5d54f6a3 100644 --- a/config.inc.php +++ b/config.inc.php @@ -286,6 +286,13 @@ $CONF['show_footer_text'] = 'YES'; $CONF['footer_text'] = 'Return to change-this-to-your.domain.tld'; $CONF['footer_link'] = 'http://change-this-to-your.domain.tld'; +// MOTD ("Motto of the day") +// You can display a MOTD below the menu on all pages. +// This can be configured seperately for users, domain admins and superadmins +$CONF['motd_user'] = ''; +$CONF['motd_admin'] = ''; +$CONF['motd_superadmin'] = ''; + // Welcome Message // This message is send to every newly created mailbox. // Change the text between EOM. diff --git a/css/default.css b/css/default.css index d462d414..0dfa403b 100644 --- a/css/default.css +++ b/css/default.css @@ -81,6 +81,11 @@ ul.flash-error { color: #d01313; } +#motd { + color: maroon; + padding-top:2em; +} + .standout { color: maroon; padding: 3px 3px 3px 3px; diff --git a/smarty.inc.php b/smarty.inc.php index 6fe3313c..f1ddfdfb 100644 --- a/smarty.inc.php +++ b/smarty.inc.php @@ -66,16 +66,6 @@ $smarty->assign ('version', $version); $smarty->assign ('boolconf_alias_domain', boolconf('alias_domain')); $smarty->assign ('authentication_has_role', array ('global_admin' => authentication_has_role ('global-admin'), 'admin' => authentication_has_role ('admin'), 'user' => authentication_has_role ('user'))); -if (authentication_has_role('global-admin')) { - $motd_file = "motd-admin.txt"; -} else { - $motd_file = "motd.txt"; -} -$smarty->assign('motd_file', ''); -if (file_exists ($incpath.'/templates/'.$motd_file)) { - $smarty->assign ('motd_file', $motd_file); -} - function select_options($aValues, $aSelected) { $ret_val = ''; foreach ($aValues as $val) { diff --git a/templates/index.tpl b/templates/index.tpl index bc6a73fb..d3ba7dca 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -9,6 +9,16 @@ {include file='menu.tpl'} {/if} {/if} +
+ +{if $authentication_has_role.user && $CONF.motd_user} +
{$CONF.motd_user}
+{elseif $authentication_has_role.global_admin && $CONF.motd_superadmin} +
{$CONF.motd_superadmin}
+{elseif $authentication_has_role.admin && $CONF.motd_admin} +
{$CONF.motd_admin}
+{/if} + {include file='flash_error.tpl'} {if $smarty_template} {include file="$smarty_template.tpl"} diff --git a/templates/menu.tpl b/templates/menu.tpl index 419755a3..c8ee7f23 100644 --- a/templates/menu.tpl +++ b/templates/menu.tpl @@ -81,11 +81,6 @@
  • {$PALANG.pMenu_logout}
  • -{if !empty($motd_file)} -
    - {include file=$motd_file} -
    -{/if} {literal}