1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-10 01:17:59 +03:00

* Added new resolutions to RDP

* Added logging of generated password to service log
* Small "pepe" corrections
This commit is contained in:
Adolfo Gómez García 2015-01-13 14:50:49 +01:00
parent ddd8df3b26
commit c72a8d3950
5 changed files with 43 additions and 33 deletions

View File

@ -228,6 +228,8 @@ class CommonPrefs(object):
SZ_640x480 = '1'
SZ_800x600 = '2'
SZ_1024x768 = '3'
SZ_1366x768 = '4'
SZ_1920x1080 = '5'
SZ_FULLSCREEN = 'F'
DEPTH_PREF = 'screenDepth'
@ -245,6 +247,8 @@ class CommonPrefs(object):
CommonPrefs.SZ_640x480: (640, 480),
CommonPrefs.SZ_800x600: (800, 600),
CommonPrefs.SZ_1024x768: (1024, 768),
CommonPrefs.SZ_1366x768: (1366, 768),
CommonPrefs.SZ_1920x1080: (1920, 1080),
CommonPrefs.SZ_FULLSCREEN: (-1, -1)
}[prefsDict[CommonPrefs.SZ_PREF]]
@ -263,17 +267,15 @@ class CommonPrefs(object):
screenSizePref = UserChoicePreference(name=SZ_PREF,
label=ugettext_lazy('Screen Size'),
defvalue=SZ_FULLSCREEN,
values=(
(SZ_640x480, '640x480'),
values=((SZ_640x480, '640x480'),
(SZ_800x600, '800x600'),
(SZ_1024x768, '1024x768'),
(SZ_FULLSCREEN, ugettext_lazy('Full Screen'))
)
)
depthPref = UserChoicePreference(name=DEPTH_PREF, label=ugettext_lazy('Screen colors'), defvalue=DEPTH_24, values=(
(DEPTH_8, ugettext_lazy('8 bits')),
(DEPTH_16, ugettext_lazy('16 bits')),
(DEPTH_24, ugettext_lazy('24 bits')),
(DEPTH_32, ugettext_lazy('32 bits')),
)
(SZ_FULLSCREEN, ugettext_lazy('Full Screen')))
)
depthPref = UserChoicePreference(name=DEPTH_PREF, label=ugettext_lazy('Screen colors'),
defvalue=DEPTH_24,
values=((DEPTH_8, ugettext_lazy('8 bits')),
(DEPTH_16, ugettext_lazy('16 bits')),
(DEPTH_24, ugettext_lazy('24 bits')),
(DEPTH_32, ugettext_lazy('32 bits')))
)

View File

@ -36,6 +36,7 @@ from django.utils.translation import ugettext_noop as _
from uds.core.ui.UserInterface import gui
from uds.core import osmanagers
from uds.osmanagers.LinuxOsManager import LinuxOsManager
from uds.core.util import log
import logging
@ -79,6 +80,8 @@ class LinuxRandomPassManager(LinuxOsManager):
if randomPass is None:
randomPass = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(16))
service.storeValue('linOsRandomPass', randomPass)
log.doLog(service, log.INFO, "Password set to \"{}\"".format(randomPass), log.OSMANAGER)
return randomPass
def infoVal(self, service):

View File

@ -14,7 +14,8 @@ from django.utils.translation import ugettext_noop as _
from uds.core.ui.UserInterface import gui
from uds.core.managers.CryptoManager import CryptoManager
from uds.core import osmanagers
from WindowsOsManager import WindowsOsManager, scrambleMsg
from WindowsOsManager import WindowsOsManager
from uds.core.util import log
import logging
@ -63,6 +64,7 @@ class WinRandomPassManager(WindowsOsManager):
if randomPass is None:
randomPass = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(16))
service.storeValue('winOsRandomPass', randomPass)
log.doLog(service, log.INFO, "Password set to \"{}\"".format(randomPass), log.OSMANAGER)
return randomPass
def infoVal(self, service):

View File

@ -23,6 +23,7 @@ import logging
logger = logging.getLogger(__name__)
def scrambleMsg(data):
'''
Simple scrambler so password are not seen at source page

View File

@ -4,27 +4,27 @@
# Copyright (c) 2012 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Virtual Cable S.L. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# * Neither the name of Virtual Cable S.L. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''
@ -33,11 +33,13 @@
from django.utils.translation import ugettext_noop as _
from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs
from RDPTransport import RDPTransport
from TSRDPTransport import TSRDPTransport
from .RDPTransport import RDPTransport
from .TSRDPTransport import TSRDPTransport
UserPrefsManager.manager().registerPrefs('rdp', _('Remote Desktop Protocol'),
[
CommonPrefs.screenSizePref,
CommonPrefs.depthPref
])
UserPrefsManager.manager().registerPrefs('rdp',
_('Remote Desktop Protocol'),
[
CommonPrefs.screenSizePref,
CommonPrefs.depthPref
]
)