refactor: 💡 Refactored how translations are loaded and used
Refactor how translations are used and loaded. Property `web.langs.customfiles.path` must point to the RersourceBundle, without the `_lang.properties" extensions. An examle location, if we have files `/etc/props_en.properties` and `/etc/props_cs.properties`, the correct value for the configuration option is `web.langs.customfiles.path=/etc/props`. BREAKING CHANGE: Property `web.langs.customfiles.path` must point to the RersourceBundle.pull/1580/head
parent
febc9e9ea4
commit
665b45fb41
|
@ -46,7 +46,14 @@
|
|||
|
||||
<bean id="userInfoInterceptor" class="cz.muni.ics.openid.connect.web.UserInfoInterceptor" />
|
||||
<bean id="serverConfigInterceptor" class="cz.muni.ics.openid.connect.web.ServerConfigInterceptor" />
|
||||
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
|
||||
<property name="paramName" value="lang"/>
|
||||
</bean>
|
||||
<mvc:interceptors>
|
||||
<mvc:interceptor>
|
||||
<mvc:mapping path="/**"/>
|
||||
<ref bean="localeChangeInterceptor"/>
|
||||
</mvc:interceptor>
|
||||
<mvc:interceptor>
|
||||
<!-- Exclude APIs and other machine-facing endpoints from these interceptors -->
|
||||
<mvc:mapping path="/**" />
|
||||
|
|
|
@ -19,11 +19,25 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="messageSource" class="cz.muni.ics.openid.connect.config.JsonMessageSource">
|
||||
<property name="baseDirectory" value="/resources/js/locale/" />
|
||||
<property name="useCodeAsDefaultMessage" value="true" />
|
||||
<bean id="mitreIdMessageSource" class="cz.muni.ics.openid.connect.config.JsonMessageSource">
|
||||
<property name="baseDirectory" value="/resources/js/locale/"/>
|
||||
<property name="useCodeAsDefaultMessage" value="true"/>
|
||||
</bean>
|
||||
|
||||
<bean id="localeResolver" class="cz.muni.ics.openid.connect.config.ConfigurationBeanLocaleResolver" />
|
||||
<bean id="defaultPerunMessageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="basename" value="localization.messages"/>
|
||||
<property name="defaultEncoding" value="UTF-8"/>
|
||||
<property name="parentMessageSource" ref="mitreIdMessageSource"/>
|
||||
<property name="useCodeAsDefaultMessage" value="false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
|
||||
<property name="basename" value="file:${web.langs.customfiles.path}"/>
|
||||
<property name="defaultEncoding" value="UTF-8"/>
|
||||
<property name="parentMessageSource" ref="defaultPerunMessageSource"/>
|
||||
<property name="useCodeAsDefaultMessage" value="false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver"/>
|
||||
|
||||
</beans>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<jsp:useBean id="date" class="java.util.Date" />
|
||||
|
||||
<div id="footer">
|
||||
|
@ -13,25 +14,25 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4 logo">
|
||||
<a href="http://www.cesnet.cz/">
|
||||
<a href="https://www.cesnet.cz/">
|
||||
<img src="${samlResourcesURL}/module.php/cesnet/res/img/logo-cesnet.png" alt="CESNET logo" style="width: 250px;">
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col col-sm-6">
|
||||
<h2>${langProps['footer_other_projects']}</h2>
|
||||
<h2><spring:message code="footer_other_projects"/></h2>
|
||||
<ul>
|
||||
<li><a href="http://www.cesnet.cz/wp-content/uploads/2014/04/CzechLight-family_Posp%C3%ADchal.pdf">CzechLight</a></li>
|
||||
<li><a href="http://www.ultragrid.cz/en">UltraGrid</a></li>
|
||||
<li><a href="http://www.4kgateway.com/">4k Gateway</a></li>
|
||||
<li><a href="http://shongo.cesnet.cz/">Shongo</a></li>
|
||||
<li><a href="http://www.cesnet.cz/sluzby/sledovani-provozu-site/sledovani-infrastruktury/">FTAS a G3</a></li>
|
||||
<li><a href="https://www.cesnet.cz/wp-content/uploads/2014/04/CzechLight-family_Posp%C3%ADchal.pdf">CzechLight</a></li>
|
||||
<li><a href="https://www.ultragrid.cz/en">UltraGrid</a></li>
|
||||
<li><a href="https://www.4kgateway.com/">4k Gateway</a></li>
|
||||
<li><a href="https://shongo.cesnet.cz/">Shongo</a></li>
|
||||
<li><a href="https://www.cesnet.cz/sluzby/sledovani-provozu-site/sledovani-infrastruktury/">FTAS a G3</a></li>
|
||||
<li><a href="https://www.liberouter.org/">Librerouter</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col col-sm-6">
|
||||
<h2>${langProps['footer_helpdesk']}</h2>
|
||||
<h2><spring:message code="footer_helpdesk"/></h2>
|
||||
TEL: +420 224 352 994<br>
|
||||
GSM: +420 602 252 531<br>
|
||||
FAX: +420 224 313 211<br>
|
||||
|
|
|
@ -3,17 +3,15 @@
|
|||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:if test="${empty scopes}">
|
||||
<p>${langProps['no_scopes']}</p>
|
||||
<p><spring:message code="no_scopes"/></p>
|
||||
</c:if>
|
||||
<c:if test="${not empty scopes}">
|
||||
<ul id="perun-table_with_attributes" class="perun-attributes">
|
||||
<c:forEach var="scope" items="${scopes}">
|
||||
<c:set var="scopeValue" value="${langProps[scope.value]}"/>
|
||||
<c:if test="${empty fn:trim(scopeValue)}">
|
||||
<c:set var="scopeValue" value="${scope.value}"/>
|
||||
</c:if>
|
||||
<spring:message code="${scope.value}" var="scope_value_txt"/>
|
||||
<c:set var="singleClaim" value="${fn:length(claims[scope.value]) eq 1}" />
|
||||
<li class="scope-item scope_${fn:escapeXml(scope.value)} ${' '} ${fn:length(claims[scope.value]) eq 0 ? 'hidden' : ''}">
|
||||
<div class="row">
|
||||
|
@ -22,24 +20,21 @@
|
|||
<input class="mt-0 mr-half" type="checkbox" name="scope_${ fn:escapeXml(scope.value) }" checked="checked"
|
||||
id="scope_${fn:escapeXml(scope.value)}" value="${fn:escapeXml(scope.value)}">
|
||||
</div>
|
||||
<h2 class="perun-attrname <c:out value="${classes['perun-attrname.h2.class']}"/>">
|
||||
<h2 class="perun-attrname ${classes['perun-attrname.h2.class']}">
|
||||
<label for="scope_${fn:escapeXml(scope.value)}"
|
||||
class="<c:out value="${classes['perun-attrname.h2.class']}"/>">${scopeValue}</label>
|
||||
class="${classes['perun-attrname.h2.class']}">${scope_value_txt}</label>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="perun-attrcontainer col-sm-7">
|
||||
<span class="perun-attrvalue">
|
||||
<ul class="perun-attrlist <c:out value="${classes['perun-attrcontainer.ul.class']}"/>">
|
||||
<ul class="perun-attrlist ${classes['perun-attrcontainer.ul.class']}/>">
|
||||
<c:forEach var="claim" items="${claims[scope.value]}">
|
||||
<c:choose>
|
||||
<c:when test="${not singleClaim}">
|
||||
<li class="subclaim subclaim_${fn:escapeXml(claim.key)}">
|
||||
<c:set var="claimKey" value="${langProps[claim.key]}"/>
|
||||
<c:if test="${empty fn:trim(claimKey)}">
|
||||
<c:set var="claimKey" value="${claim.key}"/>
|
||||
</c:if>
|
||||
<spring:message code="${claim.key}" var="claimKey"/>
|
||||
<h3 class="visible-xs-block visible-sm-inline-block visible-md-inline-block
|
||||
visible-lg-inline-block <c:out value="${classes['perun-attrlist.h3.class']}"/>">
|
||||
visible-lg-inline-block ${classes['perun-attrlist.h3.class']}">
|
||||
${claimKey}:
|
||||
</h3>
|
||||
<c:if test="${claim.value.getClass().name eq 'java.util.ArrayList'}">
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<%@ tag pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div id="yesform">
|
||||
<button id="yesbutton" name="yes" type="submit" class="btn btn-success btn-lg btn-block btn-primary"
|
||||
onclick="$('#user_oauth_approval').attr('value', true);">
|
||||
<span>${langProps['yes']}</span>
|
||||
<span><spring:message code="yes"/></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -15,7 +16,7 @@
|
|||
<div>
|
||||
<button id="nobutton" name="no" type="submit" class="btn btn-lg btn-default btn-block btn-no"
|
||||
onclick="$('#user_oauth_approval').attr('value', false);">
|
||||
<span>${langProps['no']}</span>
|
||||
<span><spring:message code="no"/></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<jsp:useBean id="date" class="java.util.Date" />
|
||||
|
||||
<div id="footer">
|
||||
|
@ -18,27 +19,32 @@
|
|||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col col-sm-6">
|
||||
<h2>${langProps['footer_other_links']}</h2>
|
||||
<h2><spring:message code="footer_other_links"/></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<a target="_blank" href="${langProps['einfra_link']}">${langProps['einfra_name']}</a>
|
||||
<spring:message code="einfra_link" var="einfra_link"/>
|
||||
<a target="_blank" href="${einfra_link}"><spring:message code="einfra_name"/></a>
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" href="${langProps['cesnet_link']}">${langProps['cesnet_name']}</a>
|
||||
<spring:message code="einfra_link" var="cesnet_link"/>
|
||||
<a target="_blank" href="${cesnet_link}"><spring:message code="cesnet_name"/></a>
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" href="${langProps['cerit_link']}">${langProps['cerit_name']}</a>
|
||||
<spring:message code="cerit_link" var="cerit_link"/>
|
||||
<a target="_blank" href="${cerit_link}"><spring:message code="cerit_name"/></a>
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" href="${langProps['it4i_link']}">${langProps['it4i_name']}</a>
|
||||
<spring:message code="it4i_link" var="it4i_link"/>
|
||||
<a target="_blank" href="${it4i_link}"><spring:message code="it4i_name"/></a>
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" href="${langProps['data_processing_link']}">${langProps['data_processing_name']}</a>
|
||||
<spring:message code="data_processing_link" var="data_processing_link"/>
|
||||
<a target="_blank" href="${data_processing_link}"><spring:message code="data_processing_name"/></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col col-sm-6">
|
||||
<h2>${langProps['footer_helpdesk']}</h2>
|
||||
<h2><spring:message code="footer_helpdesk"/></h2>
|
||||
TEL: +420 234 680 222<br>
|
||||
GSM: +420 602 252 531<br>
|
||||
<a href="mailto:support@e-infra.cz">support@e-infra.cz</a>
|
||||
|
@ -48,9 +54,9 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col col-sm-12 copyright">
|
||||
© 2021 | <a target="_blank" href="${langProps['einfra_link']}">${langProps['einfra_name']}</a>
|
||||
© 2021 | <a target="_blank" href="${einfra_link}"><spring:message code="einfra_name"/></a>
|
||||
<%-- USABLE FROM 2022 --%>
|
||||
<%--© 2021-<fmt:formatDate value="${date}" pattern="yyyy" /> | <a target="_blank" href="${langProps['einfra_link']}">${langProps['einfra_name']}</a>--%>
|
||||
<%--© 2021-<fmt:formatDate value="${date}" pattern="yyyy" /> | <a target="_blank" href="<spring:message code="einfra_link"/>"><spring:message code="einfra_name"/></a>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ tag pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
|
||||
|
||||
</div>
|
||||
|
@ -7,8 +8,8 @@
|
|||
<footer class="footer">
|
||||
<div class="row-main">
|
||||
<p class="footer__copyrights">
|
||||
${langProps['masaryk_university']}<br />
|
||||
${langProps['service']}${" "}<a href="https://it.muni.cz/sluzby/jednotne-prihlaseni-na-muni" target="_blank">${langProps['unified_login']}</a>${" "}${langProps['provided']}${" "}<a href="https://www.ics.muni.cz" target="_blank">${langProps['ics']}</a>
|
||||
<spring:message code="masaryk_university"/><br />
|
||||
<spring:message code="service"/>${" "}<a href="https://it.muni.cz/sluzby/jednotne-prihlaseni-na-muni" target="_blank"><spring:message code="unified_login"/></a>${" "}<spring:message code="provided"/>${" "}<a href="https://www.ics.muni.cz" target="_blank"><spring:message code="ics"/></a>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<%@ tag pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="o" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ attribute name="title" required="true" %>
|
||||
<%@ attribute name="reqURL" required="true" %>
|
||||
<%@ attribute name="baseURL" required="true" %>
|
||||
|
@ -8,13 +9,14 @@
|
|||
<%@ attribute name="cssLinks" required="true" type="java.util.ArrayList<java.lang.String>" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html class="no-js touch no-touch" lang="${langProps['other_lang']}">
|
||||
<spring:message code="other_lang" var="other_lang"/>
|
||||
<html class="no-js touch no-touch" lang="${other_lang}">
|
||||
<head>
|
||||
<meta cahrset="utf-8" />
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="author" content="Masarykova univerzita" />
|
||||
|
||||
<title>${langProps['unified_login']} | ${title}</title>
|
||||
<title><spring:message code="unified_login"/> | ${title}</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://id.muni.cz/simplesaml/module.php/muni/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://id.muni.cz/simplesaml/module.php/muni/css/style-ie.css?1.2">
|
||||
|
@ -36,25 +38,26 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<c:set var="alternateURL" value="${reqURL}&lang=${langProps['other_lang']}"/>
|
||||
<c:set var="alternateURL" value="${reqURL}&lang=${other_lang}"/>
|
||||
<p class="menu-accessibility">
|
||||
<a title="${langProps['go_to_login_title']}" accesskey="2" href="#main">
|
||||
${langProps['go_to_login_text']}
|
||||
<a title="<spring:message code="go_to_login_title"/>" accesskey="2" href="#main">
|
||||
<spring:message code="go_to_login_text"/>
|
||||
</a>
|
||||
</p>
|
||||
<div class="header u-mb-0">
|
||||
<div class="row-main">
|
||||
<div class="header__wrap">
|
||||
<h1 class="header__logo">
|
||||
<img src="${samlResourcesURL}/module.php/${theme}/img/${langProps['img_name']}.png"
|
||||
width="${langProps['img_width']}" height="${langProps['img_height']}" alt="${langProps['muni_logo']}"/>
|
||||
<spring:message code="muni_logo" var="alt"/>
|
||||
<img src="${samlResourcesURL}/module.php/${theme}/img/<spring:message code="img_name"/>.png"
|
||||
width="<spring:message code="img_width"/>" height="<spring:message code="img_height"/>" alt="${alt}"/>
|
||||
</h1>
|
||||
<div class="header__side">
|
||||
<div class="menu-lang" role="navigation">
|
||||
<p class="menu-lang__selected">
|
||||
<a href="${alternateURL}" rel="alternate" hreflang="${langProps['other_lang']}"
|
||||
lang="${langProps['other_lang']}" class="menu-lang__selected__link">
|
||||
${langProps['other_language']}
|
||||
<a href="${alternateURL}" rel="alternate" hreflang="${other_lang}"
|
||||
lang="${other_lang}" class="menu-lang__selected__link">
|
||||
<spring:message code="other_language"/>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -63,9 +66,9 @@
|
|||
<div class="row-main">
|
||||
<ul class="menu-mobile__list">
|
||||
<li class="menu-mobile__item">
|
||||
<a href="${alternateURL}" rel="alternate" hreflang="${langProps['other_lang']}"
|
||||
class="menu-mobile__link menu-mobile__link--lang" lang="${langProps['other_lang']}">
|
||||
${langProps['other_language']}
|
||||
<a href="${alternateURL}" rel="alternate" hreflang="${other_lang}"
|
||||
class="menu-mobile__link menu-mobile__link--lang" lang="${other_lang}">
|
||||
<spring:message code="other_language"/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
<aop:aspectj-autoproxy proxy-target-class="true"/>
|
||||
|
||||
<mvc:interceptors>
|
||||
<mvc:interceptor>
|
||||
<mvc:mapping path="/**"/>
|
||||
<ref bean="localeChangeInterceptor"/>
|
||||
</mvc:interceptor>
|
||||
<mvc:interceptor>
|
||||
<!-- Exclude APIs and other machine-facing endpoints from these interceptors -->
|
||||
<mvc:mapping path="/**" />
|
||||
|
@ -142,7 +146,7 @@
|
|||
<!-- WEB INTERFACE -->
|
||||
<prop key="web.theme">default</prop>
|
||||
<prop key="web.langs">EN</prop> <!-- EN,CS,SK -->
|
||||
<prop key="web.langs.customfiles.path">/etc/perun</prop>
|
||||
<prop key="web.langs.customfiles.path">/etc/perun/locale/messages</prop>
|
||||
<prop key="web.classes.path">/etc/perun/web/classes.properties</prop>
|
||||
<prop key="web.baseURL">https://login.cesnet.cz/proxy</prop>
|
||||
<prop key="email.contact">login@cesnet.cz</prop>
|
||||
|
@ -760,10 +764,6 @@
|
|||
|
||||
<bean id="callPerunFiltersFilter" class="cz.muni.ics.oidc.server.filters.CallPerunFiltersFilter"/>
|
||||
|
||||
<bean id="localization" class="cz.muni.ics.oidc.web.langs.Localization">
|
||||
<constructor-arg name="perunOidcConfig" ref="perunOidcConfig"/>
|
||||
</bean>
|
||||
|
||||
<bean id="htmlClasses" class="cz.muni.ics.oidc.web.WebHtmlClasses">
|
||||
<constructor-arg name="perunOidcConfig" ref="perunOidcConfig"/>
|
||||
</bean>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<%
|
||||
|
||||
|
@ -13,24 +14,27 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['aup_header']}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
<spring:message code="aup_header" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
<h1>${langProps['aup_header']}</h1>
|
||||
<h1><spring:message code="aup_header"/></h1>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<h3>${langProps['must_agree_aup']}</h3>
|
||||
<h3><spring:message code="must_agree_aup"/></h3>
|
||||
<form method="POST" action="">
|
||||
<c:forEach var="aup" items="${newAups}">
|
||||
<div>
|
||||
<p style="font-size: 16px; padding: 0; margin: 0;">${langProps['org_vo']} ${" "}<strong><c:out value="${aup.key}"/></strong></p>
|
||||
<p>${langProps['see_aup']}${" "}${aup.value.version}${" "}<a href="<c:out value="${aup.value.link}"/>">${langProps['here']}</a></p>
|
||||
<p style="font-size: 16px; padding: 0; margin: 0;"><spring:message code="org_vo"/>${" "}<strong>${aup.key}</strong></p>
|
||||
<p><spring:message code="see_aup"/>${" "}${aup.value.version}${" "}
|
||||
<a href="${aup.value.link}"><spring:message code="here"/></a></p>
|
||||
</div>
|
||||
</c:forEach>
|
||||
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="${langProps['agree_aup']}" class="btn btn-lg btn-primary btn-block">
|
||||
<spring:message code="agree_aup" var="submit_value"/>
|
||||
<input type="submit" value="${submit_value}" class="btn btn-lg btn-primary btn-block">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<%
|
||||
|
||||
|
@ -12,22 +13,22 @@ List<String> cssLinks = new ArrayList<>();
|
|||
pageContext.setAttribute("cssLinks", cssLinks);
|
||||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['continue_direct_title']}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
<spring:message code="continue_direct_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
<h1>${langProps['continue_direct_header']}</h1>
|
||||
<h1><spring:message code="continue_direct_header"/></h1>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<div id="head">
|
||||
<h1>${langProps['continue_direct_heading']}</h1>
|
||||
<h1><spring:message code="continue_direct_heading"/></h1>
|
||||
</div>
|
||||
<p>${langProps['continue_direct_text']}</p>
|
||||
<p><spring:message code="continue_direct_text"/></p>
|
||||
<hr/>
|
||||
<br/>
|
||||
<a href="${fn:escapeXml(target)} "class="btn btn-lg btn-primary btn-block">${langProps['continue_direct_btn']}</a>
|
||||
<a href="${fn:escapeXml(target)}" class="btn btn-lg btn-primary btn-block"><spring:message code="continue_direct_btn"/></a>
|
||||
</div>
|
||||
</div><!-- wrap -->
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common"%>
|
||||
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -14,24 +15,25 @@
|
|||
pageContext.setAttribute("cssLinks", cssLinks);
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['is_test_sp_warning_title']}" reqURL="${reqURL}"
|
||||
<spring:message code="is_test_sp_warning_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}"
|
||||
baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<div id="head">
|
||||
<h1>${langProps['is_test_sp_warning_header']}</h1>
|
||||
<h1><spring:message code="is_test_sp_warning_header"/></h1>
|
||||
</div>
|
||||
<p>${langProps['is_test_sp_warning_text']}</p>
|
||||
<p><spring:message code="is_test_sp_warning_text"/></p>
|
||||
|
||||
<form method="GET" action="${action}">
|
||||
<hr/>
|
||||
<br/>
|
||||
<input type="hidden" name="target" value="${fn:escapeXml(target)}">
|
||||
<input type="hidden" name="accepted" value="true">
|
||||
<input type="submit" name="continue" value="${langProps['is_test_sp_warning_continue']}"
|
||||
class="btn btn-lg btn-primary btn-block">
|
||||
<spring:message code="is_test_sp_warning_continue" var="submit_value"/>
|
||||
<input type="submit" name="continue" value="${submit_value}" class="btn btn-lg btn-primary btn-block">
|
||||
</form>
|
||||
</div>
|
||||
</div><!-- ENDWRAP -->
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -14,7 +15,8 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['login_failure_title']}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
<spring:message code="login_failure_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
@ -23,8 +25,10 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
<div id="head">
|
||||
<h1>${fn:escapeXml(langProps['login_failure_header'])}</h1>
|
||||
</div>
|
||||
<div class="msg">${langProps['login_failure_msg']}</div>
|
||||
<div class="msg">${langProps['login_failure_contact_us']}<a href="mailto:${contactMail}">${contactMail}</a>.</div>
|
||||
<div class="msg"><spring:message code="login_failure_msg"/></div>
|
||||
<div class="msg"><spring:message code="login_failure_contact_us"/>${" "}
|
||||
<a href="mailto:${contactMail}">${contactMail}</a>.
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- ENDWRAP -->
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -14,16 +15,17 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['login_success_title']}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
<spring:message code="login_success_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<div id="head">
|
||||
<h1>${fn:escapeXml(langProps['login_success_header'])}</h1>
|
||||
<h1><spring:message code="login_success_header"/></h1>
|
||||
</div>
|
||||
<div class="msg">${langProps['login_success_msg']}</div>
|
||||
<div class="msg"><spring:message code="login_success_msg"/></div>
|
||||
</div>
|
||||
</div><!-- ENDWRAP -->
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -17,19 +18,21 @@
|
|||
|
||||
<t:header title="Logout" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
<h1>${langProps['logout.confirmation.header']}</h1>
|
||||
<h1><spring:message code="logout.confirmation.header"/></h1>
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<form action="${config.issuer}${config.issuer.endsWith('/') ? '' : '/'}endsession" method="POST">
|
||||
<p>${langProps["logout.confirmation.explanation"]}</p>
|
||||
<p><spring:message code="logout.confirmation.explanation"/></p>
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4">
|
||||
<input name="approve" value="${langProps["logout.confirmation.submit"]}"
|
||||
<spring:message code="logout.confirmation.submit" var="submit_value_approve"/>
|
||||
<input name="approve" value="${submit_value_approve}"
|
||||
type="submit" class="btn btn-lg btn-block btn-primary" />
|
||||
</div>
|
||||
<div class="col-md-6 mb-4">
|
||||
<input name="deny" value="${langProps["logout.confirmation.deny"]}"
|
||||
<spring:message code="logout.confirmation.submit" var="submit_value_deny"/>
|
||||
<input name="deny" value="${submit_value_deny}"
|
||||
type="submit" class="btn btn-lg btn-block" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -14,16 +15,17 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['logout_denied_title']}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
<spring:message code="logout_denied_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<div id="head">
|
||||
<h1>${fn:escapeXml(langProps['logout_denied_header'])}</h1>
|
||||
<h1><spring:message code="logout_denied_header"/></h1>
|
||||
</div>
|
||||
<div class="msg">${langProps['logout_denied_msg']}</div>
|
||||
<div class="msg"><spring:message code="logout_denied_msg"/></div>
|
||||
</div>
|
||||
</div><!-- ENDWRAP -->
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -14,16 +15,17 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['logout_success_title']}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
<spring:message code="logout_success_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<div id="head">
|
||||
<h1>${fn:escapeXml(langProps['logout_success_header'])}</h1>
|
||||
<h1><spring:message code="logout_success_header"/></h1>
|
||||
</div>
|
||||
<div class="msg">${langProps['logout_success_msg']}</div>
|
||||
<div class="msg"><spring:message code="logout_success_msg"/></div>
|
||||
</div>
|
||||
</div><!-- ENDWRAP -->
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -17,14 +18,14 @@ cssLinks.add(samlCssUrl + "/module.php/perun/res/css/perun_identity_choose_vo_an
|
|||
pageContext.setAttribute("cssLinks", cssLinks);
|
||||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['registration_title']}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
<spring:message code="registration_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<div id="head">
|
||||
<h1>${fn:escapeXml(langProps['registration_header1'])}
|
||||
<h1><spring:message code="registration_header1"/>
|
||||
<c:choose>
|
||||
<c:when test="${not empty client.clientName and not empty client.clientUri}">
|
||||
 <a href="${fn:escapeXml(client.clientUri)}">${fn:escapeXml(client.clientName)}</a>
|
||||
|
@ -33,14 +34,14 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
 ${fn:escapeXml(client.clientName)}
|
||||
</c:when>
|
||||
</c:choose>
|
||||
 ${langProps['registration_header2']}
|
||||
${" "}<spring:message code="registration_header2"/>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="msg">${langProps['registration_message']}</div>
|
||||
<div class="msg"><spring:message code="registration_message"/></div>
|
||||
|
||||
<div class="list-group">
|
||||
<form action="${action}" method="get">
|
||||
<h4>${langProps['registration_select_vo']}</h4>
|
||||
<h4><spring:message code="registration_select_vo"/></h4>
|
||||
<select id="selectVo" class="form-control" name="selectedVo" onchange="filter()" required>
|
||||
<c:forEach var="voGroupPair" items="${groupsForRegistration}">
|
||||
<option value="${fn:escapeXml(voGroupPair.key.shortName)}">
|
||||
|
@ -49,7 +50,7 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
</c:forEach>
|
||||
</select>
|
||||
|
||||
<h4 class="selectGroup" style="display: none">${langProps['registration_select_group']}</h4>
|
||||
<h4 class="selectGroup" style="display: none"><spring:message code="registration_select_group"/></h4>
|
||||
<select class="selectGroup form-control" name="selectedGroup" class="form-control" style="display: none" required>
|
||||
<c:forEach var="voGroupPair" items="${groupsForRegistration}">
|
||||
<c:forEach var="group" items="${voGroupPair.value}">
|
||||
|
@ -60,7 +61,8 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
</c:forEach>
|
||||
</select>
|
||||
|
||||
<input type="submit" value="${langProps['registration_continue']}" class="btn btn-lg btn-primary btn-block">
|
||||
<spring:message code="registration_continue" var="submit_value"/>
|
||||
<input type="submit" value="${submit_value}" class="btn btn-lg btn-primary btn-block">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -18,22 +19,23 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['go_to_registration_title']}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
<spring:message code="go_to_registration_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<div id="head">
|
||||
<h1>${langProps['go_to_registration_header1']}
|
||||
<h1><spring:message code="go_to_registration_header1"/>
|
||||
<c:choose>
|
||||
<c:when test="${not empty client.clientName and not empty client.clientUri}">
|
||||
 <a href="${fn:escapeXml(client.uri)}">${fn:escapeXml(client.clientName)}</a>
|
||||
${" "}<a href="${fn:escapeXml(client.uri)}">${fn:escapeXml(client.clientName)}</a>
|
||||
</c:when>
|
||||
<c:when test="${not empty client.clientName}">
|
||||
 ${fn:escapeXml(client.clientName)}
|
||||
${" "}${fn:escapeXml(client.clientName)}
|
||||
</c:when>
|
||||
</c:choose>
|
||||
 ${langProps['go_to_registration_header2']}
|
||||
${" "}<spring:message code="go_to_registration_header2"/>
|
||||
</h1>
|
||||
</div>
|
||||
<form method="GET" action="${action}">
|
||||
|
@ -42,7 +44,8 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
<input type="hidden" name="client_id" value="${fn:escapeXml(client_id)}" />
|
||||
<input type="hidden" name="facility_id" value="${fn:escapeXml(facility_id)}" />
|
||||
<input type="hidden" name="user_id" value="${fn:escapeXml(user_id)}" />
|
||||
<input type="submit" name="continueToRegistration" value="${langProps['go_to_registration_continue']}"
|
||||
<spring:message code="go_to_registration_continue" var="submit_value"/>
|
||||
<input type="submit" name="continueToRegistration" value="${submit_value}"
|
||||
class="btn btn-lg btn-primary btn-block">
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -19,20 +20,23 @@
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['consent_title']}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
<spring:message code="consent_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
<h1 class="h3">${langProps['consent_header']} ${" "} ${fn:escapeXml(client.clientName)}</h1>
|
||||
<h1 class="h3"><spring:message code="consent_header"/>${" "}${fn:escapeXml(client.clientName)}</h1>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content">
|
||||
<c:remove scope="session" var="SPRING_SECURITY_LAST_EXCEPTION" />
|
||||
<form name="confirmationForm"
|
||||
action="${pageContext.request.contextPath.endsWith('/') ? pageContext.request.contextPath : pageContext.request.contextPath.concat('/')}authorize" method="post">
|
||||
<form name="confirmationForm" method="post" action="${pageContext.request.contextPath.endsWith('/') ?
|
||||
pageContext.request.contextPath : pageContext.request.contextPath.concat('/')}authorize">
|
||||
<p>
|
||||
<c:if test="${not empty client.policyUri}">
|
||||
${langProps['consent_privacy_policy']}
|
||||
 <a target='_blank' href='${fn:escapeXml(client.policyUri)}'><em>${fn:escapeXml(client.clientName)}</em></a>
|
||||
<spring:message code="consent_privacy_policy"/>${" "}
|
||||
<a target='_blank' href='${fn:escapeXml(client.policyUri)}'>
|
||||
<em>${fn:escapeXml(client.clientName)}</em>
|
||||
</a>
|
||||
</c:if>
|
||||
</p>
|
||||
<t:attributesConsent />
|
||||
|
@ -40,7 +44,7 @@
|
|||
<div class="col-xs-12">
|
||||
<div class="checkbox">
|
||||
<input type="checkbox" name="remember" id="saveconsent" value="until-revoked"/>
|
||||
<label for="saveconsent">${langProps['remember']}</label>
|
||||
<label for="saveconsent"><spring:message code="remember"/></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -21,10 +22,11 @@
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['device_approve_title']}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
<spring:message code="device_approve_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
<h1 class="h3">${langProps['device_approve_header']} ${" "} ${fn:escapeXml(client.clientName)}</h1>
|
||||
<h1 class="h3"><spring:message code="device_approve_header"/> ${" "} ${fn:escapeXml(client.clientName)}</h1>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
|
@ -34,8 +36,7 @@
|
|||
action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/approve" method="post">
|
||||
<p>
|
||||
<c:if test="${not empty client.policyUri}">
|
||||
${langProps['device_approve_privacy']}
|
||||
 <a target='_blank' href='${fn:escapeXml(client.policyUri)}'><em>${fn:escapeXml(client.clientName)}</em></a>
|
||||
<spring:message code="device_approve_privacy"/>${" "}<a target='_blank' href='${fn:escapeXml(client.policyUri)}'><em>${fn:escapeXml(client.clientName)}</em></a>
|
||||
</c:if>
|
||||
</p>
|
||||
<t:attributesConsent/>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -15,29 +16,34 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['device_approved_title']}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
<spring:message code="device_approved_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}" cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content" class="text-center">
|
||||
<h1>
|
||||
<c:if test="${ approved }"><p>✔ ${langProps['device_approved_approved']}</p></c:if>
|
||||
<c:if test="${ not approved }"><p>✗ ${langProps['device_approved_rejected']}</p></c:if>
|
||||
<c:if test="${ approved }"><p>✔ <spring:message code="device_approved_approved"/></p></c:if>
|
||||
<c:if test="${ not approved }"><p>✗ <spring:message code="device_approved_rejected"/></p></c:if>
|
||||
</h1>
|
||||
<p class="mt-2">
|
||||
<c:if test="${ approved }">
|
||||
${langProps['device_approved_text_approved_start']}${" "}
|
||||
<spring:message code="device_approved_text_approved_start"/>${" "}
|
||||
<c:if test="${empty client.clientName}"><em><c:out value="${client.clientId}" /></em></c:if>
|
||||
<c:if test="${not empty client.clientName}"><em><c:out value="${client.clientName}" /></em></c:if>
|
||||
${" "}${langProps['device_approved_text_approved_end']}
|
||||
${" "}<spring:message code="device_approved_text_approved_end"/>
|
||||
</c:if>
|
||||
<c:if test="${not approved}">
|
||||
${langProps['device_approved_text_rejected_start']}${" "}
|
||||
<c:if test="${empty client.clientName}"><em><c:out value="${client.clientId}" /></em></c:if>
|
||||
<c:if test="${not empty client.clientName}"><em><c:out value="${client.clientName}" /></em></c:if>
|
||||
${". "}${langProps['device_approved_text_rejected_end']}
|
||||
<spring:message code="device_approved_text_rejected_start"/>
|
||||
<c:if test="${empty client.clientName}">
|
||||
<em>${" "}<c:out value="${client.clientId}"/></em>
|
||||
</c:if>
|
||||
<c:if test="${not empty client.clientName}">
|
||||
<em>${" "}<c:out value="${client.clientName}"/></em>
|
||||
</c:if>
|
||||
${". "}<spring:message code="device_approved_text_rejected_end"/>
|
||||
</c:if>
|
||||
</p>
|
||||
</p>q
|
||||
</div>
|
||||
|
||||
</div> <%-- wrap --%>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<c:set var="baseURL" value="${baseURL}"/>
|
||||
<c:set var="samlResourcesURL" value="${samlResourcesURL}"/>
|
||||
|
@ -15,41 +16,50 @@
|
|||
|
||||
%>
|
||||
|
||||
<t:header title="${langProps['request_code_title']}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
<spring:message code="request_code_title" var="title"/>
|
||||
<t:header title="${title}" reqURL="${reqURL}" baseURL="${baseURL}"
|
||||
cssLinks="${cssLinks}" theme="${theme}"/>
|
||||
|
||||
</div> <%-- header --%>
|
||||
|
||||
<div id="content" class="text-center">
|
||||
<h1>${langProps['request_code_header']}</h1>
|
||||
<h1><spring:message code="request_code_header"/></h1>
|
||||
<c:choose>
|
||||
<c:when test="${ not empty error }">
|
||||
<p class="alert alert-danger mt-2">
|
||||
<c:choose>
|
||||
<c:when test="${ error == 'noUserCode' }">${langProps['user_code_empty_or_not_found']}</c:when>
|
||||
<c:when test="${ error == 'expiredUserCode' }">${langProps['user_code_expired']}</c:when>
|
||||
<c:when test="${ error == 'userCodeAlreadyApproved' }">${langProps['user_code_already_approved']}</c:when>
|
||||
<c:when test="${ error == 'userCodeMismatch' }">${langProps['user_code_mismatch']}</c:when>
|
||||
<c:otherwise>${langProps['user_code_error']}</c:otherwise>
|
||||
<c:when test="${ error == 'noUserCode' }">
|
||||
<spring:message code="user_code_empty_or_not_found"/>
|
||||
</c:when>
|
||||
<c:when test="${ error == 'expiredUserCode' }">
|
||||
<spring:message code="user_code_expired"/>
|
||||
</c:when>
|
||||
<c:when test="${ error == 'userCodeAlreadyApproved' }">
|
||||
<spring:message code="user_code_already_approved"/>
|
||||
</c:when>
|
||||
<c:when test="${ error == 'userCodeMismatch' }">
|
||||
<spring:message code="user_code_mismatch"/>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<spring:message code="user_code_error"/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</p>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<p class="mt-2">
|
||||
${langProps['user_code_info']}
|
||||
</p>
|
||||
<p class="mt-2"><spring:message code="user_code_info"/></p>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
<form name="confirmationForm" class="mt-2"
|
||||
action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/verify" method="post">
|
||||
<form name="confirmationForm" class="mt-2" method="post"
|
||||
action="${ config.issuer }${ config.issuer.endsWith('/') ? '' : '/' }device/verify">
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div>
|
||||
<div class="input-block-level input-xlarge">
|
||||
<input type="text" name="user_code" placeholder="${langProps['code']}"
|
||||
autocorrect="off" autocapitalize="off" autocomplete="off" spellcheck="false"
|
||||
value="" />
|
||||
<spring:message code="code" var="code_placeholder"/>
|
||||
<input type="text" name="user_code" placeholder="${code_placeholder}"
|
||||
autocapitalize="off" autocomplete="off" spellcheck="false" value="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -57,7 +67,8 @@
|
|||
<div class="row-fluid mt-2">
|
||||
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
|
||||
<input type="hidden" name="acr" value="${acr}">
|
||||
<input name="approve" value="${langProps['user_code_submit']}" type="submit"
|
||||
<spring:message code="user_code_submit" var="submit_value"/>
|
||||
<input name="approve" value="${submit_value}" type="submit"
|
||||
class="btn btn-success btn-block btn-large" />
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common"%>
|
||||
<%@ taglib prefix="spring" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<%
|
||||
|
||||
|
@ -25,19 +26,20 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
<c:if test="${empty contact}">
|
||||
<c:set var="contact" value="${contactMail}"/>
|
||||
</c:if>
|
||||
<h1>${langProps['403_header']}</h1>
|
||||
<p>${langProps['403_text']} ${fn:escapeXml(client.clientName)}
|
||||
<h1><spring:message key="403_header"/></h1>
|
||||
<p><spring:message key="403_text"/>${' '}${fn:escapeXml(client.clientName)}
|
||||
<c:if test="${not empty client.clientUri}">
|
||||
<br/>
|
||||
${langProps['403_informationPage']} 
|
||||
<spring:message key="403_informationPage"/>${' '}
|
||||
<a href="${fn:escapeXml(client.clientUri)}">
|
||||
${fn:escapeXml(client.clientUri)}
|
||||
</a>
|
||||
</c:if>
|
||||
</p>
|
||||
|
||||
<p>${langProps['403_contactSupport']} 
|
||||
<a href="mailto:${contact}?subject=${langProps["403_subject"]} ${fn:escapeXml(client.clientName)}">
|
||||
<spring:message key="403_subject" var="subject"/>
|
||||
<p><spring:message key="403_contactSupport"/>${' '}
|
||||
<a href="mailto:${contact}?subject=${subject} ${fn:escapeXml(client.clientName)}">
|
||||
${fn:escapeXml(contact)}
|
||||
</a>
|
||||
</p>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="t" tagdir="/WEB-INF/tags/common"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<%
|
||||
|
||||
|
@ -19,9 +20,9 @@ pageContext.setAttribute("cssLinks", cssLinks);
|
|||
|
||||
<div id="content">
|
||||
<div class="error_message" style="word-wrap: break-word;">
|
||||
<h1><c:out value="${outHeader}" escapeXml="false"/></h1>
|
||||
<p><c:out value="${outMessage}" escapeXml="false"/></p>
|
||||
<p>${langProps['contact_p']}${" "}<a href="mailto:${contactMail}">${contactMail}</a></p>
|
||||
<h1><spring:message code="${outHeader}"/></h1>
|
||||
<p><sprign:message code="${outMessage}"/></p>
|
||||
<p><spring:message code="contact_p"/>${" "}<a href="mailto:${contactMail}">${contactMail}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- ENDWRAP -->
|
||||
|
|
|
@ -2,7 +2,9 @@ package cz.muni.ics.oidc.server.configurations;
|
|||
|
||||
import cz.muni.ics.openid.connect.config.ConfigurationPropertiesBean;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import javax.annotation.PostConstruct;
|
||||
|
@ -38,9 +40,9 @@ public class PerunOidcConfig {
|
|||
private String perunOIDCVersion;
|
||||
private String proxyExtSourceName;
|
||||
private Set<String> idTokenScopes;
|
||||
private List<String> availableLangs;
|
||||
private boolean fillMissingUserAttrs;
|
||||
private boolean addClientIdToAcrs = false;
|
||||
private final Map<String, String> languageMap = new HashMap<>();
|
||||
|
||||
@Autowired
|
||||
private ServletContext servletContext;
|
||||
|
@ -166,12 +168,26 @@ public class PerunOidcConfig {
|
|||
}
|
||||
}
|
||||
|
||||
public List<String> getAvailableLangs() {
|
||||
return availableLangs;
|
||||
public Set<String> getAvailableLangs() {
|
||||
return languageMap.keySet();
|
||||
}
|
||||
|
||||
public void setAvailableLangs(List<String> availableLangs) {
|
||||
this.availableLangs = availableLangs;
|
||||
languageMap.clear();
|
||||
for (String lang: availableLangs) {
|
||||
switch (lang.toLowerCase()) {
|
||||
case "en": {
|
||||
languageMap.put("en", "English");
|
||||
} break;
|
||||
case "cs": {
|
||||
languageMap.put("cs", "Čeština");
|
||||
} break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, String> getLanguageMap() {
|
||||
return languageMap;
|
||||
}
|
||||
|
||||
public String getLocalizationFilesPath() {
|
||||
|
@ -265,7 +281,7 @@ public class PerunOidcConfig {
|
|||
log.info("Registrar URL: {}", registrarUrl);
|
||||
log.info("accessTokenClaimsModifier: {}", coreProperties.getProperty("accessTokenClaimsModifier"));
|
||||
log.info("Proxy EXT_SOURCE name: {}", proxyExtSourceName);
|
||||
log.info("Available languages: {}", availableLangs);
|
||||
log.info("Available languages: {}", languageMap.keySet());
|
||||
log.info("Localization files path: {}", localizationFilesPath);
|
||||
log.info("Email contact: {}", emailContact);
|
||||
log.info("Perun OIDC version: {}", getPerunOIDCVersion());
|
||||
|
|
|
@ -53,7 +53,6 @@ public class WebHtmlClasses {
|
|||
log.debug("Loaded web html classes file: {}", customFileName);
|
||||
} catch (FileNotFoundException e) {
|
||||
log.warn("File: {} not found", customFileName);
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
log.warn("Exception caught when reading {}", customFileName, e);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
|||
import cz.muni.ics.oidc.server.filters.PerunFilterConstants;
|
||||
import cz.muni.ics.oidc.server.userInfo.PerunUserInfo;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import cz.muni.ics.openid.connect.service.UserInfoService;
|
||||
import java.security.Principal;
|
||||
import java.util.Map;
|
||||
|
@ -51,7 +50,6 @@ public class ApproveDeviceController {
|
|||
private final SystemScopeService scopeService;
|
||||
private final DeviceEndpoint deviceEndpoint;
|
||||
private final PerunOidcConfig perunOidcConfig;
|
||||
private final Localization localization;
|
||||
private final WebHtmlClasses htmlClasses;
|
||||
private final PerunScopeClaimTranslationService scopeClaimTranslationService;
|
||||
private final UserInfoService userInfoService;
|
||||
|
@ -60,7 +58,6 @@ public class ApproveDeviceController {
|
|||
public ApproveDeviceController(SystemScopeService scopeService,
|
||||
DeviceEndpoint deviceEndpoint,
|
||||
PerunOidcConfig perunOidcConfig,
|
||||
Localization localization,
|
||||
WebHtmlClasses htmlClasses,
|
||||
PerunScopeClaimTranslationService scopeClaimTranslationService,
|
||||
UserInfoService userInfoService)
|
||||
|
@ -68,7 +65,6 @@ public class ApproveDeviceController {
|
|||
this.scopeService = scopeService;
|
||||
this.deviceEndpoint = deviceEndpoint;
|
||||
this.perunOidcConfig = perunOidcConfig;
|
||||
this.localization = localization;
|
||||
this.htmlClasses = htmlClasses;
|
||||
this.scopeClaimTranslationService = scopeClaimTranslationService;
|
||||
this.userInfoService = userInfoService;
|
||||
|
@ -105,7 +101,7 @@ public class ApproveDeviceController {
|
|||
{
|
||||
String result = deviceEndpoint.requestUserCode(userCode, model, session);
|
||||
if (result.equals(REQUEST_USER_CODE) && !perunOidcConfig.getTheme().equalsIgnoreCase("default")) {
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
model.put("page", REQUEST_USER_CODE);
|
||||
String shibAuthnContextClass = "";
|
||||
if (StringUtils.hasText(req.getParameter(ACR_VALUES))) {
|
||||
|
@ -139,7 +135,7 @@ public class ApproveDeviceController {
|
|||
if (result.equals(APPROVE_DEVICE) && !perunOidcConfig.getTheme().equalsIgnoreCase("default")) {
|
||||
return themedApproveDevice(model, p, req);
|
||||
} else if (result.equals(REQUEST_USER_CODE) && !perunOidcConfig.getTheme().equalsIgnoreCase("default")) {
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
model.put("page", REQUEST_USER_CODE);
|
||||
return "themedRequestUserCode";
|
||||
}
|
||||
|
@ -168,7 +164,7 @@ public class ApproveDeviceController {
|
|||
p.getName(), client.getClientId());
|
||||
|
||||
ControllerUtils.setScopesAndClaims(scopeService, scopeClaimTranslationService, model, dc.getScope(), user);
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
model.put("page", DEVICE_APPROVED);
|
||||
return "themedDeviceApproved";
|
||||
|
@ -184,7 +180,7 @@ public class ApproveDeviceController {
|
|||
PerunUserInfo user = (PerunUserInfo) userInfoService.getByUsernameAndClientId(
|
||||
p.getName(), client.getClientId());
|
||||
ControllerUtils.setScopesAndClaims(scopeService, scopeClaimTranslationService, model, dc.getScope(), user);
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
model.put("page", APPROVE_DEVICE);
|
||||
return "themedApproveDevice";
|
||||
|
|
|
@ -11,7 +11,6 @@ import cz.muni.ics.oidc.models.mappers.RpcMapper;
|
|||
import cz.muni.ics.oidc.server.adapters.PerunAdapter;
|
||||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
@ -52,14 +51,12 @@ public class AupController {
|
|||
@Autowired
|
||||
private PerunOidcConfig perunOidcConfig;
|
||||
|
||||
@Autowired
|
||||
private Localization localization;
|
||||
|
||||
@Autowired
|
||||
private WebHtmlClasses htmlClasses;
|
||||
|
||||
@GetMapping(value = "/" + URL)
|
||||
public String showAup(HttpServletRequest request, Map<String, Object> model,
|
||||
public String showAup(HttpServletRequest req,
|
||||
Map<String, Object> model,
|
||||
@SessionAttribute(name = NEW_AUPS) String newAupsString) throws IOException
|
||||
{
|
||||
JsonNode newAupsJson = mapper.readTree(newAupsString);
|
||||
|
@ -72,7 +69,7 @@ public class AupController {
|
|||
}
|
||||
|
||||
model.put(NEW_AUPS, newAups);
|
||||
ControllerUtils.setPageOptions(model, request, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
return "aup";
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import cz.muni.ics.oauth2.service.SystemScopeService;
|
|||
import cz.muni.ics.oidc.server.PerunScopeClaimTranslationService;
|
||||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import cz.muni.ics.openid.connect.model.UserInfo;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URISyntaxException;
|
||||
|
@ -23,7 +22,6 @@ import java.util.LinkedHashMap;
|
|||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
@ -51,12 +49,11 @@ public class ControllerUtils {
|
|||
* @param req request object
|
||||
* @param localization localization with texts
|
||||
*/
|
||||
public static void setLanguageForPage(Map<String, Object> model, HttpServletRequest req,
|
||||
Localization localization) {
|
||||
public static void setLanguageForPage(Map<String, Object> model, HttpServletRequest req, PerunOidcConfig config) {
|
||||
String langFromParam = req.getParameter(LANG_KEY);
|
||||
String browserLang = req.getLocale().getLanguage();
|
||||
|
||||
List<String> enabledLangs = localization.getEnabledLanguages();
|
||||
Set<String> enabledLangs = config.getAvailableLangs();
|
||||
String langKey = "en";
|
||||
|
||||
if (langFromParam != null
|
||||
|
@ -78,12 +75,9 @@ public class ControllerUtils {
|
|||
log.warn("Could not remove lang param");
|
||||
}
|
||||
|
||||
Properties langProperties = localization.getLocalizationFiles().get(langKey);
|
||||
|
||||
model.put(LANG_KEY, langKey);
|
||||
model.put(REQ_URL_KEY, reqUrl);
|
||||
model.put(LANGS_MAP_KEY, localization.getEntriesAvailable());
|
||||
model.put(LANG_PROPS_KEY, langProperties);
|
||||
model.put(LANGS_MAP_KEY, config.getLanguageMap());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -131,14 +125,12 @@ public class ControllerUtils {
|
|||
|
||||
* @param model model object
|
||||
* @param req request object
|
||||
* @param localization localization with texts
|
||||
* @param classes additional html classes
|
||||
* @param perunOidcConfig oidc config class
|
||||
*/
|
||||
public static void setPageOptions(Map<String, Object> model, HttpServletRequest req,
|
||||
Localization localization,
|
||||
WebHtmlClasses classes, PerunOidcConfig perunOidcConfig) {
|
||||
setLanguageForPage(model, req, localization);
|
||||
setLanguageForPage(model, req, perunOidcConfig);
|
||||
model.put("classes", classes.getWebHtmlClassesProperties());
|
||||
model.put("theme", perunOidcConfig.getTheme().toLowerCase());
|
||||
model.put("baseURL", perunOidcConfig.getBaseURL());
|
||||
|
|
|
@ -5,7 +5,6 @@ import static cz.muni.ics.oidc.server.filters.PerunFilterConstants.PARAM_TARGET;
|
|||
|
||||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
@ -29,13 +28,11 @@ public class IsTestSpController {
|
|||
private static final String TARGET = "target";
|
||||
private static final String ACTION = "action";
|
||||
|
||||
private final Localization localization;
|
||||
private final WebHtmlClasses htmlClasses;
|
||||
private final PerunOidcConfig perunOidcConfig;
|
||||
|
||||
@Autowired
|
||||
public IsTestSpController(Localization localization, WebHtmlClasses htmlClasses, PerunOidcConfig perunOidcConfig) {
|
||||
this.localization = localization;
|
||||
public IsTestSpController(WebHtmlClasses htmlClasses, PerunOidcConfig perunOidcConfig) {
|
||||
this.htmlClasses = htmlClasses;
|
||||
this.perunOidcConfig = perunOidcConfig;
|
||||
}
|
||||
|
@ -48,7 +45,7 @@ public class IsTestSpController {
|
|||
log.debug("Display warning page for isTestSp");
|
||||
model.put(TARGET, returnUrl);
|
||||
model.put(ACTION, req.getRequestURL().toString());
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
return "isTestSpWarning";
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package cz.muni.ics.oidc.web.controllers;
|
|||
|
||||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -17,26 +16,24 @@ public class LoginController {
|
|||
public static final String MAPPING_SUCCESS = "/login_success";
|
||||
public static final String MAPPING_FAILURE = "/login_failure";
|
||||
|
||||
private final Localization localization;
|
||||
private final WebHtmlClasses htmlClasses;
|
||||
private final PerunOidcConfig perunOidcConfig;
|
||||
|
||||
@Autowired
|
||||
public LoginController(PerunOidcConfig perunOidcConfig, Localization localization, WebHtmlClasses htmlClasses) {
|
||||
public LoginController(PerunOidcConfig perunOidcConfig, WebHtmlClasses htmlClasses) {
|
||||
this.perunOidcConfig = perunOidcConfig;
|
||||
this.localization = localization;
|
||||
this.htmlClasses = htmlClasses;
|
||||
}
|
||||
|
||||
@RequestMapping(value = MAPPING_SUCCESS)
|
||||
public String loginSuccess(HttpServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
return "login_success";
|
||||
}
|
||||
|
||||
@RequestMapping(value = MAPPING_FAILURE)
|
||||
public String loginFailure(HttpServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
return "login_failure";
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package cz.muni.ics.oidc.web.controllers;
|
|||
|
||||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -16,20 +15,18 @@ public class LogoutController {
|
|||
|
||||
public static final String MAPPING_SUCCESS = "/logout_success";
|
||||
|
||||
private final Localization localization;
|
||||
private final WebHtmlClasses htmlClasses;
|
||||
private final PerunOidcConfig perunOidcConfig;
|
||||
|
||||
@Autowired
|
||||
public LogoutController(PerunOidcConfig perunOidcConfig, Localization localization, WebHtmlClasses htmlClasses) {
|
||||
public LogoutController(PerunOidcConfig perunOidcConfig, WebHtmlClasses htmlClasses) {
|
||||
this.perunOidcConfig = perunOidcConfig;
|
||||
this.localization = localization;
|
||||
this.htmlClasses = htmlClasses;
|
||||
}
|
||||
|
||||
@RequestMapping(value = MAPPING_SUCCESS)
|
||||
public String logoutSuccess(HttpServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
return "logout_success";
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import cz.muni.ics.oidc.server.PerunScopeClaimTranslationService;
|
|||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.server.userInfo.PerunUserInfo;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import cz.muni.ics.openid.connect.service.UserInfoService;
|
||||
import java.security.Principal;
|
||||
import java.util.Map;
|
||||
|
@ -37,7 +36,6 @@ public class PerunOAuthConfirmationController{
|
|||
private final PerunOidcConfig perunOidcConfig;
|
||||
private final SystemScopeService scopeService;
|
||||
private final PerunScopeClaimTranslationService scopeClaimTranslationService;
|
||||
private final Localization localization;
|
||||
private final WebHtmlClasses htmlClasses;
|
||||
|
||||
@Autowired
|
||||
|
@ -46,7 +44,6 @@ public class PerunOAuthConfirmationController{
|
|||
PerunOidcConfig perunOidcConfig,
|
||||
SystemScopeService scopeService,
|
||||
PerunScopeClaimTranslationService scopeClaimTranslationService,
|
||||
Localization localization,
|
||||
WebHtmlClasses htmlClasses)
|
||||
{
|
||||
this.oAuthConfirmationController = oAuthConfirmationController;
|
||||
|
@ -54,7 +51,6 @@ public class PerunOAuthConfirmationController{
|
|||
this.perunOidcConfig = perunOidcConfig;
|
||||
this.scopeService = scopeService;
|
||||
this.scopeClaimTranslationService = scopeClaimTranslationService;
|
||||
this.localization = localization;
|
||||
this.htmlClasses = htmlClasses;
|
||||
}
|
||||
|
||||
|
@ -71,7 +67,7 @@ public class PerunOAuthConfirmationController{
|
|||
p.getName(), client.getClientId());
|
||||
ControllerUtils.setScopesAndClaims(scopeService, scopeClaimTranslationService, model, authRequest.getScope(),
|
||||
user);
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
model.put("page", "consent");
|
||||
return "themedApprove";
|
||||
|
|
|
@ -5,13 +5,11 @@ import static cz.muni.ics.oidc.server.filters.PerunFilterConstants.PARAM_HEADER;
|
|||
import static cz.muni.ics.oidc.server.filters.PerunFilterConstants.PARAM_MESSAGE;
|
||||
import static cz.muni.ics.oidc.server.filters.PerunFilterConstants.PARAM_REASON;
|
||||
import static cz.muni.ics.oidc.server.filters.PerunFilterConstants.PARAM_TARGET;
|
||||
import static cz.muni.ics.oidc.web.controllers.ControllerUtils.LANG_PROPS_KEY;
|
||||
|
||||
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
|
||||
import cz.muni.ics.oauth2.service.ClientDetailsEntityService;
|
||||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import cz.muni.ics.openid.connect.view.HttpCodeView;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
@ -74,8 +72,6 @@ public class PerunUnapprovedController {
|
|||
private static final String NOT_LOGGED_IN_HDR = "403_not_logged_in_hdr";
|
||||
private static final String NOT_LOGGED_IN_MSG = "403_not_logged_in_msg";
|
||||
|
||||
private static final String CONTACT_PLACEHOLDER = "%%CONTACT_EMAIL%%";
|
||||
private static final String TARGET_URL_PLACEHOLDER = "%%TARGET%%";
|
||||
private static final String CONTACT_LANG_PROP_KEY = "contact_p";
|
||||
private static final String CONTACT_MAIL = "contactMail";
|
||||
|
||||
|
@ -85,16 +81,14 @@ public class PerunUnapprovedController {
|
|||
@Autowired
|
||||
private PerunOidcConfig perunOidcConfig;
|
||||
|
||||
@Autowired
|
||||
private Localization localization;
|
||||
|
||||
@Autowired
|
||||
private WebHtmlClasses htmlClasses;
|
||||
|
||||
@GetMapping(value = UNAPPROVED_MAPPING)
|
||||
public String showUnapproved(ServletRequest req, Map<String, Object> model,
|
||||
@RequestParam(PARAM_CLIENT_ID) String clientId) {
|
||||
HttpServletRequest request = (HttpServletRequest) req;
|
||||
public String showUnapproved(HttpServletRequest req,
|
||||
Map<String, Object> model,
|
||||
@RequestParam(PARAM_CLIENT_ID) String clientId)
|
||||
{
|
||||
ClientDetailsEntity client;
|
||||
|
||||
try {
|
||||
|
@ -115,171 +109,126 @@ public class PerunUnapprovedController {
|
|||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
|
||||
ControllerUtils.setPageOptions(model, request, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
model.put("client", client);
|
||||
|
||||
return "unapproved";
|
||||
}
|
||||
|
||||
@GetMapping(value = UNAPPROVED_SPECIFIC_MAPPING)
|
||||
public String showUnapprovedSpec(ServletRequest req, Map<String, Object> model,
|
||||
public String showUnapprovedSpec(HttpServletRequest req, Map<String, Object> model,
|
||||
@RequestParam(value = PARAM_HEADER, required = false) String header,
|
||||
@RequestParam(value = PARAM_MESSAGE, required = false) String message) {
|
||||
@RequestParam(value = PARAM_MESSAGE, required = false) String message)
|
||||
{
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
ControllerUtils.setPageOptions(model, (HttpServletRequest) req, localization, htmlClasses, perunOidcConfig);
|
||||
|
||||
String headerText = getText(model, header);
|
||||
String messageText = getText(model, message);
|
||||
String contactPText = getText(model, CONTACT_LANG_PROP_KEY);
|
||||
|
||||
model.put(OUT_HEADER, headerText);
|
||||
model.put(OUT_MESSAGE, messageText);
|
||||
model.put(OUT_CONTACT_P, contactPText);
|
||||
model.put(OUT_HEADER, header);
|
||||
model.put(OUT_MESSAGE, message);
|
||||
model.put(OUT_CONTACT_P, CONTACT_LANG_PROP_KEY);
|
||||
model.put(CONTACT_MAIL, perunOidcConfig.getEmailContact());
|
||||
|
||||
return "unapproved_spec";
|
||||
}
|
||||
|
||||
@GetMapping(value = UNAPPROVED_IS_CESNET_ELIGIBLE_MAPPING)
|
||||
public String showUnapprovedIsCesnetEligible(ServletRequest req, Map<String, Object> model,
|
||||
public String showUnapprovedIsCesnetEligible(HttpServletRequest req, Map<String, Object> model,
|
||||
@RequestParam(value = PARAM_TARGET) String target,
|
||||
@RequestParam(value = PARAM_REASON) String reason) {
|
||||
|
||||
ControllerUtils.setPageOptions(model, (HttpServletRequest) req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
String header;
|
||||
String message;
|
||||
String contactPText = getText(model, CONTACT_LANG_PROP_KEY);
|
||||
|
||||
if (REASON_EXPIRED.equals(reason)) {
|
||||
header = getText(model, ICE_EXPIRED_HDR);
|
||||
message = getText(model, ICE_EXPIRED_MSG);
|
||||
header = ICE_EXPIRED_HDR;
|
||||
message = ICE_EXPIRED_MSG;
|
||||
} else if (REASON_NOT_SET.equals(reason)){
|
||||
header = getText(model, ICE_NOT_SET_HDR);
|
||||
message = getText(model, ICE_NOT_SET_MSG);
|
||||
header = ICE_NOT_SET_HDR;
|
||||
message = ICE_NOT_SET_MSG;
|
||||
} else {
|
||||
model.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
|
||||
return HttpCodeView.VIEWNAME;
|
||||
}
|
||||
|
||||
header = replace(header, TARGET_URL_PLACEHOLDER, target);
|
||||
message = replace(message, TARGET_URL_PLACEHOLDER, target);
|
||||
|
||||
model.put(OUT_HEADER, header);
|
||||
model.put(OUT_MESSAGE, message);
|
||||
model.put(OUT_CONTACT_P, contactPText);
|
||||
model.put(OUT_CONTACT_P, CONTACT_LANG_PROP_KEY);
|
||||
model.put(CONTACT_MAIL, perunOidcConfig.getEmailContact());
|
||||
|
||||
return "unapproved_spec";
|
||||
}
|
||||
|
||||
@GetMapping(value = UNAPPROVED_ENSURE_VO_MAPPING)
|
||||
public String showUnapprovedEnsureVo(ServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, (HttpServletRequest) req, localization, htmlClasses, perunOidcConfig);
|
||||
public String showUnapprovedEnsureVo(HttpServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
String header = getText(model, ENSURE_VO_HDR);
|
||||
String message = getText(model, ENSURE_VO_MSG);
|
||||
String contactPText = getText(model, CONTACT_LANG_PROP_KEY);
|
||||
|
||||
model.put(OUT_HEADER, header);
|
||||
model.put(OUT_MESSAGE, message);
|
||||
model.put(OUT_CONTACT_P, contactPText);
|
||||
model.put(OUT_HEADER, ENSURE_VO_HDR);
|
||||
model.put(OUT_MESSAGE, ENSURE_VO_MSG);
|
||||
model.put(OUT_CONTACT_P, CONTACT_LANG_PROP_KEY);
|
||||
model.put(CONTACT_MAIL, perunOidcConfig.getEmailContact());
|
||||
|
||||
return "unapproved_spec";
|
||||
}
|
||||
|
||||
@GetMapping(value = UNAPPROVED_AUTHORIZATION)
|
||||
public String showUnapprovedAuthorization(ServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, (HttpServletRequest) req, localization, htmlClasses, perunOidcConfig);
|
||||
public String showUnapprovedAuthorization(HttpServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
String header = getText(model, AUTHORIZATION_HDR);
|
||||
String message = getText(model, AUTHORIZATION_MSG);
|
||||
String contactPText = getText(model, CONTACT_LANG_PROP_KEY);
|
||||
|
||||
model.put(OUT_HEADER, header);
|
||||
model.put(OUT_MESSAGE, message);
|
||||
model.put(OUT_CONTACT_P, contactPText);
|
||||
model.put(OUT_HEADER, AUTHORIZATION_HDR);
|
||||
model.put(OUT_MESSAGE, AUTHORIZATION_MSG);
|
||||
model.put(OUT_CONTACT_P, CONTACT_LANG_PROP_KEY);
|
||||
model.put(CONTACT_MAIL, perunOidcConfig.getEmailContact());
|
||||
|
||||
return "unapproved_spec";
|
||||
}
|
||||
|
||||
@GetMapping(value = UNAPPROVED_NOT_IN_TEST_VOS_GROUPS)
|
||||
public String showUnapprovedNotInTestVosGroups(ServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, (HttpServletRequest) req, localization, htmlClasses, perunOidcConfig);
|
||||
public String showUnapprovedNotInTestVosGroups(HttpServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
String header = getText(model, NOT_IN_TEST_VOS_GROUPS_HDR);
|
||||
String message = getText(model, NOT_IN_TEST_VOS_GROUPS_MSG);
|
||||
String contactPText = getText(model, CONTACT_LANG_PROP_KEY);
|
||||
|
||||
model.put(OUT_HEADER, header);
|
||||
model.put(OUT_MESSAGE, message);
|
||||
model.put(OUT_CONTACT_P, contactPText);
|
||||
model.put(OUT_HEADER, NOT_IN_TEST_VOS_GROUPS_HDR);
|
||||
model.put(OUT_MESSAGE, NOT_IN_TEST_VOS_GROUPS_MSG);
|
||||
model.put(OUT_CONTACT_P, CONTACT_LANG_PROP_KEY);
|
||||
model.put(CONTACT_MAIL, perunOidcConfig.getEmailContact());
|
||||
|
||||
return "unapproved_spec";
|
||||
}
|
||||
|
||||
@GetMapping(value = UNAPPROVED_NOT_IN_PROD_VOS_GROUPS)
|
||||
public String showUnapprovedNotInProdVosGroups(ServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, (HttpServletRequest) req, localization, htmlClasses, perunOidcConfig);
|
||||
public String showUnapprovedNotInProdVosGroups(HttpServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
String header = getText(model, NOT_IN_PROD_VOS_GROUPS_HDR);
|
||||
String message = getText(model, NOT_IN_PROD_VOS_GROUPS_MSG);
|
||||
String contactPText = getText(model, CONTACT_LANG_PROP_KEY);
|
||||
|
||||
model.put(OUT_HEADER, header);
|
||||
model.put(OUT_MESSAGE, message);
|
||||
model.put(OUT_CONTACT_P, contactPText);
|
||||
model.put(OUT_HEADER, NOT_IN_PROD_VOS_GROUPS_HDR);
|
||||
model.put(OUT_MESSAGE, NOT_IN_PROD_VOS_GROUPS_MSG);
|
||||
model.put(OUT_CONTACT_P, CONTACT_LANG_PROP_KEY);
|
||||
model.put(CONTACT_MAIL, perunOidcConfig.getEmailContact());
|
||||
|
||||
return "unapproved_spec";
|
||||
}
|
||||
|
||||
@GetMapping(value = UNAPPROVED_NOT_IN_MANDATORY_VOS_GROUPS)
|
||||
public String showUnapprovedNotInMandatoryVosGroups(ServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, (HttpServletRequest) req, localization, htmlClasses, perunOidcConfig);
|
||||
public String showUnapprovedNotInMandatoryVosGroups(HttpServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
String header = getText(model, NOT_IN_MANDATORY_VOS_GROUPS_HDR);
|
||||
String message = getText(model, NOT_IN_MANDATORY_VOS_GROUPS_MSG);
|
||||
String contactPText = getText(model, CONTACT_LANG_PROP_KEY);
|
||||
|
||||
model.put(OUT_HEADER, header);
|
||||
model.put(OUT_MESSAGE, message);
|
||||
model.put(OUT_CONTACT_P, contactPText);
|
||||
model.put(OUT_HEADER, NOT_IN_MANDATORY_VOS_GROUPS_HDR);
|
||||
model.put(OUT_MESSAGE, NOT_IN_MANDATORY_VOS_GROUPS_MSG);
|
||||
model.put(OUT_CONTACT_P, CONTACT_LANG_PROP_KEY);
|
||||
model.put(CONTACT_MAIL, perunOidcConfig.getEmailContact());
|
||||
|
||||
return "unapproved_spec";
|
||||
}
|
||||
|
||||
@GetMapping(value = UNAPPROVED_NOT_LOGGED_IN)
|
||||
public String showUnapprovedNotLoggedIn(ServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, (HttpServletRequest) req, localization, htmlClasses, perunOidcConfig);
|
||||
public String showUnapprovedNotLoggedIn(HttpServletRequest req, Map<String, Object> model) {
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
|
||||
String header = getText(model, NOT_LOGGED_IN_HDR);
|
||||
String message = getText(model, NOT_LOGGED_IN_MSG);
|
||||
String contactPText = getText(model, CONTACT_LANG_PROP_KEY);
|
||||
|
||||
model.put(OUT_HEADER, header);
|
||||
model.put(OUT_MESSAGE, message);
|
||||
model.put(OUT_CONTACT_P, contactPText);
|
||||
model.put(OUT_HEADER, NOT_LOGGED_IN_HDR);
|
||||
model.put(OUT_MESSAGE, NOT_LOGGED_IN_MSG);
|
||||
model.put(OUT_CONTACT_P, CONTACT_LANG_PROP_KEY);
|
||||
model.put(CONTACT_MAIL, perunOidcConfig.getEmailContact());
|
||||
|
||||
return "unapproved_spec";
|
||||
}
|
||||
|
||||
private String getText(Map<String, Object> model, String key) {
|
||||
Properties langProps = (Properties) model.get(LANG_PROPS_KEY);
|
||||
return langProps.getProperty(key);
|
||||
}
|
||||
|
||||
private String replace(String container, String key, String value) {
|
||||
if (container.contains(key)) {
|
||||
return container.replaceAll(key, value);
|
||||
} else {
|
||||
return container;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import cz.muni.ics.oidc.server.adapters.PerunAdapter;
|
|||
import cz.muni.ics.oidc.server.configurations.FacilityAttrsConfig;
|
||||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import cz.muni.ics.openid.connect.view.HttpCodeView;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
@ -53,9 +52,6 @@ public class PerunUnapprovedRegistrationController {
|
|||
@Autowired
|
||||
private PerunOidcConfig perunOidcConfig;
|
||||
|
||||
@Autowired
|
||||
private Localization localization;
|
||||
|
||||
@Autowired
|
||||
private WebHtmlClasses htmlClasses;
|
||||
|
||||
|
@ -116,7 +112,7 @@ public class PerunUnapprovedRegistrationController {
|
|||
}
|
||||
}
|
||||
|
||||
ControllerUtils.setPageOptions(model, request, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, request, htmlClasses, perunOidcConfig);
|
||||
model.put("client", client);
|
||||
model.put("facilityId", facilityId);
|
||||
model.put("action", buildActionUrl(request));
|
||||
|
@ -152,7 +148,7 @@ public class PerunUnapprovedRegistrationController {
|
|||
model.put("user_id", userId);
|
||||
model.put("action", request.getRequestURL().toString()
|
||||
.replace(REGISTRATION_CONTINUE_MAPPING, REGISTRATION_FORM_MAPPING));
|
||||
ControllerUtils.setPageOptions(model, request, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, request, htmlClasses, perunOidcConfig);
|
||||
|
||||
return "registrationFormContinue";
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package cz.muni.ics.oidc.web.controllers;
|
|||
|
||||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -27,18 +26,15 @@ public class RegistrationController {
|
|||
@Autowired
|
||||
private PerunOidcConfig perunOidcConfig;
|
||||
|
||||
@Autowired
|
||||
private Localization localization;
|
||||
|
||||
@Autowired
|
||||
private WebHtmlClasses htmlClasses;
|
||||
|
||||
@GetMapping(value = CONTINUE_DIRECT_MAPPING, params = { PARAM_TARGET })
|
||||
public String showRegistrationForm(Map<String, Object> model, HttpServletRequest req,
|
||||
public String showRegistrationForm(HttpServletRequest req, Map<String, Object> model,
|
||||
@RequestParam(PARAM_TARGET) String target)
|
||||
{
|
||||
model.put(PARAM_TARGET, target);
|
||||
ControllerUtils.setPageOptions(model, req, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, req, htmlClasses, perunOidcConfig);
|
||||
return "continue_direct";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
package cz.muni.ics.oidc.web.langs;
|
||||
|
||||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Static utility class for Language Bar displayed on custom pages.
|
||||
*
|
||||
* It contains mapping with language keys to language displayed names.
|
||||
*
|
||||
* @author Dominik Frantisek Bucik <bucik@ics.muni.cz>
|
||||
*/
|
||||
@Slf4j
|
||||
public class Localization {
|
||||
|
||||
private Map<String, String> localizationEntries;
|
||||
private Map<String, Properties> localizationFiles;
|
||||
private final String localizationFilesPath;
|
||||
private final List<String> enabledLanguages;
|
||||
|
||||
public Localization(PerunOidcConfig perunOidcConfig) {
|
||||
this.enabledLanguages = perunOidcConfig.getAvailableLangs();
|
||||
this.localizationFilesPath = perunOidcConfig.getLocalizationFilesPath();
|
||||
this.initEntriesAndFiles();
|
||||
}
|
||||
|
||||
public Map<String, String> getLocalizationEntries() {
|
||||
return localizationEntries;
|
||||
}
|
||||
|
||||
public Map<String, Properties> getLocalizationFiles() {
|
||||
return localizationFiles;
|
||||
}
|
||||
|
||||
public List<String> getEnabledLanguages() {
|
||||
return enabledLanguages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapping for the languages available
|
||||
* @return Map with key = language code, value = language displayed text
|
||||
*/
|
||||
public Map<String, String> getEntriesAvailable() {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
|
||||
for (String key: enabledLanguages) {
|
||||
String lower = key.toLowerCase();
|
||||
if (localizationEntries.containsKey(lower)) {
|
||||
result.put(lower, localizationEntries.get(lower));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void initEntriesAndFiles() {
|
||||
localizationEntries = new HashMap<>();
|
||||
localizationEntries.put("en", "English");
|
||||
localizationEntries.put("cs", "Čeština");
|
||||
localizationEntries.put("sk", "Slovenčina");
|
||||
|
||||
localizationFiles = new HashMap<>();
|
||||
for (String lang: enabledLanguages) {
|
||||
lang = lang.toLowerCase();
|
||||
if (! localizationEntries.containsKey(lang)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Properties langProps = new Properties();
|
||||
String resourceFileName = "localization/" + lang + ".properties";
|
||||
try (InputStreamReader isr = new InputStreamReader(Objects.requireNonNull(
|
||||
getClass().getClassLoader().getResourceAsStream(resourceFileName)), StandardCharsets.UTF_8)) {
|
||||
langProps.load(isr);
|
||||
log.debug("Loaded localization file: {}", resourceFileName);
|
||||
localizationFiles.put(lang, langProps);
|
||||
} catch (IOException e) {
|
||||
log.warn("Exception caught when reading {}", resourceFileName, e);
|
||||
}
|
||||
|
||||
String customFileName = localizationFilesPath + '/' +lang + ".properties";
|
||||
try (InputStreamReader isr = new InputStreamReader(
|
||||
new FileInputStream(customFileName), StandardCharsets.UTF_8
|
||||
)) {
|
||||
langProps.load(isr);
|
||||
log.debug("Loaded localization file: {}", customFileName);
|
||||
} catch (FileNotFoundException e) {
|
||||
log.warn("File: {} not found", customFileName, e);
|
||||
} catch (IOException e) {
|
||||
log.warn("Exception caught when reading {}", customFileName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -54,6 +54,10 @@ public class JsonMessageSource extends AbstractMessageSource {
|
|||
@Autowired
|
||||
private ConfigurationPropertiesBean config;
|
||||
|
||||
public JsonMessageSource(ConfigurationPropertiesBean config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MessageFormat resolveCode(String code, Locale locale) {
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ import cz.muni.ics.oauth2.service.ClientDetailsEntityService;
|
|||
import cz.muni.ics.oidc.server.configurations.PerunOidcConfig;
|
||||
import cz.muni.ics.oidc.web.WebHtmlClasses;
|
||||
import cz.muni.ics.oidc.web.controllers.ControllerUtils;
|
||||
import cz.muni.ics.oidc.web.langs.Localization;
|
||||
import java.text.ParseException;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
@ -76,19 +75,17 @@ public class EndSessionEndpoint {
|
|||
private final SelfAssertionValidator validator;
|
||||
private final PerunOidcConfig perunOidcConfig;
|
||||
private final ClientDetailsEntityService clientService;
|
||||
private final Localization localization;
|
||||
private final WebHtmlClasses htmlClasses;
|
||||
|
||||
@Autowired
|
||||
public EndSessionEndpoint(SelfAssertionValidator validator,
|
||||
PerunOidcConfig perunOidcConfig,
|
||||
ClientDetailsEntityService clientService,
|
||||
Localization localization,
|
||||
WebHtmlClasses htmlClasses) {
|
||||
WebHtmlClasses htmlClasses)
|
||||
{
|
||||
this.validator = validator;
|
||||
this.perunOidcConfig = perunOidcConfig;
|
||||
this.clientService = clientService;
|
||||
this.localization = localization;
|
||||
this.htmlClasses = htmlClasses;
|
||||
}
|
||||
|
||||
|
@ -139,14 +136,14 @@ public class EndSessionEndpoint {
|
|||
// are we logged in or not?
|
||||
if (auth == null || !request.isUserInRole("ROLE_USER")) {
|
||||
// we're not logged in anyway, process the final redirect bits if needed
|
||||
return processLogout(null, null, request, session);
|
||||
return processLogout(null, null, session);
|
||||
} else {
|
||||
log.info("Logout confirmating for user {} from client {}", auth.getName(), client != null ? client.getClientName() : "unknown");
|
||||
// we are logged in, need to prompt the user before we log out
|
||||
model.put("client", client);
|
||||
model.put("idToken", idTokenClaims);
|
||||
|
||||
ControllerUtils.setPageOptions(model, request, localization, htmlClasses, perunOidcConfig);
|
||||
ControllerUtils.setPageOptions(model, request, htmlClasses, perunOidcConfig);
|
||||
|
||||
// display the log out confirmation page
|
||||
return "logout";
|
||||
|
@ -156,7 +153,6 @@ public class EndSessionEndpoint {
|
|||
@RequestMapping(value = "/" + URL, method = RequestMethod.POST)
|
||||
public String processLogout(@RequestParam(value = "approve", required = false) String approved,
|
||||
@RequestParam(value = "deny", required = false) String deny,
|
||||
HttpServletRequest request,
|
||||
HttpSession session)
|
||||
{
|
||||
String redirectUri = (String) session.getAttribute(REDIRECT_URI_KEY);
|
||||
|
|
Loading…
Reference in New Issue