예제 #1
0
        public static void InvalidLoginAttempt(LoginSecurityException lsecex)
        {
            // Get the email and set the subject
            Email email = NotifyEngine.GetEmailTemplate("Admin.InvalidUserLoginAttempt");

            email.Subject = NotifyEngine.GetSubject("User login failed");

            // Add all superadmins to the recipient list
            AddSuperAdminsToEmailList(email.Recipients);

            // Ensure that we have at least one super admin to receive the message
            if (email.Recipients.Count == 0)
            {
                m_Logger.Error("InvalidLoginAttempt() - No active super admins exist to receive notification");
                return;
            }

            // Construct the link to the 'Edit User' page
            string url = SiteUtils.GetWebsiteUrl(string.Format("~/Go.ashx/EUA/U{0}/", lsecex.Entity.UserId));

            // Add body parameters
            email.AddBodyParameter("message", lsecex.Message);
            email.AddBodyParameter("user-name", lsecex.Entity.FullName);
            email.AddBodyParameter("user-email", lsecex.Entity.Email);
            email.AddBodyParameter("user-ip-address", lsecex.IpAddress);
            email.AddBodyParameter("url", url);

            // Send it
            NotifyEngine.SendMessage(email);
        }
예제 #2
0
 public static void InvalidLoginAttempt(LoginSecurityException lsecex)
 {
     NotifyAdmin.InvalidLoginAttempt(lsecex);
 }