forked from shaba/openuds
fixed xss && fixed configjs
This commit is contained in:
parent
c69512bf8b
commit
65bb91c449
@ -100,7 +100,7 @@ def getIdleDuration() -> float:
|
|||||||
|
|
||||||
xss.XScreenSaverQueryInfo(display, xlib.XDefaultRootWindow(display), xssInfo)
|
xss.XScreenSaverQueryInfo(display, xlib.XDefaultRootWindow(display), xssInfo)
|
||||||
|
|
||||||
# Centos seems to set state to 1?? (weird, but it's happening don't know why... will try this way)
|
# States: 0 = off, 1 = On, 2 = Cycle, 3 = Disabled, ...?
|
||||||
if xssInfo.contents.state == 1: # state = 1 means "active", so idle is not a valid state
|
if xssInfo.contents.state == 1: # state = 1 means "active", so idle is not a valid state
|
||||||
return 3600 * 100 * 1000 # If screen saver is active, return a high enough value
|
return 3600 * 100 * 1000 # If screen saver is active, return a high enough value
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ from uds.REST.methods.client import CLIENT_VERSION
|
|||||||
from uds.core.managers import downloadsManager
|
from uds.core.managers import downloadsManager
|
||||||
from uds.core.util.config import GlobalConfig
|
from uds.core.util.config import GlobalConfig
|
||||||
from uds.core import VERSION, VERSION_STAMP
|
from uds.core import VERSION, VERSION_STAMP
|
||||||
from uds.models import Authenticator, Image
|
from uds.models import Authenticator, Image, Network, Transport
|
||||||
|
|
||||||
# Not imported at runtime, just for type checking
|
# Not imported at runtime, just for type checking
|
||||||
if typing.TYPE_CHECKING:
|
if typing.TYPE_CHECKING:
|
||||||
@ -136,6 +136,17 @@ def udsJs(request: 'HttpRequest') -> str:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if request.user and request.user.isStaff():
|
||||||
|
info = {
|
||||||
|
'networks': [n.name for n in Network.networksFor(request.ip)],
|
||||||
|
'transports': [t.name for t in Transport.objects.all() if t.validForIp(request.ip)],
|
||||||
|
'ip': request.ip,
|
||||||
|
'ip_proxy': request.ip_proxy
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
info = None
|
||||||
|
|
||||||
|
|
||||||
# all plugins are under url clients...
|
# all plugins are under url clients...
|
||||||
plugins = [
|
plugins = [
|
||||||
{
|
{
|
||||||
@ -176,6 +187,7 @@ def udsJs(request: 'HttpRequest') -> str:
|
|||||||
uds = {
|
uds = {
|
||||||
'profile': profile,
|
'profile': profile,
|
||||||
'config': config,
|
'config': config,
|
||||||
|
'info': info,
|
||||||
'plugins': plugins,
|
'plugins': plugins,
|
||||||
'actors': actors,
|
'actors': actors,
|
||||||
'errors': errors,
|
'errors': errors,
|
||||||
|
Loading…
Reference in New Issue
Block a user