From d7107ed8f6b530dd86ed7c2f87ae59d4052f7804 Mon Sep 17 00:00:00 2001 From: Falkvinge Date: Tue, 22 Nov 2016 19:12:43 +0100 Subject: [PATCH] Work on BitId enabling --- Site/App_GlobalResources/Global.designer.cs | 11 +++++++++- Site/App_GlobalResources/Global.resx | 5 ++++- Site/Automation/SwarmFunctions.aspx.cs | 16 ++++++++++++-- Site/Master-v5.master | 24 ++++++++++++++++++--- Site/Master-v5.master.designer.cs | 9 ++++++++ 5 files changed, 58 insertions(+), 7 deletions(-) diff --git a/Site/App_GlobalResources/Global.designer.cs b/Site/App_GlobalResources/Global.designer.cs index 37ba9f54..ad6c6598 100644 --- a/Site/App_GlobalResources/Global.designer.cs +++ b/Site/App_GlobalResources/Global.designer.cs @@ -1573,7 +1573,7 @@ namespace Resources { } /// - /// Looks up a localized string similar to <strong>PASSWORD CHANGED</strong><br/><br/>You have successfully changed your password. As a security measure, all withdrawals are now in quarantine for the next 48 hours.<br/><br/>If you can, please enable BitID two-factor authentication.. + /// Looks up a localized string similar to <strong>PASSWORD CHANGED</strong><br/><br/>You have successfully changed your password. As a security measure, all withdrawals are now in quarantine for the next 48 hours.. /// internal static string Master_EditPersonNewPassword_Changed { get { @@ -1653,6 +1653,15 @@ namespace Resources { } } + /// + /// Looks up a localized string similar to If you can, please enable BitID two-factor authentication.. + /// + internal static string Master_EditPerson_PleaseEnable2FA { + get { + return ResourceManager.GetString("Master_EditPerson_PleaseEnable2FA", resourceCulture); + } + } + /// /// Looks up a localized string similar to You are currently logged into <strong>{0}</strong>. Would you like to switch to another organization?. /// diff --git a/Site/App_GlobalResources/Global.resx b/Site/App_GlobalResources/Global.resx index cd006cd1..568a6b2e 100644 --- a/Site/App_GlobalResources/Global.resx +++ b/Site/App_GlobalResources/Global.resx @@ -823,6 +823,9 @@ Unable to set new password: The new password is too weak. Use a stronger password. - <strong>PASSWORD CHANGED</strong><br/><br/>You have successfully changed your password. As a security measure, all withdrawals are now in quarantine for the next 48 hours.<br/><br/>If you can, please enable BitID two-factor authentication. + <strong>PASSWORD CHANGED</strong><br/><br/>You have successfully changed your password. As a security measure, all withdrawals are now in quarantine for the next 48 hours. + + + If you can, please enable BitID two-factor authentication. \ No newline at end of file diff --git a/Site/Automation/SwarmFunctions.aspx.cs b/Site/Automation/SwarmFunctions.aspx.cs index 28ee391a..76010a2d 100644 --- a/Site/Automation/SwarmFunctions.aspx.cs +++ b/Site/Automation/SwarmFunctions.aspx.cs @@ -225,6 +225,10 @@ namespace Swarmops.Frontend.Automation public string Phone { get; set; } public string TwitterId { get; set; } + // Security tab + + public bool TwoFactorActive { get; set; } + // Accounts tab // (no data) @@ -259,7 +263,8 @@ namespace Swarmops.Frontend.Automation Name = person.Name, Mail = person.Mail, Phone = person.Phone, - TwitterId = person.TwitterId + TwitterId = person.TwitterId, + TwoFactorActive = !string.IsNullOrEmpty(person.BitIdAddress) }; } @@ -453,10 +458,17 @@ namespace Swarmops.Frontend.Automation // TODO: NOTIFY authData.CurrentUser.Quarantines.Withdrawal.QuarantineFor(new TimeSpan(2, 0, 0, 0)); // Quarantine for two days + string displayMessage = Resources.Global.Master_EditPersonNewPassword_Changed; + + if (string.IsNullOrEmpty(authData.CurrentUser.BitIdAddress)) + { + displayMessage += @"

" + Resources.Global.Master_EditPerson_PleaseEnable2FA; + } + return new AjaxCallResult { Success = true, - DisplayMessage = Resources.Global.Master_EditPersonNewPassword_Changed + DisplayMessage = displayMessage }; } } diff --git a/Site/Master-v5.master b/Site/Master-v5.master index d27d8bb9..0a395f3d 100644 --- a/Site/Master-v5.master +++ b/Site/Master-v5.master @@ -18,7 +18,8 @@ - + + @@ -249,7 +250,7 @@

PERSONNAME:

​
-