Merge pull request #138 from gophish/119-stick-result-status

Avoid Overwriting Click/Data Submit Event. Fixes #119
pull/140/head
Jordan Wright 2016-02-08 19:54:44 -06:00
commit 5e11895c23
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) Logger.Println(err)
} }
c.AddEvent(models.Event{Email: rs.Email, Message: models.EVENT_OPENED}) 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) err = rs.UpdateStatus(models.EVENT_OPENED)
if err != nil { if err != nil {
Logger.Println(err) Logger.Println(err)