diff --git a/.gitignore b/.gitignore index 60c93c1b..0450f10b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.pyc *.orig +*_enterprise .settings/ # Debian buildings @@ -60,7 +61,7 @@ /rdptransport/java/jar/*.jar # /server/ -/server/*_enterprise +*_enterprise /server/openuds.sublime-project /server/openuds.sublime-workspace diff --git a/server/src/uds/REST/methods/actor.py b/server/src/uds/REST/methods/actor.py index ec3ee5b9..01c9a4b3 100644 --- a/server/src/uds/REST/methods/actor.py +++ b/server/src/uds/REST/methods/actor.py @@ -46,7 +46,6 @@ from uds.models import UserService import datetime import six -import simplejson as json import logging @@ -54,7 +53,7 @@ logger = logging.getLogger(__name__) # Actor key, configurable in Security Section of administration interface -actorKey = Config.Config.section(Config.SECURITY_SECTION).value('actorKey', +actorKey = Config.Config.section(Config.SECURITY_SECTION).value('Master Key', cryptoManager().uuid(datetime.datetime.now()).replace('-', ''), type=Config.Config.TEXT_FIELD) actorKey.get() @@ -65,6 +64,7 @@ ERR_HOST_NOT_MANAGED = 2 ERR_USER_SERVICE_NOT_FOUND = 3 ERR_OSMANAGER_ERROR = 4 + # Enclosed methods under /actor path class Actor(Handler): ''' @@ -160,9 +160,12 @@ class Actor(Handler): inUse = service.in_use + username = '' # Preprocess some messages, common to all clients, such as "log" if message == 'log': data = '\t'.join((self._params.get('message'), six.text_type(self._params.get('level', 10000)))) + elif message in ('login', 'logout', 'logon', 'logoff'): + username = data try: res = service.getInstance().osmanager().process(service, message, data) @@ -172,10 +175,10 @@ class Actor(Handler): # Force service reload to check if inUse has changed, so we can log login/logout service = UserService.objects.get(uuid=uuid) if service.in_use != inUse: # If state changed, log it - type_ = inUse and 'login' or 'logout' + instance = service.getInstance() + type_ = 'login' if service.in_use else 'logout' uniqueId = service.unique_id - serviceIp = '' - username = '' + serviceIp = instance.getIp() log.useLog(type_, uniqueId, serviceIp, username) return Actor.result(res) diff --git a/windowsActor/setup-dialog.ui b/windowsActor/setup-dialog.ui new file mode 100644 index 00000000..5290fbad --- /dev/null +++ b/windowsActor/setup-dialog.ui @@ -0,0 +1,233 @@ + + + UdsActorSetupDialog + + + Qt::WindowModal + + + + 0 + 0 + 399 + 192 + + + + + 0 + 0 + + + + UDS Actor Configuration + + + false + + + + + + false + + + true + + + + false + + + + 20 + 120 + 361 + 23 + + + + Click to test the selecter parameters + + + <html><head/><body><p>Click on this button to test the server host and master key parameters.</p><p>A window will be displayed with results after the test is executed.</p><p><br/></p><p>This button will only be active if all parameters are filled.</p></body></html> + + + Test parameters + + + + + false + + + + 20 + 150 + 101 + 23 + + + + + 101 + 23 + + + + Accepts changes and saves them + + + Clicking on this button will accept all changes and save them, closing the configuration window + + + Accept && Save + + + + + + 264 + 150 + 111 + 23 + + + + + 111 + 23 + + + + Cancel all changes and discard them + + + Discards all changes and closes the configuration window + + + Cancel && Discard + + + + + + 20 + 20 + 361 + 94 + + + + + QFormLayout::AllNonFixedFieldsGrow + + + 16 + + + + + UDS Server Host + + + + + + + false + + + Uds Broker Server Addres. Use IP or FQDN + + + Enter here the UDS Broker Addres using either its IP address or its FQDN address + + + + + + + UDS Master Key + + + + + + + Master key to communicate with UDS Broker + + + <html><head/><body><p>Enter the Master Key (found on<span style=" font-weight:600;"> UDS Configuration</span> section) of the UDS Broker to allow communication of the Actor with Broker</p></body></html> + + + + + + + Security + + + + + + + Select communication security with broker + + + <html><head/><body><p>Select the security for communications with UDS Broker.</p><p>The recommended method of communication is <span style=" font-weight:600;">Use SSL</span>, but selection needs to be acording to your broker configuration.</p></body></html> + + + + Do not use SSL + + + + + Use SSL + + + + + + + + + + + host + textChanged(QString) + UdsActorSetupDialog + textChanged() + + + 123 + 31 + + + 143 + 48 + + + + + masterKey + textChanged(QString) + UdsActorSetupDialog + textChanged() + + + 258 + 75 + + + 299 + 84 + + + + + + textChanged() + +