diff --git a/Site/App_GlobalResources/Global.designer.cs b/Site/App_GlobalResources/Global.designer.cs
index 52b36054..cbbfcb8c 100644
--- a/Site/App_GlobalResources/Global.designer.cs
+++ b/Site/App_GlobalResources/Global.designer.cs
@@ -1455,6 +1455,51 @@ namespace Resources {
}
}
+ ///
+ /// Looks up a localized string similar to <strong>CANNOT PROVISION 2FA</strong><br/><br/>You cannot turn on two-factor authentication for someone else. They must do it by themselves, thereby being alone in having their secret keys..
+ ///
+ internal static string Master_EditPerson2FAEnable_CannotProvision {
+ get {
+ return ResourceManager.GetString("Master_EditPerson2FAEnable_CannotProvision", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Two-factor authentication has been disabled. You must now log in with a regular password..
+ ///
+ internal static string Master_EditPerson2FAEnable_ConfirmingRemovedOwn {
+ get {
+ return ResourceManager.GetString("Master_EditPerson2FAEnable_ConfirmingRemovedOwn", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Two-factor authentication was removed for this user. They must now log in with a regular password..
+ ///
+ internal static string Master_EditPerson2FAEnable_ConfirmingRemovedProvision {
+ get {
+ return ResourceManager.GetString("Master_EditPerson2FAEnable_ConfirmingRemovedProvision", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to <strong>DISABLE TWO-FACTOR AUTHENTICATION?</strong><br/><br/>This is not recommended. Two-factor authentication significantly raises the security of your account, in addition to making it much easier to log in if you're using BitID.<br/><br/>Remove 2FA and fall back to password-only authentication?.
+ ///
+ internal static string Master_EditPerson2FAEnable_ConfirmRemoveOwn {
+ get {
+ return ResourceManager.GetString("Master_EditPerson2FAEnable_ConfirmRemoveOwn", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to <strong>REMOVE TWO-FACTOR AUTHENTICATION?</strong><br/><br/>Only do this if you have been requested to turn off 2FA for this user, by this user themselves, <strong>and</strong> you are absolutely, positively sure that the request came from the person whose security you are disabling (as per the verification policy of the organization).<br/><br/>Proceed with removing this user's security? They will fall back to password-only security..
+ ///
+ internal static string Master_EditPerson2FAEnable_ConfirmRemoveProvision {
+ get {
+ return ResourceManager.GetString("Master_EditPerson2FAEnable_ConfirmRemoveProvision", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Account.
///
@@ -1698,6 +1743,15 @@ namespace Resources {
}
}
+ ///
+ /// Looks up a localized string similar to One day.
+ ///
+ internal static string Timespan_Selection_OneDay {
+ get {
+ return ResourceManager.GetString("Timespan_Selection_OneDay", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to One month.
///
@@ -1716,6 +1770,15 @@ namespace Resources {
}
}
+ ///
+ /// Looks up a localized string similar to Seven days.
+ ///
+ internal static string Timespan_Selection_SevenDays {
+ get {
+ return ResourceManager.GetString("Timespan_Selection_SevenDays", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Six months.
///
@@ -1734,6 +1797,15 @@ namespace Resources {
}
}
+ ///
+ /// Looks up a localized string similar to Two days.
+ ///
+ internal static string Timespan_Selection_TwoDays {
+ get {
+ return ResourceManager.GetString("Timespan_Selection_TwoDays", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Two months.
///
@@ -1743,6 +1815,15 @@ namespace Resources {
}
}
+ ///
+ /// Looks up a localized string similar to Two weeks.
+ ///
+ internal static string Timespan_Selection_TwoWeeks {
+ get {
+ return ResourceManager.GetString("Timespan_Selection_TwoWeeks", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Two years.
///
diff --git a/Site/App_GlobalResources/Global.resx b/Site/App_GlobalResources/Global.resx
index ac2a1918..46c178cc 100644
--- a/Site/App_GlobalResources/Global.resx
+++ b/Site/App_GlobalResources/Global.resx
@@ -774,4 +774,34 @@
A password reset link was sent to this user.
+
+ <strong>CANNOT PROVISION 2FA</strong><br/><br/>You cannot turn on two-factor authentication for someone else. They must do it by themselves, thereby being alone in having their secret keys.
+ Displayed when somebody tries to turn on 2FA for someone else.
+
+
+ Two-factor authentication has been disabled. You must now log in with a regular password.
+
+
+ Two-factor authentication was removed for this user. They must now log in with a regular password.
+
+
+ <strong>DISABLE TWO-FACTOR AUTHENTICATION?</strong><br/><br/>This is not recommended. Two-factor authentication significantly raises the security of your account, in addition to making it much easier to log in if you're using BitID.<br/><br/>Remove 2FA and fall back to password-only authentication?
+ Displayed when removing 2FA for yourself
+
+
+ <strong>REMOVE TWO-FACTOR AUTHENTICATION?</strong><br/><br/>Only do this if you have been requested to turn off 2FA for this user, by this user themselves, <strong>and</strong> you are absolutely, positively sure that the request came from the person whose security you are disabling (as per the verification policy of the organization).<br/><br/>Proceed with removing this user's security? They will fall back to password-only security.
+ Displayed when removing 2FA for someone else
+
+
+ One day
+
+
+ Seven days
+
+
+ Two days
+
+
+ Two weeks
+
\ No newline at end of file
diff --git a/Site/Controls/v5/Base/AjaxToggleSlider.ascx b/Site/Controls/v5/Base/AjaxToggleSlider.ascx
index 0e728598..ca6b84b5 100644
--- a/Site/Controls/v5/Base/AjaxToggleSlider.ascx
+++ b/Site/Controls/v5/Base/AjaxToggleSlider.ascx
@@ -18,8 +18,6 @@
})
.on('toggle', function(e, active)
{
- alert(active);
-
if (active != _initVal_<%=this.SliderCheckbox.ClientID%>) {
var jsonData = {};
jsonData.newValue = active;
@@ -100,12 +98,12 @@
}
function <%=this.ClientID%>_setValue(newValue) {
- $('#<%=this.SliderCheckbox.ClientID%>').val(newValue);
+ $('#<%=this.ClientID%>_sliderContainer').toggles({ on: newValue });
}
function <%=this.ClientID%>_initialize(initValue) {
_initVal_<%=this.SliderCheckbox.ClientID%> = initValue;
- <%=this.ClientID%>_setValue(initValue);
+ $('#<%=this.ClientID%>_sliderContainer').toggles({ on: initValue });
<%=this.ClientID%>_enable();
}
diff --git a/Site/Master-v5.master b/Site/Master-v5.master
index fcfc940b..36aa3e74 100644
--- a/Site/Master-v5.master
+++ b/Site/Master-v5.master
@@ -259,7 +259,7 @@
PERSONNAME:
-
+
@@ -415,6 +415,18 @@
}
+ function masterPersonEditor2FAProvisionToggle(newValue, fieldName, controlName) {
+ if (newValue) { // it's a boolean, so "if true" meaning if the slider is "on"
+ // 2FA can't be provisioned true, only installed by the user
+
+ <%= this.MasterEditPerson2FAProvisioning.ClientID %>_initialize(false);
+ alertify.alert(SwarmopsJS.unescape('<%=this.Localized_MasterPersonEdit_CannotProvision2FA%>'));
+ } else {
+ // We're turning 2FA _OFF_ for someone else - are we really sure we want to do this?
+ }
+ }
+
+
function masterPersonEditorOnFieldChange(newValue, fieldName, controlName) {
// Do the AJAX call from here, as we need to also pass along the person ID of the person edited
// (the AjaxTextBox auto-callback is disabled for this reason, code duplicated here)
diff --git a/Site/Master-v5.master.cs b/Site/Master-v5.master.cs
index 4cd15cbb..bd47a9f2 100644
--- a/Site/Master-v5.master.cs
+++ b/Site/Master-v5.master.cs
@@ -461,5 +461,22 @@ namespace Swarmops.Frontend
get { return CommonV5.JavascriptEscape(Resources.Global.Global_Confirm); }
}
+ public string Localized_MasterPersonEdit_CannotProvision2FA
+ {
+ get { return CommonV5.JavascriptEscape(Resources.Global.Master_EditPerson2FAEnable_CannotProvision); }
+ }
+
+ public string Localized_MasterPersonEdit_ConfirmRemove2FAProvision
+ {
+ get
+ {
+ return CommonV5.JavascriptEscape(Resources.Global.Master_EditPerson2FAEnable_ConfirmRemoveProvision);
+ }
+ }
+
+ public string Localized_MasterPersonEdit_ConfirmRemove2FAOwn
+ {
+ get { return CommonV5.JavascriptEscape(Resources.Global.Master_EditPerson2FAEnable_ConfirmRemoveOwn); }
+ }
}
}
\ No newline at end of file
diff --git a/Site/Master-v5.master.designer.cs b/Site/Master-v5.master.designer.cs
index 2d0e0807..6416d733 100644
--- a/Site/Master-v5.master.designer.cs
+++ b/Site/Master-v5.master.designer.cs
@@ -373,13 +373,13 @@ namespace Swarmops.Frontend {
protected global::System.Web.UI.WebControls.Label MasterLabelEditPersonHeaderSecurityProvisioning;
///
- /// MasterToggleEditPerson2FA control.
+ /// MasterEditPerson2FAProvisioning control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::Swarmops.Frontend.Controls.Base.AjaxToggleSlider MasterToggleEditPerson2FA;
+ protected global::Swarmops.Frontend.Controls.Base.AjaxToggleSlider MasterEditPerson2FAProvisioning;
///
/// MasterLabelEditPersonResetPassword control.