From 7643c9f57b5149b9b84f9bdad5372a3e7d703521 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 11 Jul 2016 09:33:46 +0200 Subject: [PATCH] display login-message depending on $_GET[cd] and whats in database/header for "login_message" --- api/src/Framework/Login.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/api/src/Framework/Login.php b/api/src/Framework/Login.php index 8549acd4a1..b145844af5 100644 --- a/api/src/Framework/Login.php +++ b/api/src/Framework/Login.php @@ -67,8 +67,19 @@ class Login $tmpl->set_block('login_form','change_password'); $tmpl->set_var('change_password', ''); $tmpl->set_var('lang_password',lang('password')); - $tmpl->set_var('cd', self::check_logoutcode($_GET['cd'])); - $tmpl->set_var('cd_class', isset($_GET['cd']) && $_GET['cd'] != 1 ? 'error' : ''); + + // display login-message depending on $_GET[cd] and what's in database/header for "login_message" + $cd_msg = self::check_logoutcode($_GET['cd']); + if (!empty($GLOBALS['egw_info']['server']['login_message'])) + { + $cd_msg = $GLOBALS['egw_info']['server']['login_message']. + // only add non-empty and not "successful loged out" message below + (!empty($cd_msg) && $cd_msg != ' ' && $_GET['cd'] != 1 ? "\n\n".$cd_msg : ''); + } + $tmpl->set_var('cd', $cd_msg); + $tmpl->set_var('cd_class', isset($_GET['cd']) && $_GET['cd'] != 1 || + !empty($GLOBALS['egw_info']['server']['login_message']) ? 'error' : ''); + $last_loginid = $_COOKIE['last_loginid']; $last_domain = $_COOKIE['last_domain']; $tmpl->set_var('passwd', '');