This commit is contained in:
Adolfo Gómez García 2019-06-29 17:24:53 +02:00
parent e76695e583
commit bae405d082
5 changed files with 18 additions and 22 deletions

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012 Virtual Cable S.L.
# Copyright (c) 2012-2019 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -27,8 +27,6 @@
# 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.
from __future__ import unicode_literals
import logging
logger = logging.getLogger(__name__)

View File

@ -333,6 +333,9 @@ class RDPFile(object):
# DirectX?
res += 'redirectdirectx:i:1\n'
# Camera?
# res += 'camerastoredirect:s:*\n'
return res
def getMacOsX(self):

View File

@ -116,9 +116,9 @@ def udsJs(request):
'user': reverse('page.index'),
'customAuth': reverse('uds.web.views.customAuth', kwargs={'idAuth': ''}),
'services': reverse('webapi.services'),
'enabler': reverse('webapi.enabler', kwargs={ 'idService': 'param1', 'idTransport': 'param2' }),
'action': reverse('webapi.action', kwargs={ 'idService': 'param1', 'action': 'param2' }),
'galleryImage': reverse('webapi.galleryImage', kwargs={ 'idImage': 'param1' }),
'enabler': reverse('webapi.enabler', kwargs={'idService': 'param1', 'idTransport': 'param2'}),
'action': reverse('webapi.action', kwargs={'idService': 'param1', 'action': 'param2'}),
'galleryImage': reverse('webapi.galleryImage', kwargs={'idImage': 'param1'}),
'transportIcon': reverse('webapi.transportIcon', kwargs={'idTrans': 'param1'}),
'static': static(''),
# Launcher URL if exists
@ -145,7 +145,7 @@ def udsJs(request):
if profile['role'] == 'staff': # Add staff things
# If is admin (informational, REST api checks users privileges anyway...)
profile['admin'] = True;
profile['admin'] = True
# REST auth
config['auth_token'] = request.session.session_key
config['auth_header'] = AUTH_TOKEN_HEADER
@ -159,6 +159,7 @@ def udsJs(request):
if 'errors' in request.session:
errors = request.session['errors']
del request.session['errors']
request.session.modified = True # Ensure saves it
uds = {
'profile': profile,
@ -170,7 +171,6 @@ def udsJs(request):
}
# Reset some 1 time values...
request.session['launch'] = '';
request.session['launch'] = ''
return 'var udsData = ' + json.dumps(uds) + ';\n'

View File

@ -30,7 +30,8 @@
"""
@author: Adolfo Gómez, dkmaster at dkmon dot com
"""
from __future__ import unicode_literals
import traceback
import logging
from django.utils.translation import ugettext_lazy as _
from django.shortcuts import render
@ -41,8 +42,6 @@ from django.urls import reverse
from uds.core.util import encoders
from uds.models import DeployedService, Transport, UserService, Authenticator
import traceback
import logging
logger = logging.getLogger(__name__)
@ -96,10 +95,10 @@ def errorString(errorId):
return strings[0]
def errorView(request, error):
idError = int(error)
def errorView(request, errorCode):
idError = int(errorCode)
code = (error >> 8) & 0xFF
idError = idError & 0xFF;
idError = idError & 0xFF
errStr = errorString(idError)
if code != 0:

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Virtual Cable S.L.
# Copyright (c) 2018-2019 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
@ -29,10 +29,9 @@
@author: Adolfo Gómez, dkmaster at dkmon dot com
"""
import logging
import json
from django.shortcuts import render
from django.http import HttpResponse
from django.http import HttpResponse, JsonResponse
from django.urls import reverse
from uds.web.util.errors import errorView
from uds.core.auths.auth import (
@ -103,7 +102,4 @@ def js(request):
@denyNonAuthenticated
def servicesData(request):
data = getServicesData(request)
return HttpResponse(content=json.dumps(data), content_type='application/json')
return JsonResponse(getServicesData(request))