Work on Impersonation, removed some debug elements

This commit is contained in:
Rick Falkvinge
2017-01-19 00:34:33 +01:00
parent da58069c14
commit 2bb66ef115
10 changed files with 130 additions and 7 deletions
+9
View File
@@ -1946,6 +1946,15 @@ namespace Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Type a partial name....
/// </summary>
internal static string Swarm_TypePartialName {
get {
return ResourceManager.GetString("Swarm_TypePartialName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to five-year.
/// </summary>
+3
View File
@@ -890,4 +890,7 @@
<data name="Global_Volunteer_Plural" xml:space="preserve">
<value>Volunteers</value>
</data>
<data name="Swarm_TypePartialName" xml:space="preserve">
<value>Type a partial name...</value>
</data>
</root>
+18
View File
@@ -87,6 +87,24 @@ namespace Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Debug.
/// </summary>
internal static string Menu5_Administration_Debug {
get {
return ResourceManager.GetString("Menu5_Administration_Debug", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Impersonate.
/// </summary>
internal static string Menu5_Administration_Debug_Impersonate {
get {
return ResourceManager.GetString("Menu5_Administration_Debug_Impersonate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Geography Tree.
/// </summary>
+6
View File
@@ -433,4 +433,10 @@
<data name="Menu5_Beta_ReportBug" xml:space="preserve">
<value>Report a Swarmops Bug (on Github)</value>
</data>
<data name="Menu5_Administration_Debug" xml:space="preserve">
<value>Debug</value>
</data>
<data name="Menu5_Administration_Debug_Impersonate" xml:space="preserve">
<value>Impersonate</value>
</data>
</root>
+38
View File
@@ -132,6 +132,44 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to Impersonate another user.
/// </summary>
internal static string CommenceImpersonation_Header {
get {
return ResourceManager.GetString("CommenceImpersonation_Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Impersonate.
/// </summary>
internal static string CommenceImpersonation_Impersonate {
get {
return ResourceManager.GetString("CommenceImpersonation_Impersonate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Person to impersonate.
/// </summary>
internal static string CommenceImpersonation_Person {
get {
return ResourceManager.GetString("CommenceImpersonation_Person", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;p&gt;This debugging tool allows you to impersonate another user to see and experience Swarmops as they do when logged in.&lt;/p&gt;
///&lt;p&gt;&lt;strong&gt;WARNING:&lt;/strong&gt; This is a highly intrusive tool that should only be used for technical development and for requested support. Using this should not be taken lightly.&lt;/p&gt;
///&lt;p&gt;All impersonations are permanently logged, all and any actions taken while impersonated are traceable as such, and the impersonated user will be informed of the intrusion.&lt;/p&gt;.
/// </summary>
internal static string CommenceImpersonation_Warning {
get {
return ResourceManager.GetString("CommenceImpersonation_Warning", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Activists will be called.
/// </summary>
+14
View File
@@ -314,4 +314,18 @@
<data name="SystemSettings_WebsocketPortBackend" xml:space="preserve">
<value>WebSocket Port (Backend)</value>
</data>
<data name="CommenceImpersonation_Header" xml:space="preserve">
<value>Impersonate another user</value>
</data>
<data name="CommenceImpersonation_Impersonate" xml:space="preserve">
<value>Impersonate</value>
</data>
<data name="CommenceImpersonation_Person" xml:space="preserve">
<value>Person to impersonate</value>
</data>
<data name="CommenceImpersonation_Warning" xml:space="preserve">
<value>&lt;p&gt;This debugging tool allows you to impersonate another user to see and experience Swarmops as they do when logged in.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;WARNING:&lt;/strong&gt; This is a highly intrusive tool that should only be used for technical development and for requested support. Using this should not be taken lightly.&lt;/p&gt;
&lt;p&gt;All impersonations are permanently logged, all and any actions taken while impersonated are traceable as such, and the impersonated user will be informed of the intrusion.&lt;/p&gt;</value>
</data>
</root>
@@ -15,6 +15,10 @@ namespace Swarmops.Controls.Swarm
protected void Page_Load (object sender, EventArgs e)
{
if (String.IsNullOrEmpty(Placeholder))
{
Placeholder = Resources.Global.Swarm_TypePartialName;
}
}
}
}
+27
View File
@@ -518,6 +518,33 @@
<Children />
</MainMenuItem>
<MainMenuItem>
<UserLevel>4</UserLevel>
<Type>Separator</Type>
<Children />
</MainMenuItem>
<MainMenuItem>
<ResourceKey>Administration_Debug</ResourceKey>
<UserLevel>4</UserLevel>
<Permissions />
<ImageUrl>iconshock-battery-drill</ImageUrl>
<Type>Submenu</Type>
<Children>
<MainMenuItem>
<ResourceKey>Administration_Debug_Impersonate</ResourceKey>
<UserLevel>4</UserLevel>
<Permissions />
<ImageUrl>iconshock-battery-drill</ImageUrl>
<NavigateUrl>/Pages/v5/Admin/CommenceImpersonation.aspx</NavigateUrl>
<Type>Link</Type>
<Children />
</MainMenuItem>
</Children>
</MainMenuItem>
<MainMenuItem>
<UserLevel>1</UserLevel>
<Type>Separator</Type>
+3 -7
View File
@@ -10,25 +10,21 @@ function _masterInitializeSocket(authenticationTicket) {
_masterSocket = null;
}
alertify.log("DEBUG: Opening socket " + getMasterSocketAddress() + "...");
var socketUrl = getMasterSocketAddress() + "?Auth=" + authenticationTicket;
_masterSocket = new WebSocket(socketUrl);
_masterSocket.onopen = function(data) {
alertify.success('Socket Connected!');
if (_masterSocketHeartbeatsLost) {
// Reload all edits and the edit pool. If there are discrepancies, we can probably live with them. (Detect editing?)
alertify.log("Backend connection restored without interruption.");
//alertify.log("Backend connection restored without interruption.");
_masterSocketHeartbeatsLost = false;
}
//watchHeartbeat();
};
_masterSocket.onclose = function(data) { alertify.log("Connection Lost"); };
_masterSocket.onerror = function(data) { alertify.log("Connection Error"); };
_masterSocket.onclose = function(data) { /* TODO: try reconnecting */ };
_masterSocket.onerror = function(data) { alertify.error("WARNING: Socket connection error - realtime updates will not be available"); };
_masterSocket.onmessage = function(data) {
console.log(data.data);
+8
View File
@@ -106,6 +106,13 @@
<Compile Include="Pages\v5\Admin\CreateOrganization.aspx.designer.cs">
<DependentUpon>CreateOrganization.aspx</DependentUpon>
</Compile>
<Compile Include="Pages\v5\Admin\CommenceImpersonation.aspx.cs">
<DependentUpon>CommenceImpersonation.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\v5\Admin\CommenceImpersonation.aspx.designer.cs">
<DependentUpon>CommenceImpersonation.aspx</DependentUpon>
</Compile>
<Compile Include="Pages\v5\Admin\Hacks\PopulateCountry1.aspx.cs">
<DependentUpon>PopulateCountry1.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -967,6 +974,7 @@
<Content Include="MainMenu-v5.xml" />
<Content Include="Pages\v5\Admin\BitcoinEchoTest.aspx" />
<Content Include="Pages\v5\Admin\CreateOrganization.aspx" />
<Content Include="Pages\v5\Admin\CommenceImpersonation.aspx" />
<Content Include="Pages\v5\Admin\Hacks\PopulateCountry1.aspx" />
<Content Include="Pages\v5\Admin\Hacks\PopulateCountry2.aspx" />
<Content Include="Pages\v5\Admin\Hacks\PopulateFakePeople.aspx" />