diff --git a/Logic/Logic.csproj b/Logic/Logic.csproj index 5f46d1c2..3a81241d 100644 --- a/Logic/Logic.csproj +++ b/Logic/Logic.csproj @@ -724,4 +724,5 @@ + \ No newline at end of file diff --git a/Logic/packages.config b/Logic/packages.config index 55355ab3..c686d606 100644 --- a/Logic/packages.config +++ b/Logic/packages.config @@ -1,6 +1,6 @@  - + @@ -9,6 +9,6 @@ - + \ No newline at end of file diff --git a/Site/Bases/CommonV5.cs b/Site/Bases/CommonV5.cs index 77b5988f..69d50a51 100644 --- a/Site/Bases/CommonV5.cs +++ b/Site/Bases/CommonV5.cs @@ -99,6 +99,27 @@ namespace Swarmops.Frontend return result; } + public static Authority InitAuthority() + { + try + { + Authority authority = CommonV5.GetAuthenticationDataAndCulture(HttpContext.Current).Authority; + return authority; + } + catch (Exception) + { + // if this fails FOR WHATEVER REASON then we're not authenticated + System.Web.Security.FormsAuthentication.SignOut(); + + if (!HttpContext.Current.Request.Path.ToLowerInvariant().StartsWith("/security/login")) + { + // If we're not already on the login page, put us on the login page leading to Dashboard + HttpContext.Current.Response.Redirect("/"); + } + return null; + } + } + public static string JavascriptEscape (string input) { if (String.IsNullOrEmpty (input)) diff --git a/Site/Bases/ControlV5Base.cs b/Site/Bases/ControlV5Base.cs index 41e6e649..c7cd4e29 100644 --- a/Site/Bases/ControlV5Base.cs +++ b/Site/Bases/ControlV5Base.cs @@ -35,18 +35,7 @@ namespace Swarmops.Frontend protected override void OnInit (EventArgs e) { - try - { - this._authority = CommonV5.GetAuthenticationDataAndCulture (HttpContext.Current).Authority; - } - catch (Exception) - { - // if this fails FOR WHATEVER REASON then we're not authenticated - this._authority = null; - FormsAuthentication.SignOut(); - Response.Redirect ("/"); - } - + this._authority = CommonV5.InitAuthority(); base.OnInit (e); } diff --git a/Site/Controls/v5/Base/AjaxToggleSlider.ascx b/Site/Controls/v5/Base/AjaxToggleSlider.ascx new file mode 100644 index 00000000..a1575731 --- /dev/null +++ b/Site/Controls/v5/Base/AjaxToggleSlider.ascx @@ -0,0 +1,107 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AjaxToggleSlider.ascx.cs" Inherits="Swarmops.Frontend.Controls.Base.AjaxToggleSlider" %> + + + + +
diff --git a/Site/Controls/v5/Base/AjaxToggleSlider.ascx.cs b/Site/Controls/v5/Base/AjaxToggleSlider.ascx.cs new file mode 100644 index 00000000..78ab36d9 --- /dev/null +++ b/Site/Controls/v5/Base/AjaxToggleSlider.ascx.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +// ReSharper disable once CheckNamespace +namespace Swarmops.Frontend.Controls.Base +{ + public partial class AjaxToggleSlider : ControlV5Base + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + public string Label { get; set; } + public string CallbackUrl { get; set; } + public string OnClientChange { get; set; } + public string Cookie { get; set; } + } +} \ No newline at end of file diff --git a/Site/Controls/v5/Base/AjaxToggleSlider.ascx.designer.cs b/Site/Controls/v5/Base/AjaxToggleSlider.ascx.designer.cs new file mode 100644 index 00000000..ccf1f696 --- /dev/null +++ b/Site/Controls/v5/Base/AjaxToggleSlider.ascx.designer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Swarmops.Frontend.Controls.Base { + + + public partial class AjaxToggleSlider { + + /// + /// ToggleSliderLabel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label ToggleSliderLabel; + + /// + /// SliderCheckbox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox SliderCheckbox; + } +} diff --git a/Site/Master-v5.master b/Site/Master-v5.master index 7111eb21..799e0b74 100644 --- a/Site/Master-v5.master +++ b/Site/Master-v5.master @@ -29,7 +29,7 @@ - + @@ -41,11 +41,11 @@ - + - + diff --git a/Site/Security/Login.aspx b/Site/Security/Login.aspx index 8fcd1637..76ddcb4b 100644 --- a/Site/Security/Login.aspx +++ b/Site/Security/Login.aspx @@ -6,21 +6,46 @@ - - - + + + + + + + + + + + - - - Swarmops Alpha - Login - - + + + + + + + + + + + + + + + + + + + + + + Swarmops Alpha - Login diff --git a/Site/Security/Login.aspx.cs b/Site/Security/Login.aspx.cs index 081e30b7..3d3fd70c 100644 --- a/Site/Security/Login.aspx.cs +++ b/Site/Security/Login.aspx.cs @@ -162,6 +162,13 @@ namespace Swarmops.Pages.Security this.ImageCultureIndicator.Style[HtmlTextWriterStyle.MarginRight] = "3px"; this.ImageCultureIndicator.Style[HtmlTextWriterStyle.Cursor] = "pointer"; + _cacheVersionMark = Logic.Support.Formatting.SwarmopsVersion; + if (_cacheVersionMark.StartsWith("Debug")) + { + _cacheVersionMark = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.ffff"); + } + _cacheVersionMark = SHA1.Hash(_cacheVersionMark).Replace(" ", "").Substring(0, 8); + Localize(); // Generate BitID tokens @@ -192,6 +199,8 @@ namespace Swarmops.Pages.Security } + protected string _cacheVersionMark; // CSS cache buster + protected void ProcessRespondBitId (BitIdCredentials credentials, HttpResponse response) { BitcoinPubKeyAddress testAddress = new BitcoinPubKeyAddress (credentials.address); diff --git a/Site/Security/Login.aspx.designer.cs b/Site/Security/Login.aspx.designer.cs index bec74c0c..c444fdd8 100644 --- a/Site/Security/Login.aspx.designer.cs +++ b/Site/Security/Login.aspx.designer.cs @@ -21,6 +21,33 @@ namespace Swarmops.Pages.Security { /// protected global::System.Web.UI.HtmlControls.HtmlHead Head1; + /// + /// NeededForCacheMarkToParse1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.PlaceHolder NeededForCacheMarkToParse1; + + /// + /// ExternalScriptEasyUI control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Swarmops.Frontend.Controls.UI.ExternalScripts ExternalScriptEasyUI; + + /// + /// NeededForCacheMarkToParse2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.PlaceHolder NeededForCacheMarkToParse2; + /// /// form2 control. /// diff --git a/Site/Site.csproj b/Site/Site.csproj index f8062d6c..f8054f1b 100644 --- a/Site/Site.csproj +++ b/Site/Site.csproj @@ -85,6 +85,13 @@ + + AjaxToggleSlider.ascx + ASPXCodeBehind + + + AjaxToggleSlider.ascx + BitcoinEchoTest.aspx ASPXCodeBehind @@ -610,6 +617,7 @@ + @@ -4155,6 +4163,7 @@ +