use of org.olat.core.gui.media.RedirectMediaResource in project openolat by klemens.
the class PaypalMapper method handle.
@Override
public MediaResource handle(String relPath, HttpServletRequest request) {
List<ContextEntry> entries = null;
UserSession usess = CoreSpringFactory.getImpl(UserSessionManager.class).getUserSession(request);
try {
entries = BusinessControlFactory.getInstance().createCEListFromString(businessPath);
if (relPath.indexOf(';') > 0) {
relPath = relPath.substring(0, relPath.indexOf(';'));
}
if (relPath.indexOf('?') > 0) {
relPath = relPath.substring(0, relPath.indexOf('?'));
}
String uuid = relPath.substring(1, relPath.length() - 5);
paypalManager.updateTransaction(uuid);
usess.putEntryInNonClearedStore("paypal-uuid", uuid);
} catch (Exception e) {
log.error("", e);
usess.putEntryInNonClearedStore("paypal-mapper-error", Boolean.TRUE);
}
String resourceUrl = BusinessControlFactory.getInstance().getBusinessPathAsURIFromCEList(entries);
MediaResource redirect = new RedirectMediaResource(Settings.getServerContextPathURI() + "/auth/" + resourceUrl);
return redirect;
}
use of org.olat.core.gui.media.RedirectMediaResource in project openolat by klemens.
the class WimbaConfigController method openWimbaUrl.
private void openWimbaUrl(UserRequest ureq, String target) {
boolean success = wimba.createModerator(ureq.getIdentity(), roomId);
if (success) {
wimba.login(ureq.getIdentity(), null);
String url = wimba.createServiceUrl(target, roomId);
RedirectMediaResource rmr = new RedirectMediaResource(url);
ureq.getDispatchResult().setResultingMediaResource(rmr);
} else {
// could not create moderator or update the rights
getWindowControl().setError(translate("error.update.rights"));
return;
}
}
use of org.olat.core.gui.media.RedirectMediaResource in project openolat by klemens.
the class RecordingsTableModel method joinMeeting.
private void joinMeeting(UserRequest ureq, boolean guest) {
URL url;
if (guest) {
url = wimba.createClassroomGuestUrl(roomId, ureq.getIdentity(), config);
} else {
boolean success = wimba.login(ureq.getIdentity(), null);
// no success, maybe the user account doesn't exist, create it and try the login again
if (!success)
wimba.createUser(ureq.getIdentity(), roomId);
wimba.login(ureq.getIdentity(), null);
url = wimba.createClassroomUrl(roomId, ureq.getIdentity(), config);
}
RedirectMediaResource rmr = new RedirectMediaResource(url.toString());
ureq.getDispatchResult().setResultingMediaResource(rmr);
}
use of org.olat.core.gui.media.RedirectMediaResource in project openolat by klemens.
the class RecordingsTableModel method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == recTable) {
if (event instanceof TableEvent) {
TableEvent tEvent = (TableEvent) event;
String action = tEvent.getActionId();
int row = tEvent.getRowId();
String key = (String) recTable.getTableDataModel().getValueAt(row, 0);
if (action.equals(COMMAND_OPEN_RECORDING)) {
wimba.login(ureq.getIdentity(), null);
URL url = wimba.createClassroomRecordingUrl(key, ureq.getIdentity());
RedirectMediaResource rmr = new RedirectMediaResource(url.toString());
ureq.getDispatchResult().setResultingMediaResource(rmr);
return;
} else if (action.equals(COMMAND_TOGGLESTATUS_RECORDING)) {
Object[] entry = (Object[]) recTable.getTableDataModel().getObject(row);
Boolean preview = (Boolean) entry[2];
if (wimba.setPreviewMode(key, !preview, true)) {
String text = preview ? "table.recordings.unclose.success" : "table.recordings.close.success";
getWindowControl().setInfo(translate(text));
recTableModel.toggleStatus(row);
recTable.modelChanged();
runVC.setDirty(true);
} else {
String text = preview ? "table.recordings.unclose.error" : "table.recordings.close.error";
getWindowControl().setError(translate(text));
}
} else if (action.equals(COMMAND_DELETE_RECORDING)) {
if (wimba.removeClassroomRecording(key)) {
getWindowControl().setInfo(translate("table.recordings.delete.success"));
recTableModel.removeRecording(row);
recTable.modelChanged();
runVC.setDirty(true);
} else {
getWindowControl().setError(translate("table.recordings.delete.error"));
}
}
}
}
}
use of org.olat.core.gui.media.RedirectMediaResource in project openolat by klemens.
the class AuthHelper method doLogin.
/**
* Used by DMZDispatcher to do regular logins and by ShibbolethDispatcher
* which is somewhat special because logins are handled asynchronuous ->
* therefore a dedicated dispatcher is needed which also has to have access to
* the doLogin() method.
*
* @param identity
* @param authProvider
* @param ureq
* @return True if success, false otherwise.
*/
public static int doLogin(Identity identity, String authProvider, UserRequest ureq) {
int initializeStatus = initializeLogin(identity, authProvider, ureq, false);
if (initializeStatus != LOGIN_OK) {
// login not successfull
return initializeStatus;
}
// do logging
ThreadLocalUserActivityLogger.log(OlatLoggingAction.OLAT_LOGIN, AuthHelper.class, LoggingResourceable.wrap(identity));
// brasato:: fix it
// successfull login, reregister window
ChiefController occ;
if (ureq.getUserSession().getRoles().isGuestOnly()) {
occ = createGuestHome(ureq);
} else {
occ = createAuthHome(ureq);
}
Window currentWindow = occ.getWindow();
currentWindow.setUriPrefix(WebappHelper.getServletContextPath() + DispatcherModule.PATH_AUTHENTICATED);
Windows.getWindows(ureq).registerWindow(currentWindow);
RedirectMediaResource redirect;
String redirectTo = (String) ureq.getUserSession().getEntry("redirect-bc");
if (StringHelper.containsNonWhitespace(redirectTo)) {
String url = WebappHelper.getServletContextPath() + DispatcherModule.PATH_AUTHENTICATED + redirectTo;
redirect = new RedirectMediaResource(url);
} else {
// redirect to AuthenticatedDispatcher
// IMPORTANT: windowID has changed due to re-registering current window -> do not use ureq.getWindowID() to build new URLBuilder.
URLBuilder ubu = new URLBuilder(WebappHelper.getServletContextPath() + DispatcherModule.PATH_AUTHENTICATED, currentWindow.getInstanceId(), "1");
StringOutput sout = new StringOutput(30);
ubu.buildURI(sout, null, null);
redirect = new RedirectMediaResource(sout.toString());
}
ureq.getDispatchResult().setResultingMediaResource(redirect);
return LOGIN_OK;
}
Aggregations