From 62ffbccedad6efa37d39ac7b200519249f71fe43 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Mon, 8 Feb 2016 19:50:21 -0600 Subject: [PATCH] Added check on email open to avoid overwriting the click/data submit events. Fixes #119 --- controllers/route.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/controllers/route.go b/controllers/route.go index 78a466e7..6f2e2dae 100644 --- a/controllers/route.go +++ b/controllers/route.go @@ -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)