Pushing to deploy new backend notifications

This commit is contained in:
Rick Falkvinge
2015-01-29 12:37:20 +01:00
parent 2ada0a944b
commit cf877e84f3
4 changed files with 29 additions and 9 deletions
@@ -379,9 +379,9 @@ namespace Swarmops.Logic.App_GlobalResources {
}
/// <summary>
/// Looks up a localized string similar to Somebody, most likely you, requested a reset of the password associated with this email address at [OrganizationName]. However, two-factor authentication has been enabled for this account for heightened security. Therefore, the password CANNOT be reset by simple means.
/// Looks up a localized string similar to Somebody, most likely you, requested a reset of the password associated with this mail address at [InstallationName]. However, two-factor authentication has been enabled for this account for heightened security. Therefore, the password CANNOT be reset by simple means.
///
///Please contact a personnel administrator at [OrganizationName] to resolve your problem and issue a new password following a more rigorous identification procedure matching the two-factor security level.
///Please contact a personnel administrator at [InstallationName] to resolve your problem and issue a new password following a more rigorous identification procedure matching the two-factor security level.
///
///Thank you for your understanding..
/// </summary>
@@ -392,7 +392,7 @@ namespace Swarmops.Logic.App_GlobalResources {
}
/// <summary>
/// Looks up a localized string similar to [[OrganizationName]] Cannot Reset Password.
/// Looks up a localized string similar to [[InstallationName]] Cannot Reset Password.
/// </summary>
internal static string Password_CannotReset2FA_Subject {
get {
@@ -244,14 +244,14 @@ Time spent transmitting: [TransmissionTime].</value>
<value>[[OrganizationName]] Comms transmitted: [GeographyName]</value>
</data>
<data name="Password_CannotReset2FA_Body" xml:space="preserve">
<value>Somebody, most likely you, requested a reset of the password associated with this email address at [OrganizationName]. However, two-factor authentication has been enabled for this account for heightened security. Therefore, the password CANNOT be reset by simple means.
<value>Somebody, most likely you, requested a reset of the password associated with this mail address at [InstallationName]. However, two-factor authentication has been enabled for this account for heightened security. Therefore, the password CANNOT be reset by simple means.
Please contact a personnel administrator at [OrganizationName] to resolve your problem and issue a new password following a more rigorous identification procedure matching the two-factor security level.
Please contact a personnel administrator at [InstallationName] to resolve your problem and issue a new password following a more rigorous identification procedure matching the two-factor security level.
Thank you for your understanding.</value>
</data>
<data name="Password_CannotReset2FA_Subject" xml:space="preserve">
<value>[[OrganizationName]] Cannot Reset Password</value>
<value>[[InstallationName]] Cannot Reset Password</value>
</data>
<data name="Password_Changed_Body" xml:space="preserve">
<value>Your [InstallationName] password was changed at [ExternalUrl].
+1 -1
View File
@@ -259,7 +259,7 @@ namespace Swarmops.Logic.Communications
}
public static OutboundComm CreateSecurityNotifcation (Person concernedPerson, Person actingPerson, Organization organization, string ticket,
public static OutboundComm CreateSecurityNotification (Person concernedPerson, Person actingPerson, Organization organization, string ticket,
NotificationResource notification)
{
NotificationPayload payload = new NotificationPayload(notification.ToString());
+22 -2
View File
@@ -1,10 +1,14 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using Swarmops.Logic.Communications;
using Swarmops.Logic.Communications.Transmission;
using Swarmops.Logic.Support;
using Swarmops.Logic.Swarm;
@@ -52,12 +56,28 @@ namespace Swarmops.Pages.Security
People concernedPeople = People.FromMail (mailAddress); // Should result in exactly 1
if (concernedPeople.Count != 1)
{
return true; // TODO: Prevent registration with duplicate mail addy, or this will cause problems down the road
}
Person concernedPerson = concernedPeople[0];
if (!string.IsNullOrEmpty (concernedPerson.BitIdAddress))
{
// Cannot reset password - two factor auth is enabled. Manual intervention required.
OutboundComm.CreateSecurityNotification (concernedPerson, null, null, string.Empty,
NotificationResource.Password_CannotReset2FA);
}
string resetTicket = SupportFunctions.GenerateSecureRandomKey (16); // 16 bytes = 128 bits random key, more than good enough
concernedPerson.ResetPasswordTicket = DateTime.UtcNow.AddHours (1).ToString(CultureInfo.InvariantCulture) + "," + resetTicket; // Adds expiry - one hour
Outbound
OutboundComm.CreateSecurityNotification (concernedPerson, null, null, resetTicket,
NotificationResource.Password_ResetOnRequest);
// Create log entry