diff --git a/Site/Pages/v5/Admin/Debug/DebugSockets.aspx b/Site/Pages/v5/Admin/Debug/DebugSockets.aspx new file mode 100644 index 00000000..90b8d6fa --- /dev/null +++ b/Site/Pages/v5/Admin/Debug/DebugSockets.aspx @@ -0,0 +1,47 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" Inherits="Swarmops.Frontend.Pages.Admin.Debug.Sockets" Codebehind="DebugSockets.aspx.cs" %> +<%@ Register src="~/Controls/v5/Base/ComboGeographies.ascx" tagname="ComboGeographies" tagprefix="Swarmops5" %> + + + + + + + + +
+   +
+
+   +
+

(0)

+ + + + + + + + + + + +
+
+ + + diff --git a/Site/Pages/v5/Admin/Debug/DebugSockets.aspx.cs b/Site/Pages/v5/Admin/Debug/DebugSockets.aspx.cs new file mode 100644 index 00000000..324d8171 --- /dev/null +++ b/Site/Pages/v5/Admin/Debug/DebugSockets.aspx.cs @@ -0,0 +1,115 @@ +using System; +using System.Security; +using System.Web; +using System.Web.Services; +using Resources; + +using Swarmops.Common.Enums; +using Swarmops.Logic.Financial; +using Swarmops.Logic.Security; +using Swarmops.Logic.Support; + +namespace Swarmops.Frontend.Pages.Admin.Debug +{ + public partial class DebugSockets : PageV5Base + { + protected void Page_Load (object sender, EventArgs e) + { + PageIcon = "iconshock-group-search"; + this.PageAccessRequired = new Access (CurrentOrganization, AccessAspect.PersonalData, AccessType.Read); + + if (!Page.IsPostBack) + { + Localize(); + } + + RegisterControl (EasyUIControl.Tree | EasyUIControl.DataGrid); + } + + private void Localize() + { + PageTitle = @"Debug Sockets"; + InfoBoxLiteral = @"This troubleshoots socket connections by showing which connections are live."; + + /* no localization for debug pages */ + } + + [WebMethod] + public static ConfirmPayoutResult ConfirmPayout (string protoIdentity) + { + protoIdentity = HttpUtility.UrlDecode (protoIdentity); + + AuthenticationData authData = GetAuthenticationDataAndCulture(); + + if ( + !authData.Authority.HasAccess (new Access (AccessAspect.System, AccessType.Read))) + { + throw new SecurityException("Insufficient privileges for operation"); + } + + ConfirmPayoutResult result = new ConfirmPayoutResult(); + + Payout payout = Payout.CreateFromProtoIdentity (authData.CurrentUser, protoIdentity); + PWEvents.CreateEvent (EventSource.PirateWeb, EventType.PayoutCreated, + authData.CurrentUser.Identity, 1, 1, 0, payout.Identity, + protoIdentity); + + // Create result and return it + + result.AssignedId = payout.Identity; + result.DisplayMessage = String.Format (Resources.Pages.Financial.PayOutMoney_PayoutCreated, payout.Identity, + payout.Recipient); + + result.DisplayMessage = CommonV5.JavascriptEscape(result.DisplayMessage); + + return result; + } + + [WebMethod] + public static UndoPayoutResult UndoPayout (int databaseId) + { + AuthenticationData authData = GetAuthenticationDataAndCulture(); + UndoPayoutResult result = new UndoPayoutResult(); + + Payout payout = Payout.FromIdentity (databaseId); + + if (!payout.Open) + { + // this payout has already been settled, or picked up for settling + + result.Success = false; + result.DisplayMessage = String.Format (Resources.Pages.Financial.PayOutMoney_PayoutCannotUndo, + databaseId); + + return result; + } + + payout.UndoPayout(); + + result.DisplayMessage = + HttpUtility.UrlEncode (String.Format (Resources.Pages.Financial.PayOutMoney_PayoutUndone, databaseId)) + .Replace ("+", "%20"); + result.Success = true; + return result; + } + + public struct ConfirmPayoutResult + { + public int AssignedId; + public string DisplayMessage; + }; + + public struct UndoPayoutResult + { + public string DisplayMessage; + public bool Success; + } + + + // ReSharper disable once InconsistentNaming + public string Localized_NoticeTooManyHits + { + get { return JavascriptEscape(Resources.Pages.Swarm.ListFindPeople_TooManyHits); } + } + } +} \ No newline at end of file diff --git a/Site/Pages/v5/Admin/Debug/DebugSockets.aspx.designer.cs b/Site/Pages/v5/Admin/Debug/DebugSockets.aspx.designer.cs new file mode 100644 index 00000000..2fd89a8a --- /dev/null +++ b/Site/Pages/v5/Admin/Debug/DebugSockets.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// 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.Pages.Admin.Debug { + + + public partial class Sockets { + + /// + /// LabelMatchingPeopleInX control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label LabelMatchingPeopleInX; + + /// + /// LabelGridHeaderName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label LabelGridHeaderName; + + /// + /// LabelGridHeaderGeography control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label LabelGridHeaderGeography; + + /// + /// LabelGridHeaderMail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label LabelGridHeaderMail; + + /// + /// LabelGridHeaderPhone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label LabelGridHeaderPhone; + + /// + /// LabelGridHeaderNotes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label LabelGridHeaderNotes; + + /// + /// LabelGridHeaderAction control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label LabelGridHeaderAction; + } +}