projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Store the Sone ID instead of the Sone itself in the session.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
SoneTemplatePage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java
b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java
index
d6f1eb7
..
4078585
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java
@@
-110,7
+110,13
@@
public class SoneTemplatePage extends TemplatePage {
if (session == null) {
return null;
}
if (session == null) {
return null;
}
- return (Sone) session.getAttribute("Sone.CurrentSone");
+ String soneId = (String) session.getAttribute("Sone.CurrentSone");
+ for (Sone sone : webInterface.core().localSones()) {
+ if (sone.getId().equals(soneId)) {
+ return sone;
+ }
+ }
+ return null;
}
/**
}
/**
@@
-123,7
+129,7
@@
public class SoneTemplatePage extends TemplatePage {
*/
protected void setCurrentSone(ToadletContext toadletContext, Sone sone) {
Session session = getCurrentSession(toadletContext);
*/
protected void setCurrentSone(ToadletContext toadletContext, Sone sone) {
Session session = getCurrentSession(toadletContext);
- session.setAttribute("Sone.CurrentSone", sone);
+ session.setAttribute("Sone.CurrentSone", sone
.getId()
);
}
//
}
//