Committing some more security work for sandbox testing

This commit is contained in:
Falkvinge
2016-11-19 14:50:16 +01:00
parent 4d0996df94
commit 51b9c1a97a
3 changed files with 25 additions and 7 deletions
+2 -4
View File
@@ -96,12 +96,10 @@
function <%=this.ClientID%>_fireOnChanging() {
<%=this.ClientID%>_onChangingTimer = null;
alertify.log("FireOnChanging");
<%
if (string.IsNullOrEmpty(this.OnChanging))
if (!string.IsNullOrEmpty(this.OnChanging))
{
Response.Write(this.OnChanging + "(" + this.TextInput.ClientID + ".val(), '" + this.Cookie + "', '" + this.ClientID + "');"); // cookie may be empty and that's ok
Response.Write(this.OnChanging + "($('#" + this.TextInput.ClientID + "').val(), '" + this.Cookie + "', '" + this.ClientID + "');"); // cookie may be empty and that's ok
}
%>
}
@@ -12,6 +12,7 @@ namespace Swarmops.Frontend.Controls.Base
protected void Page_Load(object sender, EventArgs e)
{
this.TextInput.Attributes["Placeholder"] = this.Placeholder;
this.TextInput.TextMode = this.Mode;
}
public string Text
@@ -30,6 +31,7 @@ namespace Swarmops.Frontend.Controls.Base
public string OnChange { get; set; }
public string OnChanging { get; set; }
public string AjaxCallbackUrl { set; get; }
public TextBoxMode Mode { get; set; }
public string CssClass
{
+21 -3
View File
@@ -248,10 +248,10 @@
<div title="<img src='/Images/Icons/iconshock-lock-256px.png' height='64' width='64' />">
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: <asp:Label runat="server" ID="MasterLabelEditPersonHeaderSecurity" Text="#Security#"/></h2>
<div class="entryFields">
<Swarmops5:AjaxTextBox ID="MasterEditPersonCurrentPassword" runat="server" OnChanging="masterPersonEditorOnSecurityPasswordChanging" Cookie="CurrentPassword" AjaxCallbackUrl="" />&#8203;<br/>
<Swarmops5:AjaxTextBox ID="MasterEditPersonCurrentPassword" runat="server" Mode="Password" OnChanging="masterPersonEditorOnSecurityPasswordChanging" Cookie="CurrentPassword" AjaxCallbackUrl="" />&#8203;<br/>
<div class="divMasterPersonEditSecurityRolldown" style="display:none"><Swarmops5:AjaxToggleSlider ID="MasterEditPerson2FA" runat="server" OnChange="masterPersonEditorOnFieldChange" Cookie="2FA" AjaxCallbackUrl="" />&#8203;<br/>
<Swarmops5:AjaxTextBox ID="MasterEditPersonNewPassword1" runat="server" OnChange="masterPersonEditorOnFieldChange" Cookie="Phone" AjaxCallbackUrl="" />&#8203;<br/>
<Swarmops5:AjaxTextBox ID="MasterEditPersonNewPassword2" runat="server" OnChange="masterPersonEditorOnFieldChange" Cookie="TwitterId" AjaxCallbackUrl="" />
<Swarmops5:AjaxTextBox ID="MasterEditPersonNewPassword1" runat="server" Mode="Password" OnChange="masterPersonEditorOnFieldChange" Cookie="Phone" AjaxCallbackUrl="" />&#8203;<br/>
<Swarmops5:AjaxTextBox ID="MasterEditPersonNewPassword2" runat="server" Mode="Password" OnChange="masterPersonEditorOnFieldChange" Cookie="TwitterId" AjaxCallbackUrl="" />
</div>
</div>
<div class="entryLabels">
@@ -364,6 +364,23 @@
$(document).ready(function() {
});
var _master_PersonEditor_SecurityShowing = false;
function masterPersonEditorOnSecurityPasswordChanging(newValue, cookie, controlName) {
if (newValue == "foobar") {
if (!_master_PersonEditor_SecurityShowing) {
$('div.divMasterPersonEditSecurityRolldown').slideDown();
_master_PersonEditor_SecurityShowing = true;
}
} else {
if (_master_PersonEditor_SecurityShowing) {
$('div.divMasterPersonEditSecurityRolldown').slideUp();
_master_PersonEditor_SecurityShowing = false;
}
}
}
function masterBeginEditPerson(personId) {
_master_PersonEditedId = personId;
@@ -379,6 +396,7 @@
$('span.spanModalEditingPersonName').text(SwarmopsJS.unescape('<%= this.Localized_LoadingPlaceholderShort %>'));
$('div.divMasterPersonEditSecurityRolldown').hide();
_master_PersonEditor_SecurityShowing = false;
// Open the Modal
<%=this.ModalMasterEditPerson.ClientID%>_open();