summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/Makefile.am13
-rw-r--r--server/src/server.cc10
-rw-r--r--server/src/templateparser.cc2
3 files changed, 14 insertions, 11 deletions
diff --git a/server/src/Makefile.am b/server/src/Makefile.am
index abf9da7..594bfdb 100644
--- a/server/src/Makefile.am
+++ b/server/src/Makefile.am
@@ -23,7 +23,8 @@ pracrod_SOURCES = \
templateparser.cc \
transactionparser.cc \
tcpsocket.cc \
- widgetgenerator.cc
+ widgetgenerator.cc \
+ xml_encode_decode.cc
EXTRA_DIST = \
configuration.h \
@@ -43,7 +44,8 @@ EXTRA_DIST = \
templateparser.h \
transactionparser.h \
tcpsocket.h \
- widgetgenerator.h
+ widgetgenerator.h \
+ xml_encode_decode.h
TESTFILES = \
test_queryhandler \
@@ -52,7 +54,9 @@ TESTFILES = \
test_templateparser \
test_server \
test_database \
- test_macroparser
+ test_macroparser \
+ test_xml_encode_decode
+
TESTLOGS = `for F in ${TESTFILES}; do echo $$F.log; done`
@@ -85,4 +89,7 @@ test_server: server.cc
test_database: database.cc
@../../tools/test database.cc $(PQXX_LIBS) $(PQXX_CXXFLAGS)
+test_xml_encode_decode: xml_encode_decode.cc
+ @../../tools/test xml_encode_decode.cc
+
CLEANFILES = $(TESTFILES) $(TESTLOGS) *~
diff --git a/server/src/server.cc b/server/src/server.cc
index 2ea782d..a94a0f8 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -47,6 +47,7 @@
#include "widgetgenerator.h"
#include "resumeparser.h"
#include "journal_commit.h"
+#include "xml_encode_decode.h"
static std::string error_box(std::string message)
{
@@ -178,22 +179,15 @@ static void connection(TCPSocket &socket)
std::vector< LUAProgram >::iterator lpi = m->luaprograms.begin();
while(lpi != m->luaprograms.end()) {
answer += " <luaprogram name=\"" + lpi->attributes["name"] + "\">\n";
-
- answer += lpi->attributes["lua"];
-
+ answer += xml_encode(lpi->attributes["lua"]);
answer += "\n </luaprogram>\n";
-
lpi++;
}
-
answer += " </luaprograms>\n";
}
-
answer += widgetgenerator(*m, lqm, db);
}
-
answer += " </macro>\n";
-
mi2++;
}
diff --git a/server/src/templateparser.cc b/server/src/templateparser.cc
index 969b4bd..1fecc20 100644
--- a/server/src/templateparser.cc
+++ b/server/src/templateparser.cc
@@ -87,6 +87,7 @@ TemplateParser::~TemplateParser()
void TemplateParser::characterData(std::string &data)
{
+ /*
if(state == MAP) {
assert(current_map); // No map present!
current_map->attributes["lua"].append(data);
@@ -96,6 +97,7 @@ void TemplateParser::characterData(std::string &data)
assert(current_luaprogram); // No lua program present!
current_luaprogram->attributes["lua"].append(data);
}
+ */
}
void TemplateParser::startTag(std::string name, std::map< std::string, std::string> attributes)