Skip to content

Commit

Permalink
Session shadow/terminate issues fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathy365 committed Nov 30, 2020
1 parent 30cafde commit ddfbed1
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 68 deletions.
12 changes: 6 additions & 6 deletions Myrtille.Web/Default.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<!-- mobile devices -->
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0"/>

<title><%=RemoteSession != null && !RemoteSession.ConnectionService && (RemoteSession.State == RemoteSessionState.Connecting || RemoteSession.State == RemoteSessionState.Connected) && !string.IsNullOrEmpty(RemoteSession.ServerAddress) ? (((!string.IsNullOrEmpty(RemoteSession.UserDomain))? RemoteSession.UserDomain.ToString() + "\\" : "") + RemoteSession.UserName.ToString() + "@" + RemoteSession.ServerAddress.ToString() + " | Securden RDP Session") : "Securden RDP Gateway"%></title>
<title><%=RemoteSession != null && !RemoteSession.ConnectionService && (RemoteSession.State == RemoteSessionState.Connecting || RemoteSession.State == RemoteSessionState.Connected) && !string.IsNullOrEmpty(RemoteSession.ServerAddress) ? ((RemoteSession.isManageSession? "Session Shadow - " : "") + ((!string.IsNullOrEmpty(RemoteSession.UserDomain))? RemoteSession.UserDomain.ToString() + "\\" : "") + RemoteSession.UserName.ToString() + "@" + RemoteSession.ServerAddress.ToString() + " | Securden RDP Session") : "Securden RDP Gateway"%></title>

<link rel="icon" type="image/x-icon" href="favicon.ico"/>
<link rel="stylesheet" type="text/css" href="<%=BundleTable.Bundles.ResolveBundleUrl("~/css/Default.css", true)%>"/>
Expand Down Expand Up @@ -352,7 +352,7 @@
<div runat="server" id="remoteOperationsDivWrap" visible="False">
<div runat="server" id="remoteOperationsDiv">

<div class="remote-oper-label-text" onclick="openPopup('pasteClipboardPopup', 'PasteClipboard.aspx');">
<div class="remote-oper-label-text" onclick="openPopup('pasteClipboardPopup', 'PasteClipboard.aspx');" id="clipboardOperDiv" runat="server" visible="True">
<span class="remote-oper-label-text-icon clipboard-icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
<g>
Expand All @@ -364,7 +364,7 @@
<span class="remote-oper-label-text-val">Clipboard</span>
</div>

<div class="remote-oper-label-text" onclick="sendWinR();">
<div class="remote-oper-label-text" onclick="sendWinR();" id="winrOperDiv" runat="server" visible="True">
<span class="remote-oper-label-text-icon win-r-icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
<g>
Expand All @@ -377,7 +377,7 @@
<span class="remote-oper-label-text-val">Run (Win+R)</span>
</div>

<div class="remote-oper-label-text" onclick="sendCtrlAltDel();">
<div class="remote-oper-label-text" onclick="sendCtrlAltDel();" id="ctrlaltdelOperDiv" runat="server" visible="True">
<span class="remote-oper-label-text-icon ctrl-alt-del-icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
<g id="Setting_5_">
Expand All @@ -389,7 +389,7 @@
<span class="remote-oper-label-text-val">Ctrl+Alt+Delete</span>
</div>

<div class="remote-oper-label-text" onclick="resizeSession();">
<div class="remote-oper-label-text" onclick="resizeSession();" id="resizeOperDiv" runat="server" visible="True">
<span class="remote-oper-label-text-icon resize-icon">
<svg enable-background="new 0 0 458.659 458.659" version="1.1" viewBox="0 0 458.66 458.66" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<g fill="#020202">
Expand All @@ -402,7 +402,7 @@
<span class="remote-oper-label-text-val">Fit to Screen</span>
</div>

<div class="remote-oper-label-text" onclick="disconnectSession();">
<div class="remote-oper-label-text" onclick="disconnectSession();" id="disconnectOperDiv" runat="server" visible="True">
<span class="remote-oper-label-text-icon disconnect-icon">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
<g>
Expand Down
13 changes: 10 additions & 3 deletions Myrtille.Web/Default.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ protected void Page_Load(
}
RemoteSession = null;
}
else if (Session[HttpSessionStateVariables.GuestInfo.ToString()] != null)
{
remoteOperationsDiv.Visible = false;
}
}
catch (Exception exc)
{
Expand Down Expand Up @@ -565,6 +569,7 @@ private bool ConnectRemoteServer()
{
userProfileId = (long)connectionDetails["user_profile_id"];
userSessionId = (long)connectionDetails["user_session_id"];
accessUrl = (string)connectionDetails["ACCESS_URL"];
if ((string)connectionDetails["type"] == "SHADOW_SESSION")
{
connectionDetails = (JObject)connectionDetails["details"];
Expand All @@ -586,6 +591,7 @@ private bool ConnectRemoteServer()
Control = false,
}
};
sharingInfo.RemoteSession.isManageSession = true;

sharedSessions.Add(sharingInfo.GuestInfo.Id, sharingInfo);
guestShareId = sharingInfo.GuestInfo.Id.ToString();
Expand All @@ -608,7 +614,8 @@ private bool ConnectRemoteServer()
}
else
{
Response.Write("<script>alert('Invalid session.'); window.close();</script>");
SecurdenWeb.ManageSessionRequest(accessUrl, (string)connectionDetails["connection_id"], false);
Response.Write("<script>alert('The session has already been closed or terminated.'); window.close();</script>");
}
return false;
}
Expand Down Expand Up @@ -637,11 +644,11 @@ private bool ConnectRemoteServer()
}
else
{
Response.Write("<script>alert('Invalid session.'); window.close();</script>");
SecurdenWeb.ManageSessionRequest(accessUrl, (string)connectionDetails["connection_id"], false);
Response.Write("<script>alert('The session has already been closed or terminated.'); window.close();</script>");
}
return false;
}
accessUrl = (string)connectionDetails["ACCESS_URL"];
connectionDetails = (JObject)connectionDetails["details"];
loginServer = (string)connectionDetails["address"];
loginDomain = "";
Expand Down
Loading

0 comments on commit ddfbed1

Please sign in to comment.