use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class ShibbolethDispatcher method handleException.
/**
* It first tries to catch the frequent SAMLExceptions and to ask the user to login again.
* It basically lets the user to login again without getting a RedScreen if one of the most
* frequent shibboleth error occurs. Else a RedScreen is the last option.
* @param e
* @param req
* @param resp
*/
private void handleException(Throwable e, HttpServletRequest req, HttpServletResponse resp, Translator transl) {
UserRequest ureq = new UserRequestImpl(ShibbolethDispatcher.PATH_SHIBBOLETH, req, resp);
if (e instanceof ShibbolethException) {
String userMsg = "";
int errorCode = ((ShibbolethException) e).getErrorCode();
switch(errorCode) {
case ShibbolethException.GENERAL_SAML_ERROR:
userMsg = transl.translate("error.shibboleth.generic");
break;
case ShibbolethException.UNIQUE_ID_NOT_FOUND:
userMsg = transl.translate("error.unqueid.notfound");
break;
default:
userMsg = transl.translate("error.shibboleth.generic");
break;
}
showMessage(ureq, "org.opensaml.SAMLException: " + e.getMessage(), e, userMsg, ((ShibbolethException) e).getContactPersonEmail());
return;
} else {
try {
ChiefController msgcc = MsgFactory.createMessageChiefController(ureq, new OLATRuntimeException("Error processing Shibboleth request: " + e.getMessage(), e), false);
msgcc.getWindow().dispatchRequest(ureq, true);
} catch (Throwable t) {
log.error("We're fucked up....", t);
}
}
}
use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class ShibbolethDispatcher method authorization.
private boolean authorization(HttpServletRequest req, HttpServletResponse resp, ShibbolethAttributes shibbolethAttibutes) {
boolean authorized = false;
if (shibbolethModule.isAccessControlByAttributes()) {
if (StringHelper.containsNonWhitespace(shibbolethModule.getAttribute1()) && StringHelper.containsNonWhitespace(shibbolethModule.getAttribute1Values())) {
authorized |= authorization(shibbolethModule.getAttribute1(), shibbolethModule.getAttribute1Values(), shibbolethAttibutes);
}
if (StringHelper.containsNonWhitespace(shibbolethModule.getAttribute2()) && StringHelper.containsNonWhitespace(shibbolethModule.getAttribute2Values())) {
authorized |= authorization(shibbolethModule.getAttribute2(), shibbolethModule.getAttribute2Values(), shibbolethAttibutes);
}
} else {
authorized = true;
}
if (!authorized) {
UserRequest ureq = new UserRequestImpl(ShibbolethDispatcher.PATH_SHIBBOLETH, req, resp);
String userMsg = translator.translate("error.shibboleth.not.authorized");
ChiefController msgcc = MessageWindowController.createMessageChiefController(ureq, null, userMsg, null);
msgcc.getWindow().dispatchRequest(ureq, true);
}
return authorized;
}
use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class ShibbolethDispatcher method showMessage.
/**
* @param ureq
* @param exceptionLogMessage will be recorded into the log file
* @param cause
* @param userMessage gets shown to the user
* @param supportEmail if any available, else null
*/
private void showMessage(UserRequest ureq, String exceptionLogMessage, Throwable cause, String userMessage, String supportEmail) {
ChiefController msgcc = MessageWindowController.createMessageChiefController(ureq, new OLATRuntimeException(exceptionLogMessage, cause), userMessage, supportEmail);
msgcc.getWindow().dispatchRequest(ureq, true);
}
use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class QTI21AssessmentMainLayoutController method setAsFullscreen.
public void setAsFullscreen(UserRequest ureq) {
ChiefController cc = getWindowControl().getWindowBackOffice().getChiefController();
if (cc != null) {
thebaseChief = cc;
thebaseChief.getScreenMode().setMode(Mode.full);
} else {
Windows.getWindows(ureq).setFullScreen(Boolean.TRUE);
}
fullScreen = true;
}
use of org.olat.core.gui.control.ChiefController in project OpenOLAT by OpenOLAT.
the class LTIRunController method openBasicLTIContent.
private void openBasicLTIContent(UserRequest ureq) {
// container is "run", "runFullscreen" or "runPopup" depending in configuration
doBasicLTI(ureq, run);
if (display == LTIDisplayOptions.fullscreen) {
ChiefController cc = getWindowControl().getWindowBackOffice().getChiefController();
if (cc != null) {
thebaseChief = cc;
thebaseChief.getScreenMode().setMode(Mode.full);
}
fullScreen = true;
getWindowControl().pushToMainArea(run);
} else {
mainPanel.setContent(run);
}
}
Aggregations