diff options
author | Sebastien Braun | 2010-10-11 00:52:21 +0200 |
---|---|---|
committer | Sebastien Braun | 2010-10-11 00:56:10 +0200 |
commit | d626b99839eb2cf915d96b4048d31e6622ad00ca (patch) | |
tree | b8b5504626a69919c0f68397d0d93cc628bdd1e5 | |
parent | Fix bug where pressing the closeUp-button sometimes results in no action. (diff) | |
download | pvs-d626b99839eb2cf915d96b4048d31e6622ad00ca.tar.gz pvs-d626b99839eb2cf915d96b4048d31e6622ad00ca.tar.xz pvs-d626b99839eb2cf915d96b4048d31e6622ad00ca.zip |
Add access control check to input event handling in PVS daemon
-rwxr-xr-x | src/pvs.cpp | 13 | ||||
-rwxr-xr-x | src/pvs.h | 1 |
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(); @@ -169,6 +169,7 @@ private: // input event handling: InputEventHandlerChain _inputEventHandlers; + bool inputEventsAllowed(); void handleInputEvent(InputEvent const& evt); void initializeInputEventHandling(); |