The UserLoginForm did not redirect after a successful SSO Login
git-svn-id: https://svn.libreccm.org/ccm/trunk@6222 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
7837170b4a
commit
83e586ab37
|
|
@ -127,8 +127,8 @@ public class SecurityConfig extends AbstractConfig {
|
|||
"Register:com.arsdigita.kernel.security.CookieLoginModule:optional",
|
||||
"RegisterSSO:com.arsdigita.kernel.security.SimpleSSOLoginModule:requisite",
|
||||
"RegisterSSO:com.arsdigita.kernel.security.CookieLoginModule:optional",
|
||||
"RegisterSAML:com.arsdigita.kernel.security.SamlLoginModule:requisite",
|
||||
"RegisterSAML:com.arsdigita.kernel.security.CookieLoginModule:optional"
|
||||
// "RegisterSAML:com.arsdigita.kernel.security.SamlLoginModule:requisite",
|
||||
// "RegisterSAML:com.arsdigita.kernel.security.CookieLoginModule:optional"
|
||||
});
|
||||
private final Parameter m_adminEmail = new StringParameter(
|
||||
"waf.admin.contact_email", Parameter.OPTIONAL, null);
|
||||
|
|
|
|||
|
|
@ -96,6 +96,8 @@ public class UserLoginForm
|
|||
private boolean m_autoRegistrationOn;
|
||||
private final SecurityConfig securityConfig = SecurityConfig.getConfig();
|
||||
|
||||
private boolean ssoSuccessful = false;
|
||||
|
||||
/**
|
||||
* Default constructor delegates to a constructor which creates a LoginForm
|
||||
* without a link to a newUserRegistrationForm.
|
||||
|
|
@ -230,6 +232,7 @@ public class UserLoginForm
|
|||
try {
|
||||
Web.getUserContext().loginSSO();
|
||||
s_log.info("loginSSO ok, now processing redirect_url");
|
||||
ssoSuccessful = true;
|
||||
process(event);
|
||||
return;
|
||||
} catch (LoginException le) {
|
||||
|
|
@ -326,7 +329,8 @@ public class UserLoginForm
|
|||
throw new ReturnSignal(req, url);
|
||||
}
|
||||
//Cancel:
|
||||
if (m_saveCancelSection.getCancelButton().isSelected(state)) {
|
||||
if (m_saveCancelSection.getCancelButton().isSelected(state)
|
||||
|| ssoSuccessful) {
|
||||
|
||||
//redirect the user to the place they came from.
|
||||
try {
|
||||
|
|
@ -339,6 +343,7 @@ public class UserLoginForm
|
|||
path),
|
||||
true);
|
||||
}
|
||||
ssoSuccessful = false;
|
||||
throw new ReturnSignal(req, refererURI);
|
||||
} catch (URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -126,7 +126,8 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
|||
final InputStream manifestInputStream = servletContext
|
||||
.getResourceAsStream(themeManifestPath);
|
||||
if (manifestInputStream == null) {
|
||||
LOGGER.error(String.format("No theme manifest found at path \"%s\". "
|
||||
LOGGER.error(String.format(
|
||||
"No theme manifest found at path \"%s\". "
|
||||
+ "Falling back to \"%s\". Used sitename \"%s\".",
|
||||
themeManifestPath,
|
||||
PageTransformer.class.getName(),
|
||||
|
|
@ -239,6 +240,10 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
|||
new FormatDateTime(manifest.getDateFormats(),
|
||||
new Locale(selectedLocale.getLanguage())));
|
||||
|
||||
configuration.setSharedVariable(
|
||||
"sortAttachmentList", new SortAttachmentList()
|
||||
);
|
||||
|
||||
data.put("serverName", request.getServerName());
|
||||
data.put("serverPort", request.getServerPort());
|
||||
data.put("userAgent", request.getHeader("user-Agent"));
|
||||
|
|
@ -253,7 +258,7 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
|||
response.setCharacterEncoding(StandardCharsets.UTF_8.toString());
|
||||
response.setContentType("text/html");
|
||||
|
||||
try (PrintWriter writer = response.getWriter()) {
|
||||
try ( PrintWriter writer = response.getWriter()) {
|
||||
|
||||
template.process(data, writer);
|
||||
|
||||
|
|
@ -443,7 +448,6 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
|||
.get(0))
|
||||
.getAsString();
|
||||
|
||||
|
||||
ResourceBundle.clearCache();
|
||||
final ResourceBundle bundle = ResourceBundle.getBundle(bundleName,
|
||||
locale,
|
||||
|
|
@ -604,6 +608,28 @@ public class FreeMarkerPresentationManager implements PresentationManager {
|
|||
|
||||
}
|
||||
|
||||
private class SortAttachmentList implements TemplateMethodModelEx {
|
||||
|
||||
public SortAttachmentList() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object exec(final List list) throws TemplateModelException {
|
||||
|
||||
if (list.isEmpty() || list.size() != 2) {
|
||||
throw new IllegalArgumentException(
|
||||
"SortAttachmentList requires the following parameters: "
|
||||
+ "list: list to sort, "
|
||||
+ "attribute: Attribute to use for sorting"
|
||||
);
|
||||
}
|
||||
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String findContentItemTemplate(
|
||||
final Templates templates,
|
||||
final String objectType,
|
||||
|
|
|
|||
Loading…
Reference in New Issue