|
|
|
@ -12,9 +12,18 @@ import (
@@ -12,9 +12,18 @@ import (
|
|
|
|
|
|
|
|
|
|
func reqPass(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
username := r.FormValue("UserName") |
|
|
|
|
var userID string |
|
|
|
|
g, err := dg.State.Guild(config.GuildID) |
|
|
|
|
if err == nil { |
|
|
|
|
for _, m := range g.Members { |
|
|
|
|
if m.User.Username == "johndoe" { |
|
|
|
|
userID = m.User.ID |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
ipaddr := r.Header.Get("X-Real-IP") |
|
|
|
|
log.LogInfo(fmt.Sprintf("reqPass called:```username: %s\nip : %s```", username, ipaddr)) |
|
|
|
|
sendPassword(username, ipaddr) |
|
|
|
|
go sendPassword(userID, ipaddr) |
|
|
|
|
http.Redirect(w, r, "/login", 302) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|