*/
public void event(UserRequest ureq, Controller source, Event event) {
if (source == dialogController) {
if (DialogBoxUIFactory.isYesEvent(event)) {
UserSession usess = (UserSession) usessTableModel.getObject(selRow);
SessionInfo sessInfo = usess.getSessionInfo();
if (usess.isAuthenticated()) {
HttpSession session = sessInfo.getSession();
if (session!=null) {
try{
session.invalidate();
} catch(IllegalStateException ise) {
// thrown when session already invalidated. fine. ignore.
}
}
showInfo("sess.kill.done", sessInfo.getLogin() );
}
reset();
}
}
else if (source == tableCtr) {
if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
TableEvent te = (TableEvent) event;
selRow = te.getRowId();
// session info (we only have authenticated sessions here
UserSession usess = (UserSession) usessTableModel.getObject(selRow);
//if (!usess.isAuthenticated()) throw new AssertException("usersession was not authenticated!?");
myContent.setPage(VELOCITY_ROOT + "/sessionDetails.html");
myContent.contextPut("us", usess);
SessionInfo sessInfo = usess.getSessionInfo();
myContent.contextPut("si", sessInfo);
boolean isAuth = usess.isAuthenticated();
myContent.contextPut("isauth", isAuth? "yes" : "-- NOT AUTHENTICATED!");
long creatTime = -1;
long lastAccessTime = -1;
boolean success = false;
if (isAuth) {
try {
HttpSession se = sessInfo.getSession();
creatTime = se.getCreationTime();
lastAccessTime = se.getLastAccessedTime();
success = true;
} catch (Exception ise) {
// nothing to do
}
}
if (success) {
myContent.contextPut("created", f.formatDateAndTime(new Date(creatTime)));
myContent.contextPut("lastaccess", f.formatDateAndTime(new Date(lastAccessTime)));
} else {
myContent.contextPut("created", " -- this session has been invalidated --");
myContent.contextPut("lastaccess", " -- this session has been invalidated --");
}
if (success) {
// lock information
String username = sessInfo.getLogin();
ArrayList lockList = new ArrayList();
List<LockEntry> locks = CoordinatorManager.getCoordinator().getLocker().adminOnlyGetLockEntries();
Formatter f = Formatter.getInstance(ureq.getLocale());
for (LockEntry entry : locks) {
if (entry.getOwner().getName().equals(username)) {