Commit 0fdb5372 authored by Eric's avatar Eric

[update] change user string format

parent fc06304e
...@@ -176,7 +176,7 @@ func (fs *sftpHandler) Filecmd(r *sftp.Request) (err error) { ...@@ -176,7 +176,7 @@ func (fs *sftpHandler) Filecmd(r *sftp.Request) (err error) {
} }
realPathName := suDir.ParsePath(r.Filepath) realPathName := suDir.ParsePath(r.Filepath)
logData := &model.FTPLog{ logData := &model.FTPLog{
User: fs.user.Username, User: fmt.Sprintf("%s(%s)",fs.user.Name,fs.user.Username),
Hostname: hostDir.asset.Hostname, Hostname: hostDir.asset.Hostname,
OrgID: hostDir.asset.OrgID, OrgID: hostDir.asset.OrgID,
SystemUser: suDir.systemUser.Name, SystemUser: suDir.systemUser.Name,
...@@ -236,7 +236,7 @@ func (fs *sftpHandler) Filewrite(r *sftp.Request) (io.WriterAt, error) { ...@@ -236,7 +236,7 @@ func (fs *sftpHandler) Filewrite(r *sftp.Request) (io.WriterAt, error) {
} }
realPathName := suDir.ParsePath(r.Filepath) realPathName := suDir.ParsePath(r.Filepath)
logData := &model.FTPLog{ logData := &model.FTPLog{
User: fs.user.Username, User: fmt.Sprintf("%s(%s)",fs.user.Name,fs.user.Username),
Hostname: hostDir.asset.Hostname, Hostname: hostDir.asset.Hostname,
OrgID: hostDir.asset.OrgID, OrgID: hostDir.asset.OrgID,
SystemUser: suDir.systemUser.Name, SystemUser: suDir.systemUser.Name,
...@@ -275,7 +275,7 @@ func (fs *sftpHandler) Fileread(r *sftp.Request) (io.ReaderAt, error) { ...@@ -275,7 +275,7 @@ func (fs *sftpHandler) Fileread(r *sftp.Request) (io.ReaderAt, error) {
} }
realPathName := suDir.ParsePath(r.Filepath) realPathName := suDir.ParsePath(r.Filepath)
logData := &model.FTPLog{ logData := &model.FTPLog{
User: fs.user.Username, User: fmt.Sprintf("%s(%s)",fs.user.Name,fs.user.Username),
Hostname: hostDir.asset.Hostname, Hostname: hostDir.asset.Hostname,
OrgID: hostDir.asset.OrgID, OrgID: hostDir.asset.OrgID,
SystemUser: suDir.systemUser.Name, SystemUser: suDir.systemUser.Name,
......
...@@ -280,7 +280,7 @@ func (u *UserVolume) GetFile(path string) (reader io.ReadCloser, err error) { ...@@ -280,7 +280,7 @@ func (u *UserVolume) GetFile(path string) (reader io.ReadCloser, err error) {
} }
logData := &model.FTPLog{ logData := &model.FTPLog{
User: u.user.Username, User: fmt.Sprintf("%s(%s)",u.user.Name,u.user.Username),
Hostname: hostVol.asset.Hostname, Hostname: hostVol.asset.Hostname,
OrgID: hostVol.asset.OrgID, OrgID: hostVol.asset.OrgID,
SystemUser: sysUserVol.systemUser.Name, SystemUser: sysUserVol.systemUser.Name,
...@@ -356,7 +356,7 @@ func (u *UserVolume) UploadFile(dir, filename string, reader io.Reader) (elfinde ...@@ -356,7 +356,7 @@ func (u *UserVolume) UploadFile(dir, filename string, reader io.Reader) (elfinde
defer fd.Close() defer fd.Close()
logData := &model.FTPLog{ logData := &model.FTPLog{
User: u.user.Username, User: fmt.Sprintf("%s(%s)",u.user.Name,u.user.Username),
Hostname: hostVol.asset.Hostname, Hostname: hostVol.asset.Hostname,
OrgID: hostVol.asset.OrgID, OrgID: hostVol.asset.OrgID,
SystemUser: sysUserVol.systemUser.Name, SystemUser: sysUserVol.systemUser.Name,
...@@ -448,7 +448,7 @@ func (u *UserVolume) MergeChunk(cid, total int, dirPath, filename string) (elfin ...@@ -448,7 +448,7 @@ func (u *UserVolume) MergeChunk(cid, total int, dirPath, filename string) (elfin
} }
filenamePath := filepath.Join(realDirPath, filename) filenamePath := filepath.Join(realDirPath, filename)
logData := &model.FTPLog{ logData := &model.FTPLog{
User: u.user.Username, User: fmt.Sprintf("%s(%s)",u.user.Name,u.user.Username),
Hostname: hostVol.asset.Hostname, Hostname: hostVol.asset.Hostname,
OrgID: hostVol.asset.OrgID, OrgID: hostVol.asset.OrgID,
SystemUser: sysUserVol.systemUser.Name, SystemUser: sysUserVol.systemUser.Name,
...@@ -548,7 +548,7 @@ func (u *UserVolume) MakeDir(dir, newDirname string) (elfinder.FileDir, error) { ...@@ -548,7 +548,7 @@ func (u *UserVolume) MakeDir(dir, newDirname string) (elfinder.FileDir, error) {
realDirPath := filepath.Join(realPath, newDirname) realDirPath := filepath.Join(realPath, newDirname)
err := sysUserVol.client.MkdirAll(realDirPath) err := sysUserVol.client.MkdirAll(realDirPath)
logData := &model.FTPLog{ logData := &model.FTPLog{
User: u.user.Username, User: fmt.Sprintf("%s(%s)",u.user.Name,u.user.Username),
Hostname: hostVol.asset.Hostname, Hostname: hostVol.asset.Hostname,
OrgID: hostVol.asset.OrgID, OrgID: hostVol.asset.OrgID,
SystemUser: sysUserVol.systemUser.Name, SystemUser: sysUserVol.systemUser.Name,
...@@ -617,7 +617,7 @@ func (u *UserVolume) MakeFile(dir, newFilename string) (elfinder.FileDir, error) ...@@ -617,7 +617,7 @@ func (u *UserVolume) MakeFile(dir, newFilename string) (elfinder.FileDir, error)
realFilePath := filepath.Join(realPath, newFilename) realFilePath := filepath.Join(realPath, newFilename)
_, err := sysUserVol.client.Create(realFilePath) _, err := sysUserVol.client.Create(realFilePath)
logData := &model.FTPLog{ logData := &model.FTPLog{
User: u.user.Username, User: fmt.Sprintf("%s(%s)",u.user.Name,u.user.Username),
Hostname: hostVol.asset.Hostname, Hostname: hostVol.asset.Hostname,
OrgID: hostVol.asset.OrgID, OrgID: hostVol.asset.OrgID,
SystemUser: sysUserVol.systemUser.Name, SystemUser: sysUserVol.systemUser.Name,
...@@ -682,7 +682,7 @@ func (u *UserVolume) Rename(oldNamePath, newName string) (elfinder.FileDir, erro ...@@ -682,7 +682,7 @@ func (u *UserVolume) Rename(oldNamePath, newName string) (elfinder.FileDir, erro
err := sysUserVol.client.Rename(oldNamePath, newFilePath) err := sysUserVol.client.Rename(oldNamePath, newFilePath)
logData := &model.FTPLog{ logData := &model.FTPLog{
User: u.user.Username, User: fmt.Sprintf("%s(%s)",u.user.Name,u.user.Username),
Hostname: hostVol.asset.Hostname, Hostname: hostVol.asset.Hostname,
OrgID: hostVol.asset.OrgID, OrgID: hostVol.asset.OrgID,
SystemUser: sysUserVol.systemUser.Name, SystemUser: sysUserVol.systemUser.Name,
...@@ -748,7 +748,7 @@ func (u *UserVolume) Remove(path string) error { ...@@ -748,7 +748,7 @@ func (u *UserVolume) Remove(path string) error {
} }
logData := &model.FTPLog{ logData := &model.FTPLog{
User: u.user.Username, User: fmt.Sprintf("%s(%s)",u.user.Name,u.user.Username),
Hostname: hostVol.asset.Hostname, Hostname: hostVol.asset.Hostname,
OrgID: hostVol.asset.OrgID, OrgID: hostVol.asset.OrgID,
SystemUser: sysUserVol.systemUser.Name, SystemUser: sysUserVol.systemUser.Name,
...@@ -819,7 +819,7 @@ func (u *UserVolume) Paste(dir, filename, suffix string, reader io.ReadCloser) ( ...@@ -819,7 +819,7 @@ func (u *UserVolume) Paste(dir, filename, suffix string, reader io.ReadCloser) (
realFilePath += suffix realFilePath += suffix
} }
logData := &model.FTPLog{ logData := &model.FTPLog{
User: u.user.Username, User: fmt.Sprintf("%s(%s)",u.user.Name,u.user.Username),
Hostname: hostVol.asset.Hostname, Hostname: hostVol.asset.Hostname,
OrgID: hostVol.asset.OrgID, OrgID: hostVol.asset.OrgID,
SystemUser: sysUserVol.systemUser.Name, SystemUser: sysUserVol.systemUser.Name,
......
...@@ -192,7 +192,7 @@ func (s *SwitchSession) MapData() map[string]interface{} { ...@@ -192,7 +192,7 @@ func (s *SwitchSession) MapData() map[string]interface{} {
} }
return map[string]interface{}{ return map[string]interface{}{
"id": s.ID, "id": s.ID,
"user": s.p.User.Username, "user": fmt.Sprintf("%s(%s)",s.p.User.Name,s.p.User.Username),
"asset": s.p.Asset.Hostname, "asset": s.p.Asset.Hostname,
"org_id": s.p.Asset.OrgID, "org_id": s.p.Asset.OrgID,
"login_from": s.p.UserConn.LoginFrom(), "login_from": s.p.UserConn.LoginFrom(),
......
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