Added check on email open to avoid overwriting the click/data submit events. Fixes #119

pull/138/head
Jordan Wright 2016-02-08 19:50:21 -06:00
parent a0a8a7b8ad
commit 62ffbcceda
1 changed files with 6 additions and 0 deletions

View File

@ -102,6 +102,12 @@ func PhishTracker(w http.ResponseWriter, r *http.Request) {
Logger.Println(err)
}
c.AddEvent(models.Event{Email: rs.Email, Message: models.EVENT_OPENED})
// Don't update the status if the user already clicked the link
// or submitted data to the campaign
if rs.Status == models.STATUS_SUCCESS {
w.Write([]byte(""))
return
}
err = rs.UpdateStatus(models.EVENT_OPENED)
if err != nil {
Logger.Println(err)