Luis Ángel San Martín f4e55729a2 fixed comiplation in Linux (Ubuntu)
line 117: #define _WIN64 1
must be removed in ./compressed_archive/libp7zip/CPP/myWindows/StdAfx.h

"cannot find -lpulse" compiling under Qt 5.0.2 can be fixed creating a symbolic link from libpulse.so.0 to libpulse.so (further research is needed)
2013-12-08 11:50:10 -08:00

32 lines
943 B
C++

/**
@file
@author Stefan Frings
*/
#include "sessioncontroller.h"
#include "../static.h"
#include <QVariant>
#include <QDateTime>
SessionController::SessionController(){}
void SessionController::service(HttpRequest& request, HttpResponse& response) {
response.setHeader("Content-Type", "text/html; charset=ISO-8859-1");
// Get current session, or create a new one
HttpSession session=Static::sessionStore->getSession(request,response);
if (!session.contains("startTime")) {
response.write("<html><body>New session started. Reload this page now.</body></html>");
session.set("startTime",QDateTime::currentDateTime());
}
else {
QDateTime startTime=session.get("startTime").toDateTime();
response.write("<html><body>Your session started ");
response.write(startTime.toString().toLatin1());
response.write("</body></html>");
}
}