forked from shaba/openuds
Added computername to actortoken db
This commit is contained in:
parent
d6691a4098
commit
52335b6e31
@ -115,6 +115,7 @@ class UDSConfigDialog(QDialog):
|
|||||||
self.ui.authenticators.currentData().auth,
|
self.ui.authenticators.currentData().auth,
|
||||||
self.ui.username.text(),
|
self.ui.username.text(),
|
||||||
self.ui.password.text(),
|
self.ui.password.text(),
|
||||||
|
udsactor.operations.getComputerName(),
|
||||||
data.ip or '', # IP
|
data.ip or '', # IP
|
||||||
data.mac or '', # MAC
|
data.mac or '', # MAC
|
||||||
self.ui.preCommand.text(),
|
self.ui.preCommand.text(),
|
||||||
|
@ -137,11 +137,12 @@ class REST:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def register( #pylint: disable=too-many-arguments
|
def register( #pylint: disable=too-many-arguments, too-many-locals
|
||||||
self,
|
self,
|
||||||
auth: str,
|
auth: str,
|
||||||
username: str,
|
username: str,
|
||||||
password: str,
|
password: str,
|
||||||
|
hostname: str,
|
||||||
ip: str,
|
ip: str,
|
||||||
mac: str,
|
mac: str,
|
||||||
preCommand: str,
|
preCommand: str,
|
||||||
@ -154,6 +155,7 @@ class REST:
|
|||||||
"""
|
"""
|
||||||
data = {
|
data = {
|
||||||
'username': username,
|
'username': username,
|
||||||
|
'hostname': hostname,
|
||||||
'ip': ip,
|
'ip': ip,
|
||||||
'mac': mac,
|
'mac': mac,
|
||||||
'pre_command': preCommand,
|
'pre_command': preCommand,
|
||||||
|
@ -37,7 +37,7 @@ import typing
|
|||||||
from uds.models import getSqlDatetimeAsUnix, getSqlDatetime, ActorToken
|
from uds.models import getSqlDatetimeAsUnix, getSqlDatetime, ActorToken
|
||||||
|
|
||||||
from uds.core import VERSION
|
from uds.core import VERSION
|
||||||
from ..handlers import Handler, NotFound
|
from ..handlers import Handler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -87,6 +87,7 @@ class ActorV2Register(ActorV2Action):
|
|||||||
# Update parameters
|
# Update parameters
|
||||||
actorToken.ip_from = self._request.ip
|
actorToken.ip_from = self._request.ip
|
||||||
actorToken.ip = self._params['ip']
|
actorToken.ip = self._params['ip']
|
||||||
|
actorToken.hostname = self._params['hostname']
|
||||||
actorToken.pre_command = self._params['pre_command']
|
actorToken.pre_command = self._params['pre_command']
|
||||||
actorToken.post_command = self._params['post_command']
|
actorToken.post_command = self._params['post_command']
|
||||||
actorToken.runonce_command = self._params['run_once_command']
|
actorToken.runonce_command = self._params['run_once_command']
|
||||||
@ -98,6 +99,7 @@ class ActorV2Register(ActorV2Action):
|
|||||||
username=self._params['username'],
|
username=self._params['username'],
|
||||||
ip_from=self._request.ip,
|
ip_from=self._request.ip,
|
||||||
ip=self._params['ip'],
|
ip=self._params['ip'],
|
||||||
|
hostname=self._params['hostname'],
|
||||||
mac=self._params['mac'],
|
mac=self._params['mac'],
|
||||||
pre_command=self._params['pre_command'],
|
pre_command=self._params['pre_command'],
|
||||||
post_command=self._params['post_command'],
|
post_command=self._params['post_command'],
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 2.2.7 on 2019-11-21 12:22
|
# Generated by Django 2.2.7 on 2019-11-22 10:54
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
@ -17,6 +17,7 @@ class Migration(migrations.Migration):
|
|||||||
('username', models.CharField(max_length=128)),
|
('username', models.CharField(max_length=128)),
|
||||||
('ip_from', models.CharField(max_length=128)),
|
('ip_from', models.CharField(max_length=128)),
|
||||||
('ip', models.CharField(max_length=128)),
|
('ip', models.CharField(max_length=128)),
|
||||||
|
('hostname', models.CharField(max_length=128)),
|
||||||
('mac', models.CharField(db_index=True, max_length=128, unique=True)),
|
('mac', models.CharField(db_index=True, max_length=128, unique=True)),
|
||||||
('pre_command', models.CharField(blank=True, default='', max_length=255)),
|
('pre_command', models.CharField(blank=True, default='', max_length=255)),
|
||||||
('post_command', models.CharField(blank=True, default='', max_length=255)),
|
('post_command', models.CharField(blank=True, default='', max_length=255)),
|
||||||
|
@ -37,6 +37,7 @@ class ActorToken(models.Model):
|
|||||||
username = models.CharField(max_length=128)
|
username = models.CharField(max_length=128)
|
||||||
ip_from = models.CharField(max_length=128)
|
ip_from = models.CharField(max_length=128)
|
||||||
ip = models.CharField(max_length=128)
|
ip = models.CharField(max_length=128)
|
||||||
|
hostname = models.CharField(max_length=128)
|
||||||
mac = models.CharField(max_length=128, db_index=True, unique=True)
|
mac = models.CharField(max_length=128, db_index=True, unique=True)
|
||||||
pre_command = models.CharField(max_length=255, blank=True, default='')
|
pre_command = models.CharField(max_length=255, blank=True, default='')
|
||||||
post_command = models.CharField(max_length=255, blank=True, default='')
|
post_command = models.CharField(max_length=255, blank=True, default='')
|
||||||
|
Loading…
Reference in New Issue
Block a user