mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
UDS 3.0 will be only python 3 compatible. We have upgrade django to 2.x, so we need python 3 to use it
This commit is contained in:
parent
96721487de
commit
1ea2054d60
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?eclipse-pydev version="1.0"?><pydev_project>
|
||||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
|
||||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
|
||||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python3.5</pydev_property>
|
||||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 3.0</pydev_property>
|
||||
<pydev_variables_property name="org.python.pydev.PROJECT_VARIABLE_SUBSTITUTION">
|
||||
<key>DJANGO_MANAGE_LOCATION</key>
|
||||
<value>src/manage.py</value>
|
||||
|
@ -34,7 +34,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from uds.REST import Handler
|
||||
from uds.REST import RequestError
|
||||
from uds.models import TicketStore
|
||||
|
@ -41,5 +41,5 @@ from uds.core.BaseModule import Module
|
||||
|
||||
import time
|
||||
|
||||
VERSION = '2.x.x-DEVEL'
|
||||
VERSION = '3.x.x-DEVEL'
|
||||
VERSION_STAMP = '{}-DEVEL'.format(time.strftime("%Y%m%d"))
|
||||
|
@ -39,7 +39,7 @@ from uds.core.auths.GroupsManager import GroupsManager
|
||||
from uds.core.auths.Exceptions import InvalidUserException
|
||||
import logging
|
||||
|
||||
__updated__ = '2018-01-16'
|
||||
__updated__ = '2018-02-12'
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -200,7 +200,7 @@ class Authenticator(Module):
|
||||
if self.isExternalSource:
|
||||
groupsManager = GroupsManager(self._dbAuth)
|
||||
self.getGroups(user.name, groupsManager)
|
||||
user.groups = [g.dbGroup() for g in groupsManager.getValidGroups()]
|
||||
user.groups.set([g.dbGroup() for g in groupsManager.getValidGroups()])
|
||||
|
||||
def callbackUrl(self):
|
||||
"""
|
||||
|
@ -63,7 +63,7 @@ class Cache(object):
|
||||
|
||||
def get(self, skey, defValue=None):
|
||||
now = getSqlDatetime()
|
||||
# logger.debug('Requesting key "%s" for cache "%s"' % (skey, self._owner,))
|
||||
logger.debug('Requesting key "%s" for cache "%s"' % (skey, self._owner,))
|
||||
try:
|
||||
key = self.__getKey(skey)
|
||||
c = uds.models.Cache.objects.get(pk=key) # @UndefinedVariable
|
||||
@ -71,8 +71,10 @@ class Cache(object):
|
||||
if expired:
|
||||
return defValue
|
||||
try:
|
||||
logger.debug('value: {} ----- {}'.format(c.value, encoders.decode(c.value, 'base64')))
|
||||
val = pickle.loads(encoders.decode(c.value, 'base64'))
|
||||
except ValueError:
|
||||
except Exception: # If invalid, simple do no tuse it
|
||||
logger.exception('Invalid pickle from cache')
|
||||
c.delete()
|
||||
return defValue
|
||||
Cache.hits += 1
|
||||
|
@ -77,6 +77,9 @@ class FileStorage(Storage):
|
||||
Storage.__init__(self, *args, **kwargs)
|
||||
|
||||
def get_valid_name(self, name):
|
||||
logger.debug('Name in get_valid_name: {}'.format(name))
|
||||
if name is None:
|
||||
return name
|
||||
return name.replace('\\', os.path.sep)
|
||||
|
||||
def _getKey(self, name):
|
||||
@ -88,6 +91,7 @@ class FileStorage(Storage):
|
||||
return 'fstor' + six.text_type(hash(self.get_valid_name(name)))
|
||||
|
||||
def _dbFileForReadOnly(self, name):
|
||||
logger.debug('Name in _dbFileForReadOnly: {}'.format(name))
|
||||
# If we have a cache, & the cache contains the object
|
||||
if self.cache is not None:
|
||||
dbf = self.cache.get(self._getKey(name))
|
||||
@ -97,6 +101,7 @@ class FileStorage(Storage):
|
||||
return self._dbFileForReadWrite(name)
|
||||
|
||||
def _dbFileForReadWrite(self, name):
|
||||
logger.debug('Name in _dbFileForReadWrite: {}'.format(name))
|
||||
f = DBFile.objects.get(name=self.get_valid_name(name))
|
||||
self._storeInCache(f)
|
||||
return f
|
||||
@ -114,6 +119,7 @@ class FileStorage(Storage):
|
||||
'modified': f.modified
|
||||
})
|
||||
|
||||
logger.debug('Name in _dbFileForReadWrite: {}'.format(f.name))
|
||||
self.cache.set(self._getKey(f.name), dbf, 3600) # Cache defaults to one hour
|
||||
|
||||
def _removeFromCache(self, name):
|
||||
@ -162,7 +168,7 @@ class FileStorage(Storage):
|
||||
def exists(self, name):
|
||||
logger.debug('Called exists for {}'.format(name))
|
||||
try:
|
||||
_ = self._dbFileForReadOnly(name).uuid # Tries to access uuid
|
||||
_ = self._dbFileForReadOnly(name).uuid # Tries to access uuid
|
||||
return True
|
||||
except DBFile.DoesNotExist:
|
||||
return False
|
||||
|
@ -99,7 +99,7 @@ class Migration(migrations.Migration):
|
||||
('state', models.CharField(default='P', max_length=1, db_index=True)),
|
||||
('state_date', models.DateTimeField()),
|
||||
('revision', models.PositiveIntegerField(default=1)),
|
||||
('deployed_service', models.ForeignKey(related_name='publications', to='uds.DeployedService')),
|
||||
('deployed_service', models.ForeignKey(related_name='publications', to='uds.DeployedService', on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
'ordering': ('publish_date',),
|
||||
@ -116,7 +116,7 @@ class Migration(migrations.Migration):
|
||||
('comments', models.CharField(default='', max_length=256)),
|
||||
('is_meta', models.BooleanField(default=False, db_index=True)),
|
||||
('groups', models.ManyToManyField(to='uds.Group')),
|
||||
('manager', models.ForeignKey(related_name='groups', to='uds.Authenticator')),
|
||||
('manager', models.ForeignKey(related_name='groups', to='uds.Authenticator', on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
'ordering': ('name',),
|
||||
@ -203,7 +203,7 @@ class Migration(migrations.Migration):
|
||||
('data_type', models.CharField(max_length=128)),
|
||||
('data', models.TextField(default='')),
|
||||
('comments', models.CharField(max_length=256)),
|
||||
('provider', models.ForeignKey(related_name='services', to='uds.Provider')),
|
||||
('provider', models.ForeignKey(related_name='services', to='uds.Provider', on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
'ordering': ('name',),
|
||||
@ -295,7 +295,7 @@ class Migration(migrations.Migration):
|
||||
('is_admin', models.BooleanField(default=False)),
|
||||
('last_access', models.DateTimeField(default=datetime.datetime(1972, 7, 1, 0, 0))),
|
||||
('parent', models.IntegerField(default=-1)),
|
||||
('manager', models.ForeignKey(related_name='users', to='uds.Authenticator')),
|
||||
('manager', models.ForeignKey(related_name='users', to='uds.Authenticator', on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
'ordering': ('name',),
|
||||
@ -309,7 +309,7 @@ class Migration(migrations.Migration):
|
||||
('module', models.CharField(max_length=32, db_index=True)),
|
||||
('name', models.CharField(max_length=32, db_index=True)),
|
||||
('value', models.CharField(max_length=128, db_index=True)),
|
||||
('user', models.ForeignKey(related_name='preferences', to='uds.User')),
|
||||
('user', models.ForeignKey(related_name='preferences', to='uds.User', on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
@ -332,9 +332,9 @@ class Migration(migrations.Migration):
|
||||
('src_hostname', models.CharField(default='', max_length=64)),
|
||||
('src_ip', models.CharField(default='', max_length=15)),
|
||||
('cluster_node', models.CharField(default=None, max_length=128, null=True, db_index=True, blank=True)),
|
||||
('deployed_service', models.ForeignKey(related_name='userServices', to='uds.DeployedService')),
|
||||
('publication', models.ForeignKey(related_name='userServices', blank=True, to='uds.DeployedServicePublication', null=True)),
|
||||
('user', models.ForeignKey(related_name='userServices', default=None, blank=True, to='uds.User', null=True)),
|
||||
('deployed_service', models.ForeignKey(related_name='userServices', to='uds.DeployedService', on_delete=models.CASCADE)),
|
||||
('publication', models.ForeignKey(related_name='userServices', blank=True, to='uds.DeployedServicePublication', null=True, on_delete=models.CASCADE)),
|
||||
('user', models.ForeignKey(related_name='userServices', default=None, blank=True, to='uds.User', null=True, on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
'ordering': ('creation_date',),
|
||||
@ -379,13 +379,13 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='deployedservice',
|
||||
name='osmanager',
|
||||
field=models.ForeignKey(related_name='deployedServices', blank=True, to='uds.OSManager', null=True),
|
||||
field=models.ForeignKey(related_name='deployedServices', blank=True, to='uds.OSManager', null=True, on_delete=models.CASCADE),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='deployedservice',
|
||||
name='service',
|
||||
field=models.ForeignKey(related_name='deployedServices', blank=True, to='uds.Service', null=True),
|
||||
field=models.ForeignKey(related_name='deployedServices', blank=True, to='uds.Service', null=True, on_delete=models.CASCADE),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
|
@ -31,7 +31,7 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='deployedservice',
|
||||
name='image',
|
||||
field=models.ForeignKey(related_name='deployedServices', blank=True, to='uds.Image', null=True),
|
||||
field=models.ForeignKey(related_name='deployedServices', blank=True, to='uds.Image', null=True, on_delete=models.CASCADE),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
||||
|
@ -17,7 +17,7 @@ class Migration(migrations.Migration):
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=128, db_index=True)),
|
||||
('value', models.TextField(default='')),
|
||||
('user_service', models.ForeignKey(related_name='properties', to='uds.UserService')),
|
||||
('user_service', models.ForeignKey(related_name='properties', to='uds.UserService', on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
'db_table': 'uds__user_service_property',
|
||||
|
@ -21,8 +21,8 @@ class Migration(migrations.Migration):
|
||||
('object_type', models.SmallIntegerField(default=-1, db_index=True)),
|
||||
('object_id', models.IntegerField(default=None, null=True, db_index=True, blank=True)),
|
||||
('permission', models.SmallIntegerField(default=0, db_index=True)),
|
||||
('group', models.ForeignKey(related_name='permissions', default=None, blank=True, to='uds.Group', null=True)),
|
||||
('user', models.ForeignKey(related_name='permissions', default=None, blank=True, to='uds.User', null=True)),
|
||||
('group', models.ForeignKey(related_name='permissions', default=None, blank=True, to='uds.Group', null=True, on_delete=models.CASCADE)),
|
||||
('user', models.ForeignKey(related_name='permissions', default=None, blank=True, to='uds.User', null=True, on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
|
@ -44,16 +44,16 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='group',
|
||||
name='manager',
|
||||
field=uds.models.Util.UnsavedForeignKey(related_name='groups', to='uds.Authenticator'),
|
||||
field=uds.models.Util.UnsavedForeignKey(related_name='groups', to='uds.Authenticator', on_delete=models.CASCADE),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='user',
|
||||
name='manager',
|
||||
field=uds.models.Util.UnsavedForeignKey(related_name='users', to='uds.Authenticator'),
|
||||
field=uds.models.Util.UnsavedForeignKey(related_name='users', to='uds.Authenticator', on_delete=models.CASCADE),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='deployedservicepublicationchangelog',
|
||||
name='publication',
|
||||
field=models.ForeignKey(related_name='changelog', to='uds.DeployedService'),
|
||||
field=models.ForeignKey(related_name='changelog', to='uds.DeployedService', on_delete=models.CASCADE),
|
||||
),
|
||||
]
|
||||
|
@ -37,7 +37,7 @@ class Migration(migrations.Migration):
|
||||
('interval', models.IntegerField(default=1)),
|
||||
('duration', models.IntegerField(default=0)),
|
||||
('duration_unit', models.CharField(default='MINUTES', max_length=32, choices=[('MINUTES', 'Minutes'), ('HOURS', 'Hours'), ('DAYS', 'Days'), ('WEEKS', 'Weeks')])),
|
||||
('calendar', models.ForeignKey(related_name='rules', to='uds.Calendar')),
|
||||
('calendar', models.ForeignKey(related_name='rules', to='uds.Calendar', on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
'db_table': 'uds_calendar_rules',
|
||||
|
@ -60,7 +60,7 @@ class AccountUsage(UUIDModel):
|
||||
end = models.DateTimeField(default=NEVER)
|
||||
user_service = models.OneToOneField(UserService, null=True, blank=True, related_name='accounting', on_delete=models.SET_NULL)
|
||||
|
||||
account = models.ForeignKey(Account, related_name='usages')
|
||||
account = models.ForeignKey(Account, related_name='usages', on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
"""
|
||||
|
@ -103,7 +103,7 @@ class CalendarRule(UUIDModel):
|
||||
duration = models.IntegerField(default=0) # Duration in minutes
|
||||
duration_unit = models.CharField(choices=dunits, default='MINUTES', max_length=32)
|
||||
|
||||
calendar = models.ForeignKey(Calendar, related_name='rules')
|
||||
calendar = models.ForeignKey(Calendar, related_name='rules', on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
'''
|
||||
|
@ -59,9 +59,11 @@ class DBFile(UUIDModel):
|
||||
try:
|
||||
return encoders.decode(encoders.decode(self.content, 'base64'), 'zip')
|
||||
except Exception:
|
||||
logger.exception('Getting data')
|
||||
logger.error('DBFile {} has errors and cannot be used'.format(self.name))
|
||||
try:
|
||||
self.delete() # Autodelete, invalid...
|
||||
# self.delete() # Autodelete, invalid...
|
||||
pass
|
||||
except:
|
||||
logger.error('Could not even delete {}!!'.format(self.name))
|
||||
|
||||
@ -69,8 +71,11 @@ class DBFile(UUIDModel):
|
||||
|
||||
@data.setter
|
||||
def data(self, value):
|
||||
logger.debug('Encoding value: {}'.format(value))
|
||||
self.size = len(value)
|
||||
self.content = encoders.encode(encoders.encode(value, 'zip'), 'base64')
|
||||
content = encoders.encode(encoders.encode(value, 'zip'), 'base64', asText=True)
|
||||
logger.debug('Content is {}'.format(type(content)))
|
||||
self.content = content
|
||||
|
||||
def __str__(self):
|
||||
return 'File: {} {} {} {}'.format(self.name, self.size, self.created, self.modified)
|
||||
|
@ -64,10 +64,10 @@ class Service(ManagedObjectModel, TaggingMixin):
|
||||
or a Terminal Server configuration).
|
||||
"""
|
||||
# pylint: disable=model-missing-unicode
|
||||
provider = models.ForeignKey(Provider, related_name='services')
|
||||
provider = models.ForeignKey(Provider, related_name='services', on_delete=models.CASCADE)
|
||||
|
||||
# Proxy for this service
|
||||
proxy = models.ForeignKey(Proxy, null=True, blank=True, related_name='services')
|
||||
proxy = models.ForeignKey(Proxy, null=True, blank=True, related_name='services', on_delete=models.CASCADE)
|
||||
|
||||
|
||||
class Meta(ManagedObjectModel.Meta):
|
||||
|
@ -76,8 +76,8 @@ class DeployedService(UUIDModel, TaggingMixin):
|
||||
name = models.CharField(max_length=128, default='')
|
||||
short_name = models.CharField(max_length=32, default='')
|
||||
comments = models.CharField(max_length=256, default='')
|
||||
service = models.ForeignKey(Service, null=True, blank=True, related_name='deployedServices')
|
||||
osmanager = models.ForeignKey(OSManager, null=True, blank=True, related_name='deployedServices')
|
||||
service = models.ForeignKey(Service, null=True, blank=True, related_name='deployedServices', on_delete=models.CASCADE)
|
||||
osmanager = models.ForeignKey(OSManager, null=True, blank=True, related_name='deployedServices', on_delete=models.CASCADE)
|
||||
transports = models.ManyToManyField(Transport, related_name='deployedServices', db_table='uds__ds_trans')
|
||||
assignedGroups = models.ManyToManyField(Group, related_name='deployedServices', db_table='uds__ds_grps')
|
||||
state = models.CharField(max_length=1, default=states.servicePool.ACTIVE, db_index=True)
|
||||
@ -96,7 +96,7 @@ class DeployedService(UUIDModel, TaggingMixin):
|
||||
actionsCalendars = models.ManyToManyField(Calendar, related_name='actionsSP', through='CalendarAction')
|
||||
|
||||
# Usage accounting
|
||||
account = models.ForeignKey(Account, null=True, blank=True, related_name='servicesPools')
|
||||
account = models.ForeignKey(Account, null=True, blank=True, related_name='servicesPools', on_delete=models.CASCADE)
|
||||
|
||||
initial_srvs = models.PositiveIntegerField(default=0)
|
||||
cache_l1_srvs = models.PositiveIntegerField(default=0)
|
||||
|
@ -63,12 +63,13 @@ def country(lang):
|
||||
|
||||
|
||||
# Config related
|
||||
@register.assignment_tag
|
||||
@register.simple_tag
|
||||
def get_theme():
|
||||
return GlobalConfig.UDS_THEME.get()
|
||||
|
||||
|
||||
class EnhacedVisual(template.Node):
|
||||
|
||||
def __init__(self, nodelistTrue, nodelistFalse):
|
||||
self._nodelistTrue = nodelistTrue
|
||||
self._nodelistFalse = nodelistFalse
|
||||
@ -98,6 +99,7 @@ def enhaced_visual(parser, token):
|
||||
|
||||
|
||||
class TabIndex(template.Node):
|
||||
|
||||
def __init__(self, tabIndexName):
|
||||
self.tabIndexIname = tabIndexName
|
||||
|
||||
@ -121,6 +123,7 @@ def tabindex(parser, token):
|
||||
|
||||
|
||||
class Preference(template.Node):
|
||||
|
||||
def __init__(self, modName, prefName):
|
||||
self.modName = modName
|
||||
self.prefName = prefName
|
||||
@ -147,26 +150,27 @@ def preference(parser, token):
|
||||
return Preference(modName, prefName)
|
||||
|
||||
|
||||
@register.assignment_tag
|
||||
@register.simple_tag
|
||||
def preferences_allowed():
|
||||
return GlobalConfig.PREFERENCES_ALLOWED.getBool(True)
|
||||
|
||||
|
||||
@register.assignment_tag
|
||||
@register.simple_tag
|
||||
def pageReloadTime():
|
||||
return GlobalConfig.RELOAD_TIME.getInt(True)
|
||||
|
||||
|
||||
@register.assignment_tag
|
||||
@register.simple_tag
|
||||
def root_id():
|
||||
return ROOT_ID
|
||||
|
||||
|
||||
@register.assignment_tag
|
||||
@register.simple_tag
|
||||
def image_size():
|
||||
return Image.MAX_IMAGE_SIZE
|
||||
|
||||
@register.assignment_tag
|
||||
|
||||
@register.simple_tag
|
||||
def calendar_denied_msg():
|
||||
text = GlobalConfig.LIMITED_BY_CALENDAR_TEXT.get().strip()
|
||||
if text == '':
|
||||
@ -174,8 +178,10 @@ def calendar_denied_msg():
|
||||
|
||||
return text
|
||||
|
||||
|
||||
# Browser related
|
||||
class IfBrowser(template.Node):
|
||||
|
||||
def __init__(self, nodelistTrue, nodelistFalse, browsers):
|
||||
self._nodelistTrue = nodelistTrue
|
||||
self._nodelistFalse = nodelistFalse
|
||||
|
@ -34,7 +34,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_noop as _
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.http import HttpResponseRedirect
|
||||
|
||||
from uds.core.ui.UserInterface import gui
|
||||
|
@ -30,9 +30,10 @@
|
||||
@author: Adolfo Gómez, dkmaster at dkmon dot com
|
||||
"""
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.urls import re_path
|
||||
from django.conf.urls import include
|
||||
from uds.core.util.modfinder import loadModulesUrls
|
||||
from django.views.i18n import javascript_catalog
|
||||
from django.views.i18n import JavaScriptCatalog
|
||||
from uds import REST
|
||||
import uds.web.views
|
||||
|
||||
@ -42,56 +43,56 @@ js_info_dict = {
|
||||
}
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', uds.web.views.index, name='uds.web.views.index'),
|
||||
url(r'^login/$', uds.web.views.login, name='uds.web.views.login'),
|
||||
url(r'^login/(?P<tag>.+)$', uds.web.views.login, name='uds.web.views.login'),
|
||||
url(r'^logout$', uds.web.views.logout, name='uds.web.views.logout'),
|
||||
re_path(r'^$', uds.web.views.index, name='uds.web.views.index'),
|
||||
re_path(r'^login/$', uds.web.views.login, name='uds.web.views.login'),
|
||||
re_path(r'^login/(?P<tag>.+)$', uds.web.views.login, name='uds.web.views.login'),
|
||||
re_path(r'^logout$', uds.web.views.logout, name='uds.web.views.logout'),
|
||||
# Icons
|
||||
url(r'^transicon/(?P<idTrans>.+)$', uds.web.views.transportIcon, name='uds.web.views.transportIcon'),
|
||||
re_path(r'^transicon/(?P<idTrans>.+)$', uds.web.views.transportIcon, name='uds.web.views.transportIcon'),
|
||||
# Images
|
||||
url(r'^srvimg/(?P<idImage>.+)$', uds.web.views.serviceImage, name='uds.web.views.serviceImage'),
|
||||
url(r'^galimg/(?P<idImage>.+)$', uds.web.views.image, name='galleryImage'),
|
||||
re_path(r'^srvimg/(?P<idImage>.+)$', uds.web.views.serviceImage, name='uds.web.views.serviceImage'),
|
||||
re_path(r'^galimg/(?P<idImage>.+)$', uds.web.views.image, name='galleryImage'),
|
||||
# Error URL
|
||||
url(r'^error/(?P<idError>.+)$', uds.web.views.error, name='uds.web.views.error'),
|
||||
re_path(r'^error/(?P<idError>.+)$', uds.web.views.error, name='uds.web.views.error'),
|
||||
# Transport own link processor
|
||||
url(r'^trans/(?P<idService>.+)/(?P<idTransport>.+)$', uds.web.views.transportOwnLink, name='TransportOwnLink'),
|
||||
re_path(r'^trans/(?P<idService>.+)/(?P<idTransport>.+)$', uds.web.views.transportOwnLink, name='TransportOwnLink'),
|
||||
# Authenticators custom html
|
||||
url(r'^customAuth/(?P<idAuth>.*)$', uds.web.views.customAuth, name='uds.web.views.customAuth'),
|
||||
re_path(r'^customAuth/(?P<idAuth>.*)$', uds.web.views.customAuth, name='uds.web.views.customAuth'),
|
||||
# Preferences
|
||||
url(r'^prefs$', uds.web.views.prefs, name='uds.web.views.prefs'),
|
||||
re_path(r'^prefs$', uds.web.views.prefs, name='uds.web.views.prefs'),
|
||||
# Change Language
|
||||
url(r'^i18n/', include('django.conf.urls.i18n')),
|
||||
re_path(r'^i18n/', include('django.conf.urls.i18n')),
|
||||
# Downloads
|
||||
url(r'^idown/(?P<idDownload>[a-zA-Z0-9-]*)$', uds.web.views.download, name='uds.web.views.download'),
|
||||
re_path(r'^idown/(?P<idDownload>[a-zA-Z0-9-]*)$', uds.web.views.download, name='uds.web.views.download'),
|
||||
# downloads for client
|
||||
url(r'^down$', uds.web.views.client_downloads, name='uds.web.views.client_downloads'),
|
||||
url(r'^down/(?P<os>[a-zA-Z0-9-]*)$', uds.web.views.client_downloads, name='uds.web.views.client_downloads'),
|
||||
url(r'^pluginDetection/(?P<detection>[a-zA-Z0-9-]*)$', uds.web.views.plugin_detection, name='PluginDetection'),
|
||||
re_path(r'^down$', uds.web.views.client_downloads, name='uds.web.views.client_downloads'),
|
||||
re_path(r'^down/(?P<os>[a-zA-Z0-9-]*)$', uds.web.views.client_downloads, name='uds.web.views.client_downloads'),
|
||||
re_path(r'^pluginDetection/(?P<detection>[a-zA-Z0-9-]*)$', uds.web.views.plugin_detection, name='PluginDetection'),
|
||||
# Client access enabler
|
||||
url(r'^enable/(?P<idService>.+)/(?P<idTransport>.+)$', uds.web.views.clientEnabler, name='ClientAccessEnabler'),
|
||||
re_path(r'^enable/(?P<idService>.+)/(?P<idTransport>.+)$', uds.web.views.clientEnabler, name='ClientAccessEnabler'),
|
||||
|
||||
# Releaser
|
||||
url(r'^release/(?P<idService>.+)$', uds.web.views.release, name='Releaser'),
|
||||
re_path(r'^release/(?P<idService>.+)$', uds.web.views.release, name='Releaser'),
|
||||
|
||||
# Custom authentication callback
|
||||
url(r'^auth/(?P<authName>.+)', uds.web.views.authCallback, name='uds.web.views.authCallback'),
|
||||
url(r'^authinfo/(?P<authName>.+)', uds.web.views.authInfo, name='uds.web.views.authInfo'),
|
||||
url(r'^about', uds.web.views.about, name='uds.web.views.about'),
|
||||
re_path(r'^auth/(?P<authName>.+)', uds.web.views.authCallback, name='uds.web.views.authCallback'),
|
||||
re_path(r'^authinfo/(?P<authName>.+)', uds.web.views.authInfo, name='uds.web.views.authInfo'),
|
||||
re_path(r'^about', uds.web.views.about, name='uds.web.views.about'),
|
||||
# Ticket authentication
|
||||
url(r'^tkauth/(?P<ticketId>.+)$', uds.web.views.ticketAuth, name='TicketAuth'),
|
||||
re_path(r'^tkauth/(?P<ticketId>.+)$', uds.web.views.ticketAuth, name='TicketAuth'),
|
||||
|
||||
# REST Api
|
||||
url(r'^rest/(?P<arguments>.*)$', REST.Dispatcher.as_view(), name="REST"),
|
||||
re_path(r'^rest/(?P<arguments>.*)$', REST.Dispatcher.as_view(), name="REST"),
|
||||
|
||||
# Web admin GUI
|
||||
url(r'^adm/', include('uds.admin.urls')),
|
||||
re_path(r'^adm/', include('uds.admin.urls')),
|
||||
|
||||
# Files
|
||||
url(r'^files/(?P<uuid>.+)', uds.web.views.file_storage, name='uds.web.views.file_storage'),
|
||||
re_path(r'^files/(?P<uuid>.+)', uds.web.views.file_storage, name='uds.web.views.file_storage'),
|
||||
|
||||
# Internacionalization in javascript
|
||||
# Javascript catalog
|
||||
url(r'^jsi18n/(?P<packages>[a-z]*)$', javascript_catalog, js_info_dict, name='uds.web.views.jsCatalog'),
|
||||
# Javascript catalog. In fact, lang is not used, but it is maintanied for "backward" user templates compatibility
|
||||
re_path(r'^jsi18n/(?P<lang>[a-z]*)$', JavaScriptCatalog.as_view(), name='uds.web.views.jsCatalog'),
|
||||
]
|
||||
|
||||
# Append urls from special dispatchers
|
||||
|
@ -37,7 +37,7 @@ from django.shortcuts import render
|
||||
from django.template import RequestContext
|
||||
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from .transformers import scrambleId, transformId
|
||||
|
||||
from uds.models import DeployedService, Transport, UserService, Authenticator
|
||||
|
@ -32,7 +32,7 @@ from __future__ import unicode_literals
|
||||
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect
|
||||
from django.shortcuts import render
|
||||
from django.utils.translation import ugettext as _
|
||||
@ -53,8 +53,7 @@ from uds.models import TicketStore
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
__updated__ = '2017-02-14'
|
||||
__updated__ = '2018-02-12'
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
|
@ -39,10 +39,12 @@ import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
__updated__ = '2016-04-05'
|
||||
__updated__ = '2018-02-12'
|
||||
|
||||
|
||||
@cache_page(3600, key_prefix='file', cache='memory')
|
||||
def file_storage(request, uuid):
|
||||
logger.debug('Getting {} from DB'.format(uuid))
|
||||
f = DBFile.objects.get(uuid=uuid)
|
||||
content_type, encoding = mimetypes.guess_type(f.name)
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.shortcuts import render
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext
|
||||
from django.utils import formats
|
||||
|
||||
@ -51,7 +51,7 @@ import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
__updated__ = '2017-11-10'
|
||||
__updated__ = '2018-02-12'
|
||||
|
||||
|
||||
def about(request):
|
||||
|
@ -32,7 +32,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.http import HttpResponse, HttpResponseRedirect
|
||||
from django.shortcuts import render
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext
|
||||
|
||||
from uds.core.auths.auth import webLogin, authenticate, authLogLogin, authLogLogout, getUDSCookie, webLoginRequired, webLogout
|
||||
@ -48,7 +48,8 @@ import uds.web.errors as errors
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
__updated__ = '2017-06-01'
|
||||
__updated__ = '2018-02-12'
|
||||
|
||||
|
||||
# Allow cross-domain login
|
||||
# @csrf_exempt
|
||||
|
Loading…
Reference in New Issue
Block a user