Unverified Commit 9c6826ea authored by BaiJiangJie's avatar BaiJiangJie Committed by GitHub

Merge pull request #228 from jumpserver/user_format

[update] 修改session和ftp上传用户字段为:name (username)
parents 3d721c49 29981937
......@@ -128,7 +128,8 @@ class Session:
"org_id": self.server.asset.org_id,
"input": _input,
"output": _output,
"user": self.client.user.username,
"user": "{} ({})".format(self.client.user.name,
self.client.user.username),
"asset": self.server.asset.hostname,
"system_user": self.server.system_user.username,
"timestamp": time.time(),
......@@ -226,7 +227,8 @@ class Session:
def to_json(self):
return {
"id": self.id,
"user": self.client.user.username,
"user": "{} ({})".format(self.client.user.name,
self.client.user.username),
"asset": self.server.asset.hostname,
"org_id": self.server.asset.org_id,
"system_user": self.server.system_user.username,
......
......@@ -185,7 +185,8 @@ class SFTPServer(paramiko.SFTPServerInterface):
asset = self.hosts.get(host)['asset']
date_start = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + " +0000",
data = {
"user": self.server.connection.user.username,
"user": "{} ({})".format(self.server.connection.user.name,
self.server.connection.user.username),
"asset": host,
"org_id": asset.org_id,
"system_user": su,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment