|
|
@ -75,8 +75,8 @@ func tryLogin(w http.ResponseWriter, r *http.Request) { |
|
|
|
func usePassword(user string, pass string, ip string) bool { |
|
|
|
func usePassword(user string, pass string, ip string) bool { |
|
|
|
defer log.PanicSafe() |
|
|
|
defer log.PanicSafe() |
|
|
|
log.LogInfo("%+v", toks) |
|
|
|
log.LogInfo("%+v", toks) |
|
|
|
tok := toks[user] |
|
|
|
tok := toks[strings.ToUpper(user)] |
|
|
|
delete(toks, user) |
|
|
|
delete(toks, strings.ToUpper(user)) |
|
|
|
if tok.IP != ip { |
|
|
|
if tok.IP != ip { |
|
|
|
log.LogWarn(fmt.Sprintf("%s attempted to use an improper IP.", user)) |
|
|
|
log.LogWarn(fmt.Sprintf("%s attempted to use an improper IP.", user)) |
|
|
|
return false |
|
|
|
return false |
|
|
@ -114,7 +114,7 @@ func sendPassword(user string, ipaddr string) { |
|
|
|
log.LogErrorType(err) |
|
|
|
log.LogErrorType(err) |
|
|
|
} |
|
|
|
} |
|
|
|
now := time.Now() |
|
|
|
now := time.Now() |
|
|
|
toks[m.Nick] = Tokens{ |
|
|
|
toks[strings.ToUpper(m.Nick)] = Tokens{ |
|
|
|
Username: user, |
|
|
|
Username: user, |
|
|
|
IP: ipaddr, |
|
|
|
IP: ipaddr, |
|
|
|
Password: str, |
|
|
|
Password: str, |
|
|
|