diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2011-11-25 11:59:37 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2011-11-25 11:59:37 +0100 |
commit | dd1fb6e16ff777d3e098076d1015c6c565b51bb7 (patch) | |
tree | db7055cd53a91677b17f2a261b20f3093359f5c8 /server/src/admin_connection.cc | |
parent | c41c204f421c4c1bc453932d2d5552227d794201 (diff) |
Reuse environment (macrolist) instead of creating a new one. Add 'to' and 'from' times to export, both unixtimestamps.
Diffstat (limited to 'server/src/admin_connection.cc')
-rw-r--r-- | server/src/admin_connection.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/admin_connection.cc b/server/src/admin_connection.cc index 0fe5380..6ad7642 100644 --- a/server/src/admin_connection.cc +++ b/server/src/admin_connection.cc @@ -118,8 +118,13 @@ bool AdminConnection::handle(const char *data, size_t size) } if(uri == "/export" && args.find("template") != args.end()) { + time_t from = 0; + if(args.find("from") != args.end()) from = atoi(args["from"].c_str()); + + time_t to = time(NULL); + if(args.find("to") != args.end()) to = atoi(args["to"].c_str()); bool ok; - std::string res = admin_export(env, args["template"], &ok); + std::string res = admin_export(env, args["template"], &ok, from, to); if(!ok) reply = admin_header(uri) + res + admin_rc("footer"); else { reply = res; |