Lots of work on security provisioning

This commit is contained in:
Falkvinge
2016-11-15 23:03:45 +01:00
parent df0add0a18
commit 508a0635bb
6 changed files with 145 additions and 7 deletions
+81
View File
@@ -1455,6 +1455,51 @@ namespace Resources {
}
}
/// <summary>
/// Looks up a localized string similar to &lt;strong&gt;CANNOT PROVISION 2FA&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;You cannot turn on two-factor authentication for someone else. They must do it by themselves, thereby being alone in having their secret keys..
/// </summary>
internal static string Master_EditPerson2FAEnable_CannotProvision {
get {
return ResourceManager.GetString("Master_EditPerson2FAEnable_CannotProvision", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Two-factor authentication has been disabled. You must now log in with a regular password..
/// </summary>
internal static string Master_EditPerson2FAEnable_ConfirmingRemovedOwn {
get {
return ResourceManager.GetString("Master_EditPerson2FAEnable_ConfirmingRemovedOwn", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Two-factor authentication was removed for this user. They must now log in with a regular password..
/// </summary>
internal static string Master_EditPerson2FAEnable_ConfirmingRemovedProvision {
get {
return ResourceManager.GetString("Master_EditPerson2FAEnable_ConfirmingRemovedProvision", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;strong&gt;DISABLE TWO-FACTOR AUTHENTICATION?&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;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&apos;re using BitID.&lt;br/&gt;&lt;br/&gt;Remove 2FA and fall back to password-only authentication?.
/// </summary>
internal static string Master_EditPerson2FAEnable_ConfirmRemoveOwn {
get {
return ResourceManager.GetString("Master_EditPerson2FAEnable_ConfirmRemoveOwn", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;strong&gt;REMOVE TWO-FACTOR AUTHENTICATION?&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Only do this if you have been requested to turn off 2FA for this user, by this user themselves, &lt;strong&gt;and&lt;/strong&gt; 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).&lt;br/&gt;&lt;br/&gt;Proceed with removing this user&apos;s security? They will fall back to password-only security..
/// </summary>
internal static string Master_EditPerson2FAEnable_ConfirmRemoveProvision {
get {
return ResourceManager.GetString("Master_EditPerson2FAEnable_ConfirmRemoveProvision", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Account.
/// </summary>
@@ -1698,6 +1743,15 @@ namespace Resources {
}
}
/// <summary>
/// Looks up a localized string similar to One day.
/// </summary>
internal static string Timespan_Selection_OneDay {
get {
return ResourceManager.GetString("Timespan_Selection_OneDay", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to One month.
/// </summary>
@@ -1716,6 +1770,15 @@ namespace Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Seven days.
/// </summary>
internal static string Timespan_Selection_SevenDays {
get {
return ResourceManager.GetString("Timespan_Selection_SevenDays", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Six months.
/// </summary>
@@ -1734,6 +1797,15 @@ namespace Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Two days.
/// </summary>
internal static string Timespan_Selection_TwoDays {
get {
return ResourceManager.GetString("Timespan_Selection_TwoDays", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Two months.
/// </summary>
@@ -1743,6 +1815,15 @@ namespace Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Two weeks.
/// </summary>
internal static string Timespan_Selection_TwoWeeks {
get {
return ResourceManager.GetString("Timespan_Selection_TwoWeeks", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Two years.
/// </summary>
+30
View File
@@ -774,4 +774,34 @@
<data name="Master_EditPersonResetPassword_ResetLinkSent" xml:space="preserve">
<value>A password reset link was sent to this user.</value>
</data>
<data name="Master_EditPerson2FAEnable_CannotProvision" xml:space="preserve">
<value>&lt;strong&gt;CANNOT PROVISION 2FA&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;You cannot turn on two-factor authentication for someone else. They must do it by themselves, thereby being alone in having their secret keys.</value>
<comment>Displayed when somebody tries to turn on 2FA for someone else.</comment>
</data>
<data name="Master_EditPerson2FAEnable_ConfirmingRemovedOwn" xml:space="preserve">
<value>Two-factor authentication has been disabled. You must now log in with a regular password.</value>
</data>
<data name="Master_EditPerson2FAEnable_ConfirmingRemovedProvision" xml:space="preserve">
<value>Two-factor authentication was removed for this user. They must now log in with a regular password.</value>
</data>
<data name="Master_EditPerson2FAEnable_ConfirmRemoveOwn" xml:space="preserve">
<value>&lt;strong&gt;DISABLE TWO-FACTOR AUTHENTICATION?&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;Remove 2FA and fall back to password-only authentication?</value>
<comment>Displayed when removing 2FA for yourself</comment>
</data>
<data name="Master_EditPerson2FAEnable_ConfirmRemoveProvision" xml:space="preserve">
<value>&lt;strong&gt;REMOVE TWO-FACTOR AUTHENTICATION?&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Only do this if you have been requested to turn off 2FA for this user, by this user themselves, &lt;strong&gt;and&lt;/strong&gt; 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).&lt;br/&gt;&lt;br/&gt;Proceed with removing this user's security? They will fall back to password-only security.</value>
<comment>Displayed when removing 2FA for someone else</comment>
</data>
<data name="Timespan_Selection_OneDay" xml:space="preserve">
<value>One day</value>
</data>
<data name="Timespan_Selection_SevenDays" xml:space="preserve">
<value>Seven days</value>
</data>
<data name="Timespan_Selection_TwoDays" xml:space="preserve">
<value>Two days</value>
</data>
<data name="Timespan_Selection_TwoWeeks" xml:space="preserve">
<value>Two weeks</value>
</data>
</root>
+2 -4
View File
@@ -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();
}
+13 -1
View File
@@ -259,7 +259,7 @@
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: <asp:Label ID="MasterLabelEditPersonHeaderSecurityProvisioning" runat="server" /></h2>
<div class="entryFields">
<input type="button" id="masterPersonEditButtonResetPassword" onclick="masterPersonEditorConfirmResetPassword(); return false;" value="#SendResetMail#" />&#8203;<br/>
<Swarmops5:AjaxToggleSlider ID="MasterToggleEditPerson2FA" runat="server" Label="2FALabel" Cookie="2FA" AjaxCallbackUrl="" OnChange="masterPersonEditorOnToggle"/>
<Swarmops5:AjaxToggleSlider ID="MasterEditPerson2FAProvisioning" runat="server" Label="2FALabel" Cookie="2FA" AjaxCallbackUrl="" OnChange="masterPersonEditor2FAProvisionToggle"/>
</div>
<div class="entryLabels">
@@ -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)
+17
View File
@@ -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); }
}
}
}
+2 -2
View File
@@ -373,13 +373,13 @@ namespace Swarmops.Frontend {
protected global::System.Web.UI.WebControls.Label MasterLabelEditPersonHeaderSecurityProvisioning;
/// <summary>
/// MasterToggleEditPerson2FA control.
/// MasterEditPerson2FAProvisioning control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::Swarmops.Frontend.Controls.Base.AjaxToggleSlider MasterToggleEditPerson2FA;
protected global::Swarmops.Frontend.Controls.Base.AjaxToggleSlider MasterEditPerson2FAProvisioning;
/// <summary>
/// MasterLabelEditPersonResetPassword control.