summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Braun2010-10-11 00:52:21 +0200
committerSebastien Braun2010-10-11 00:56:10 +0200
commitd626b99839eb2cf915d96b4048d31e6622ad00ca (patch)
treeb8b5504626a69919c0f68397d0d93cc628bdd1e5
parentFix bug where pressing the closeUp-button sometimes results in no action. (diff)
downloadpvs-d626b99839eb2cf915d96b4048d31e6622ad00ca.tar.gz
pvs-d626b99839eb2cf915d96b4048d31e6622ad00ca.tar.xz
pvs-d626b99839eb2cf915d96b4048d31e6622ad00ca.zip
Add access control check to input event handling in PVS daemon
-rwxr-xr-xsrc/pvs.cpp13
-rwxr-xr-xsrc/pvs.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/src/pvs.cpp b/src/pvs.cpp
index 96a92ea..e0605c2 100755
--- a/src/pvs.cpp
+++ b/src/pvs.cpp
@@ -199,8 +199,11 @@ void PVS::onCommand(PVSMsg cmdMessage)
if (ident.compare("INPUTEVENT") == 0)
{
InputEvent evt;
- eventFromString(message, evt);
- handleInputEvent(evt);
+ if(inputEventsAllowed())
+ {
+ eventFromString(message, evt);
+ handleInputEvent(evt);
+ }
}
if (ident.compare("MCASTFTRETRY") == 0)
{
@@ -749,6 +752,12 @@ bool PVS::createMulticastTransfer(QString const& objectPath, quint64& transferID
// Input handling
+bool PVS::inputEventsAllowed()
+{
+ QString lecturer = getConfigValue("Permissions/vnc_lecturer");
+ return r == "rw";
+}
+
void PVS::handleInputEvent(InputEvent const& evt)
{
QString s = evt.toString();
diff --git a/src/pvs.h b/src/pvs.h
index 902fbe7..27ea2fc 100755
--- a/src/pvs.h
+++ b/src/pvs.h
@@ -169,6 +169,7 @@ private:
// input event handling:
InputEventHandlerChain _inputEventHandlers;
+ bool inputEventsAllowed();
void handleInputEvent(InputEvent const& evt);
void initializeInputEventHandling();