summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/clientapp/clientapp.cpp2
-rw-r--r--src/client/net/serverconnection.cpp16
2 files changed, 16 insertions, 2 deletions
diff --git a/src/client/clientapp/clientapp.cpp b/src/client/clientapp/clientapp.cpp
index 3d2dba1..ce0b5f3 100644
--- a/src/client/clientapp/clientapp.cpp
+++ b/src/client/clientapp/clientapp.cpp
@@ -1,6 +1,6 @@
#include "clientapp.h"
-ClientApp::ClientApp(int& argc, char** argv) : QApplication(argc, argv), _connectionMode(ConnectionMode::None) {
+ClientApp::ClientApp(int& argc, char** argv) : QApplication(argc, argv), _connectionMode(ConnectionMode::None), _examMode(false) {
/* some values */
setOrganizationName("openslx");
setOrganizationDomain("openslx.org");
diff --git a/src/client/net/serverconnection.cpp b/src/client/net/serverconnection.cpp
index 3ff16bf..f4a6fd6 100644
--- a/src/client/net/serverconnection.cpp
+++ b/src/client/net/serverconnection.cpp
@@ -153,6 +153,9 @@ void ServerConnection::handleMsg()
_toServer.setField(_ID, _LOGIN);
_toServer.setField("HOST", QHostInfo::localHostName());
_toServer.setField("NAME", QString(user));
+ qDebug() << "logging into manager, exam mode is " << clientApp->isExamMode();
+ _toServer.setField(_EXAMMODE, clientApp->isExamMode() ? __TRUE : __FALSE);
+ /* TODO: (Question) Why is this here not using sendMessage() ? */
qDebug("Sending login request!");
if (_toServer.writeMessage(_socket))
{
@@ -182,7 +185,10 @@ void ServerConnection::handleMsg()
if (id == _THUMB)
{
if (clientApp->isExamMode()) {
- qDebug() << "denied request for screenshot (exam mode)";
+ QByteArray emptyArray;
+ _toServer.setField(_ID, _THUMB);
+ _toServer.setField(_IMG, emptyArray);
+ sendMessage(_toServer);
return;
}
int x = _fromServer.getFieldString(_X).toInt();
@@ -240,6 +246,10 @@ void ServerConnection::handleMsg()
} // message VNCSERVER - start local vncserver
else if (id == _VNCSERVER)
{
+ if (clientApp->isExamMode()) {
+ qDebug() << "denied request for vnc server (exam mode)";
+ return;
+ }
const bool enable = (_fromServer.getFieldString("ENABLE").toInt() != 0);
if (enable)
{
@@ -253,6 +263,10 @@ void ServerConnection::handleMsg()
}
else if (id == _VNCCLIENT)
{
+ if (clientApp->isExamMode()) {
+ qDebug() << "denied request for vnc projection (exam mode)";
+ return;
+ }
const QString host(_fromServer.getFieldString("HOST"));
const int port = _fromServer.getFieldString("PORT").toInt();
if (host.isEmpty() || port <= 0)