From c5506fc9f9efcf960cced980230d6c038b226f1a Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 13 Apr 2017 09:54:37 -0400 Subject: [PATCH] Move email IP to audit summary --- Project-Unite/App_Start/IdentityConfig.cs | 2 +- Project-Unite/Controllers/AccountController.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Project-Unite/App_Start/IdentityConfig.cs b/Project-Unite/App_Start/IdentityConfig.cs index 30d7211..a317e22 100644 --- a/Project-Unite/App_Start/IdentityConfig.cs +++ b/Project-Unite/App_Start/IdentityConfig.cs @@ -41,7 +41,7 @@ public async Task SendAsync(IdentityMessage message) sMsg.IsBodyHtml = true; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; var db = new ApplicationDbContext(); - db.AuditLogs.Add(new AuditLog("system", AuditLogLevel.Admin, $"Email sending...

To: {sMsg.To}
Subject:
{sMsg.Subject}")); + db.AuditLogs.Add(new AuditLog("system", AuditLogLevel.Admin, $"Email sending...

To: {sMsg.To}
Subject:
{sMsg.Subject}
Invoker IP:{HttpContext.Current.Request.UserHostAddress}")); db.SaveChanges(); smtp.SendCompleted += async (o, a) => { diff --git a/Project-Unite/Controllers/AccountController.cs b/Project-Unite/Controllers/AccountController.cs index a315a6f..729bcec 100644 --- a/Project-Unite/Controllers/AccountController.cs +++ b/Project-Unite/Controllers/AccountController.cs @@ -71,11 +71,10 @@ await UserManager.SendEmailAsync(uid, "Confirm your account", $@"### Please conf **If this was not you**: -The addressed used to send this message is not a no-reply address. In fact, my name is Michael, admin of the site. We may have a bit of an identity theft issue, or something, going on here, but there's something I can do to help - all you have to do is reply to this email. I have the IP address, display name and ID of the user who triggered this email - just let me know and I can purge the account for you and ban the user's IP address and you won't have issues anymore. Thanks! +The address used to send this message is not a no-reply address. In fact, my name is Michael, admin of the site. We may have a bit of an identity theft issue, or something, going on here, but there's something I can do to help - all you have to do is reply to this email. I have the IP address, display name and ID of the user who triggered this email - just let me know and I can purge the account for you and ban the user's IP address and you won't have issues anymore. Thanks! **User ID:** {uid} -**Display name:** {usr.DisplayName} -**Last known IP address:** {usr.LastKnownIPAddress}"); +**Display name:** {usr.DisplayName}"); return View(); }