From aca450c326f16debf75537d6f9deb74ebbf4c44c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Loguercio?= Date: Mon, 6 Feb 2017 13:05:33 -0500 Subject: [PATCH] Added user session time validation in session about - Refs BT#12240 --- main/session/about.php | 9 +++++++++ main/template/default/session/about.tpl | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/main/session/about.php b/main/session/about.php index 7dfc230f67..56834f7310 100644 --- a/main/session/about.php +++ b/main/session/about.php @@ -181,6 +181,15 @@ $template->assign( true ) ); +$template->assign( + 'user_session_time', + SessionManager::getDayLeftInSession( + $session->getId(), + api_get_user_id(), + $session->getDuration() + ) + +); $redirectToSession = api_get_configuration_value('allow_redirect_to_session_after_inscription_about'); $redirectToSession = $redirectToSession ? '?s=' . $sessionId : false; diff --git a/main/template/default/session/about.tpl b/main/template/default/session/about.tpl index d2613d126f..f8785110b0 100644 --- a/main/template/default/session/about.tpl +++ b/main/template/default/session/about.tpl @@ -46,10 +46,14 @@ {% endif %} - {% if is_subscribed %} + {% if is_subscribed and user_session_time != -0 %}
{{ 'AlreadyRegisteredToSession'|get_lang }}
+ {% elseif is_subscribed and user_session_time < 1 %} +
+ {{ 'YourSessionTimeIsExpired'|get_lang }} +
{% endif %} {% for course_data in courses %}