From 21b64beb96264dfbee8b3c855effe87f7aeb5d12 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Wed, 3 Jul 2024 21:53:45 +0200 Subject: tgbot - login notify (show password for failed login) --- web/service/tgbot.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'web/service') diff --git a/web/service/tgbot.go b/web/service/tgbot.go index 0880faaa..c1fd79fe 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -1019,7 +1019,7 @@ func (t *Tgbot) prepareServerUsageInfo() string { return info } -func (t *Tgbot) UserLoginNotify(username string, ip string, time string, status LoginStatus) { +func (t *Tgbot) UserLoginNotify(username string, password string, ip string, time string, status LoginStatus) { if !t.IsRunning() { return } @@ -1037,11 +1037,12 @@ func (t *Tgbot) UserLoginNotify(username string, ip string, time string, status msg := "" if status == LoginSuccess { msg += t.I18nBot("tgbot.messages.loginSuccess") + msg += t.I18nBot("tgbot.messages.hostname", "Hostname=="+hostname) } else if status == LoginFail { msg += t.I18nBot("tgbot.messages.loginFailed") + msg += t.I18nBot("tgbot.messages.hostname", "Hostname=="+hostname) + msg += t.I18nBot("tgbot.messages.password", "Password=="+password) } - - msg += t.I18nBot("tgbot.messages.hostname", "Hostname=="+hostname) msg += t.I18nBot("tgbot.messages.username", "Username=="+username) msg += t.I18nBot("tgbot.messages.ip", "IP=="+ip) msg += t.I18nBot("tgbot.messages.time", "Time=="+time) -- cgit v1.2.3