Commit 92c6e438 authored by ls1947's avatar ls1947
Browse files

show password set page for service with ecp disabled

parent bf273df3
......@@ -257,8 +257,10 @@ public class RegisterServiceBean implements Serializable {
user.getEppn(), service.getName(), service.getRegisterBean()
});
RegistryEntity registry;
try {
registerUserService.registerUser(user, service, "user-self");
registry = registerUserService.registerUser(user, service, "user-self");
sessionManager.setUnregisteredServiceCreated(null);
} catch (RegisterException e) {
FacesContext.getCurrentInstance().addMessage("need_check",
......@@ -279,6 +281,12 @@ public class RegisterServiceBean implements Serializable {
sessionManager.setOriginalRequestPath(null);
return null;
}
else if (service.getServiceProps().containsKey("ecp") &&
service.getServiceProps().get("ecp").equalsIgnoreCase("disabled")) {
ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
context.redirect("../service/set-password.xhtml?registryId=" + registry.getId());
return null;
}
else if (sessionManager.getOriginalRequestPath() != null) {
ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
context.redirect(sessionManager.getOriginalRequestPath());
......
......@@ -98,6 +98,8 @@ public class SetServicePasswordBean implements Serializable {
if (! authBean.isUserInService(serviceEntity))
throw new IllegalArgumentException("Not authorized for this service");
serviceEntity = serviceService.findByIdWithServiceProps(serviceEntity.getId());
password1 = null;
password2 = null;
......
......@@ -15,6 +15,7 @@ twofa_create_totp_token_desc=<div style\="margin-bottom\: 16px;">Hier k\u00F6nne
twofa_create_new_yubico=Neues Yubikey Token
twofa_mandatory=F\u00FCr diesen Dienst ist es notwendig einen zweiten Faktor einzurichten. Bitte richten Sie sich <a href\="../user/twofa.xhtml?retsid\=$service.id">hier</a> einen zweiten Faktor ein.
twofa_back_to_register=Zur\u00FCck zum Registriervorgang
service_password_help_change_ecp_disabled=F\u00FCr diesen Dienst muss ein Dienstpasswort gesetzt werden. Es ist nicht m\u00F6glich sich mit dem Heimatpasswort anzumelden.
check=Pr\u00FCfen
twofa_elevated_since_recently=Mit 2FA eben
logged_in_since_recently=Eingeloggt seit eben
......
......@@ -15,6 +15,7 @@ twofa_create_totp_token=Create new smartphone token
twofa_create_totp_token_desc=<div style\="margin-bottom\: 16px;">Here you can register your smartphone as a token. For this you need a suitable app according to RFC 6238 (e.g. Google Authenticator, Microsoft Authenticator, FreeOTP or Sophos Authenticator).</div>\n\n<div style\="margin-bottom\: 16px;">\n<a href\='https\://play.google.com/store/apps/details?id\=com.google.android.apps.authenticator2&hl\=en&pcampaignid\=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt\='Get it on Google Play' src\='../resources/img/en_badge_web_generic.png'/></a>\n\n<a href\='https\://apps.apple.com/us/app/google-authenticator/id388497605'><img alt\='Download on Apple Store' src\='../resources/img/link_badge_appstore_large.png'/></a>\n</div>\n\n<div style\="margin-bottom\: 16px;">When you click Start, the token is created and a QR Code is displayed. You must scan this code with the app on your smartphone.</div>
twofa_login_text=To perform the requested action, a second factor must be entered. Please enter any second factor from the list below to continue.
twofa_login=Login with second factor
service_password_help_change_ecp_disabled=A service password must be set for this service. It is not possible to log on with the password of your home organisation.
twofa_code=Current code
twofa_mandatory=For this service it is necessary to set up a second factor. Please set up a second factor <a href\="../user/twofa.xhtml?retsid\=$service.id">here</a>.
twofa_back_to_register=Back to registration
......@@ -399,7 +400,7 @@ service_source=Service source
service_users=Registered users
service_users_depro=Deregistered users
set_new_password=Set new password
set_password=Set password
set_password=Set servicepassword
set_sns_password=Sync&Share Password
shibboleth=Shibboleth
short_name=Short name
......
......@@ -25,10 +25,12 @@
<ui:define name="content">
<h:form id="form">
<div id="panelInline">
<p:panel header="#{messages.set_password}">
<p:panel header="#{messages.set_password} (#{setServicePasswordBean.serviceEntity.name})">
<div style="margin-bottom: 8px;">
<h:outputText value="#{messages.service_password_help_change}" escape="false" />
<h:outputText value="#{messages.service_password_help_change_ecp_disabled}" escape="false"
rendered="#{setServicePasswordBean.serviceEntity.serviceProps.containsKey('ecp') and setServicePasswordBean.serviceEntity.serviceProps.get('ecp').equalsIgnoreCase('disabled')}"/>
<h:outputText value="#{messages.service_password_help_change}" escape="false"
rendered="#{not (setServicePasswordBean.serviceEntity.serviceProps.containsKey('ecp') and setServicePasswordBean.serviceEntity.serviceProps.get('ecp').equalsIgnoreCase('disabled'))}"/>
</div>
<p:messages id="messageBox" for="pw_error" showDetail="true" />
<p:panelGrid id="baseData" columns="2">
......@@ -43,10 +45,8 @@
update="messageBox,baseData" />
</div>
</p:panel>
</div>
<div id="panelInline" style="margin-top: 8px;">
<p:panel header="#{messages.delete_password}">
<p:panel header="#{messages.delete_password} (#{setServicePasswordBean.serviceEntity.name})">
<div style="margin-bottom: 8px;">
<h:outputText value="#{messages.service_password_help_delete}" escape="false" />
</div>
......@@ -55,7 +55,6 @@
update="messageBox,baseData" />
</div>
</p:panel>
</div>
</h:form>
</ui:define>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment