summaryrefslogtreecommitdiff
path: root/server/src/sessionserialiser.cc
diff options
context:
space:
mode:
authordeva <deva>2011-02-07 11:16:27 +0000
committerdeva <deva>2011-02-07 11:16:27 +0000
commitae91057323802dbfe5797cab6fd923149503b213 (patch)
treea0ef887fda6cd3f6edf6e8c1ed9fbc212a24e158 /server/src/sessionserialiser.cc
parent4ea34b413bd21c0e8ec4c3b93840bfe928d3c9c4 (diff)
Made isreadonly propagate to session file and back to live object.
Diffstat (limited to 'server/src/sessionserialiser.cc')
-rw-r--r--server/src/sessionserialiser.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/src/sessionserialiser.cc b/server/src/sessionserialiser.cc
index 0929a30..b20e4c4 100644
--- a/server/src/sessionserialiser.cc
+++ b/server/src/sessionserialiser.cc
@@ -82,6 +82,7 @@ Session *SessionSerialiser::loadStr(const std::string &xml)
XDEC(parser.sessionid),
XDEC(parser.patientid),
XDEC(parser.templ));
+ session->isreadonly = parser.status == "readonly";
Journal *j = session->journal();
j->setUser(XDEC(parser.userid));
j->setPatientID(XDEC(parser.patientid));
@@ -104,6 +105,7 @@ std::string SessionSerialiser::saveStr(Session *session)
xml += "<?xml version='1.0' encoding='UTF-8'?>\n";
xml += "<session timestamp=\""+itostr(time(NULL))+"\" "
+ "status=\"" + XENC(session->isreadonly?"readonly":"") + "\" "
"id=\""+XENC(session->id())+"\" "
"template=\""+XENC(session->templ)+ "\" "
"patientid=\"" + XENC(session->patientid) + "\">\n";