Updated RDWeb pages with the two-factor support

This commit is contained in:
Jakob A. Dam 2015-04-10 12:10:14 +02:00
parent 80da1889a3
commit 59d9b4b135
24 changed files with 735 additions and 229 deletions

Binary file not shown.

Binary file not shown.

View file

@ -10,9 +10,11 @@
void goToFolder(string getLangVal)
{
Response.Redirect(getLangVal + "/Default.aspx" + Request.Url.Query,true);
Response.Redirect(getLangVal + "/Default.aspx" + Request.Url.Query,true);
}
void Page_Load(Object sender, EventArgs e)
{
// Deny requests with "additional path information"

Binary file not shown.

View file

@ -22,12 +22,11 @@
</xsl:if>
<title ID="PAGE_TITLE"><xsl:value-of select="$strings[@id = 'PageTitle']"/></title>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<link href="tswa.css" rel="stylesheet" type="text/css" />
<xsl:apply-templates select="Style"/>
<script language="javascript" type="text/javascript" src='../renderscripts.js'/>
<script language="javascript" type="text/javascript" src='../webscripts-domain.js'/>
<script language="javascript" type="text/javascript">
var sHelpSource = &quot;<xsl:value-of select="@helpurl"/>&quot;;
<xsl:value-of select="HeaderJS[1]"/>
@ -378,7 +377,7 @@
ActiveXMode = <xsl:value-of select="$feedidprefix"/>LoadControl();
if (ActiveXMode &amp;&amp; <xsl:value-of select="$feedidprefix"/>Controls.PORTAL_REMOTE_DESKTOPS != null)
if (ActiveXMode)
{
<xsl:value-of select="$feedidprefix"/>Controls.PORTAL_REMOTE_DESKTOPS.style.display = "inline";
}
@ -423,7 +422,7 @@
obj += "classid='CLSID:7390f3d8-0439-4c05-91e3-cf5cb290c3d0'>";
}
obj += "&lt;/object&gt;";
obj += "&lt;script language='javascript' type='text/javascript'&gt; var MsRdpClient = document.getElementById('MsRdpClient'); &lt;\/script&gt;";
obj += "var MsRdpClient = document.getElementById('MsRdpClient');";
document.getElementById("<xsl:value-of select="$feedidprefix"/>oDivMsRdpClient").insertAdjacentHTML("beforeEnd",obj);
if ( WebAccessControlPresent ) {
@ -433,7 +432,7 @@
MsRdpClientShell = MsRdpClient.MsRdpClientShell;
}
if (!MsRdpClient || MsRdpClientShell == null) {
if (!MsRdpClient || (MsRdpClient.readyState != 4) || MsRdpClientShell == null) {
retval = false;
<xsl:value-of select="$feedidprefix"/>OnControlLoadError();
}
@ -633,21 +632,29 @@
};
function tswa_bossOver(obj){
obj.children[0].children[0].className = 'tswa_vis1';
obj.children[0].style.padding = "10px 3px 2px 2px";
obj.children[0].children[0].className = 'tswa_vis1';
obj.children[0].style.padding = "10px 3px 2px 2px";
}
function tswa_bossOut(obj){
obj.children[0].children[0].className = "tswa_vis0";
obj.children[0].style.padding = "12px 1px 0px 4px";
obj.children[0].children[0].className = "tswa_vis0";
obj.children[0].style.padding = "12px 1px 0px 4px";
}
function goRDP(pid, rdpContents, url) {
var wnd = window.open("token.aspx?User=" + getUserNameRdpProperty(), "Launch application","location=0,status=0,scrollbars=0, width=200,height=100");
<!--wnd.addEventListener('load', wnd.doSomething, true);-->
setTimeout(function() {
wnd.close();
}, 2000);
if (ActiveXMode) {
try {
goRDPAx(pid, rdpContents);
} catch (e) {
location.href = url;
}
goRDPAx(pid, rdpContents);
}
else {
location.href = url;
@ -679,7 +686,7 @@
if (<xsl:value-of select="$feedidprefix"/>Controls.chkShowOptimizeExperience.checked) {
var objRegExp = new RegExp("connection type:i:([0-9]+)", "i");
var iIndex = strRdpFileContents.search( objRegExp );
<!-- Add 'connection type' if it does exist otherwise replace. -->
<!-- Add 'connection type' if it does exist otherwise replace. -->
if ( -1 == iIndex ) {
if ( "\\n" != strRdpFileContents.charAt(strRdpFileContents.length-1) ) {
strRdpFileContents += "\\r\\n";
@ -690,28 +697,43 @@
}
}
</xsl:if>
<!-- var objRegExpS = new RegExp("server port:i:([1-65535]+)", "i");
var iIndexS = strRdpFileContents.search( objRegExp );
Add 'connection type' if it does exist otherwise replace. server port:i:3389
if ( -1 == iIndexS ) {
if ( "\\n" != strRdpFileContents.charAt(strRdpFileContents.length-1) ) {
strRdpFileContents += "\\r\\n";
}
strRdpFileContents += "server port:i:11443\\r\\n";
} else {
strRdpFileContents = strRdpFileContents.replace(objRegExpS, "server port:i:11443");
MsRdpClientShell.RdpFileContents = unescape(strRdpFileContents);
try {
MsRdpClientShell.Launch();
}
catch(e){
throw e;
}
strRdpFileContents = strRdpFileContents.replace("server port", "server prut");
} -->
MsRdpClientShell.RdpFileContents = unescape(strRdpFileContents);
try {
MsRdpClientShell.Launch();
}
catch(e){
throw e;
}
}
function goNonRDP(pid, arg) {
try {
location.href = unescape(arg);
}
catch(e){
throw e;
}
try {
location.href = unescape(arg);
}
catch(e){
throw e;
}
}
<xsl:value-of select="$feedidprefix"/>window_onload();
</script>

View file

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
@ -11,7 +11,7 @@
<!-- Admin Defined settings -->
<appSettings>
<!-- PasswordChangeEnabled: Provides password change page for users. Value must be "true" or "false" -->
<add key="PasswordChangeEnabled" value="false" />
<add key="PasswordChangeEnabled" value="true" />
<!-- LocalHelp: Displays local help for users, instead of the web-based help. Value must be "true" or "false" -->
<add key="LocalHelp" value="false" />
@ -42,12 +42,18 @@
<add key="PrivateModeSessionTimeoutInMinutes" value="240" />
<!-- Checkbox to opt for optimized LAN experience -->
<add key="ShowOptimizeExperience" value="false" />
<add key="ShowOptimizeExperience" value="true" />
<add key="OptimizeExperienceState" value="false" />
<add key="SmsToken" value="true" />
<add key="RadiusServer" value="192.168.121.9" />
<add key="RadiusSecret" value="helloworld" />
<add key="OTP" value="true" />
<add key="EnableSMS" value="true" />
<add key="EnableMail" value="false" />
</appSettings>
<connectionStrings/>
<connectionStrings />
<system.web>
<!--
@ -76,7 +82,7 @@
<webParts>
<personalization defaultProvider="TSPortalProvider">
<providers>
<add name="TSPortalProvider" type="Microsoft.TerminalServices.Publishing.Portal.TSPortalProvider"/>
<add name="TSPortalProvider" type="Microsoft.TerminalServices.Publishing.Portal.TSPortalProvider" />
</providers>
<authorization>
<allow users="*" verbs="enterSharedScope">
@ -89,7 +95,7 @@
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="FormsAuthentication" />
<add name="RDWAFormsAuthenticationModule" type="Microsoft.TerminalServices.Publishing.Portal.FormAuthentication.TSDomainFormsAuthentication" />
<add name="RDWAFormsAuthenticationModule" type="Microsoft.TerminalServices.Publishing.Portal.FormAuthentication.TSFormsAuthentication" />
</modules>
<security>
@ -105,7 +111,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TSPortalWebPart" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="6.0.0.0" newVersion="6.1.0.0"/>
<bindingRedirect oldVersion="6.0.0.0" newVersion="6.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
@ -118,7 +124,7 @@
</system.web>
<system.webServer>
<handlers>
<add name="RDWAResourceFileHandler" path="rdp" verb="*" type="Microsoft.TerminalServices.Publishing.Portal.ResourceFileHandler" preCondition="integratedMode" allowPathInfo="true"/>
<add name="RDWAResourceFileHandler" path="rdp" verb="*" type="Microsoft.TerminalServices.Publishing.Portal.ResourceFileHandler" preCondition="integratedMode" allowPathInfo="true" />
</handlers>
</system.webServer>
</location>

View file

@ -1,2 +1,2 @@
<%@ Page Language="C#" CodeFile="WebFeed.aspx.cs" Inherits="TSWF_PagesVdir.TsWebFeed" Trace="false" %>
<%@ Page Language="C#" CodeFile="WebFeed.aspx.cs" Inherits="TSWF.TsWebFeed" Trace="false" %>
<%=oXML%>

View file

@ -16,7 +16,7 @@ using System.Web.Configuration;
using System.Xml;
using Microsoft.TerminalServices.Publishing.Portal.FormAuthentication;
namespace TSWF_PagesVdir
namespace TSWF
{
public partial class TsWebFeed : System.Web.UI.Page
{
@ -25,7 +25,7 @@ namespace TSWF_PagesVdir
protected void Page_Init(object sender, EventArgs e)
{
AuthenticationMode eAuthenticationMode = AuthenticationMode.None;
string strUserIdentity = "";
string strSid = "";
AuthenticationSection objAuthenticationSection = ConfigurationManager.GetSection("system.web/authentication") as AuthenticationSection;
if ( objAuthenticationSection != null )
@ -37,13 +37,12 @@ namespace TSWF_PagesVdir
{
if ( HttpContext.Current.User.Identity.IsAuthenticated == false )
{
Uri baseUrl = new Uri(PageContentsHelper.GetBaseUri(Context), Request.FilePath + "/..");
string queryString = PageContentsHelper.AppendTenantIdToQuery("?ReturnUrl=../WebFeed.aspx");
Response.Redirect(baseUrl.ToString() + "default.aspx" + queryString);
Uri baseUrl = new Uri(Request.Url, Request.FilePath + "/..");
Response.Redirect(baseUrl.ToString() + "default.aspx?ReturnUrl=../WebFeed.aspx");
}
TSFormAuthTicketInfo objTSFormAuthTicketInfo = new TSFormAuthTicketInfo(HttpContext.Current);
strUserIdentity = objTSFormAuthTicketInfo.UserIdentity;
strSid = objTSFormAuthTicketInfo.UserSid;
//
// TODO: Need to correctly call this
//
@ -71,19 +70,14 @@ namespace TSWF_PagesVdir
try
{
WebFeed tswf = new WebFeed(rdpEmbed ? RdpType.Both : RdpType.Link, false);
oXML = tswf.GenerateFeed(strUserIdentity, xmlVersion, Request.PathInfo, true);
WebFeed tswf = new WebFeed(rdpEmbed ? RdpType.Both : RdpType.Link);
oXML = tswf.GenerateFeed(strSid, xmlVersion, Request.PathInfo, true);
}
catch (WorkspaceUnknownFolderException)
{
Response.StatusCode = 404;
Response.End();
}
catch (InvalidTenantException)
{
Response.StatusCode = 404;
Response.End();
}
catch (WorkspaceUnavailableException wue)
{
// This exception is raised when we cannot contact the appropriate sources to obtain the workspace information.
@ -95,5 +89,7 @@ namespace TSWF_PagesVdir
Response.End();
}
}
}
}

View file

@ -34,7 +34,7 @@
public bool bShowOptimizeExperience = false, bOptimizeExperienceState = false;
public AuthenticationMode eAuthenticationMode = AuthenticationMode.None;
public string strTicketName = "";
public string strDomainUserName = "", strUserIdentity = "";
public string strDomainUserName = "", strUserSID = "";
public string strAppFeed;
public WorkspaceInfo objWorkspaceInfo = null;
@ -45,9 +45,9 @@
string strReturnUrl = "";
string strReturnUrlPage = "";
// gives us https://<hostname>[:port]/rdweb/pages/<lang>/
baseUrl = new Uri(new Uri(PageContentsHelper.GetBaseUri(Context), Request.FilePath), ".");
// gives us https://<machine>/rdweb/pages/<lang>/
// baseUrl = new Uri(new Uri(Request.Url, Request.FilePath), ".");
baseUrl = new Uri(new Uri(GetRealRequestUri(), Request.FilePath), ".");
try
{
string strShowOptimzeExperienceValue = ConfigurationManager.AppSettings["ShowOptimizeExperience"];
@ -90,25 +90,25 @@
if ( eAuthenticationMode == AuthenticationMode.Forms )
{
if ( HttpContext.Current.User.Identity.IsAuthenticated == false )
if ( HttpContext.Current.User.Identity.IsAuthenticated == false | (string)Session["SMSTOKEN"] == "NOT_SMS_AUTH" )
{
string strQueryString;
if (String.IsNullOrEmpty(strReturnUrl))
{
strQueryString = "?ReturnUrl=" + Request.Path;
Response.Redirect(new Uri(baseUrl,"login.aspx?ReturnUrl=" + Request.Path).AbsoluteUri);
}
else
{
strQueryString = strReturnUrl;
Response.Redirect(new Uri(baseUrl, "login.aspx" + strReturnUrl).AbsoluteUri);
}
Response.Redirect(new Uri(baseUrl, "login.aspx" + PageContentsHelper.AppendTenantIdToQuery(strQueryString)).AbsoluteUri);
}
TSFormAuthTicketInfo objTSFormAuthTicketInfo = new TSFormAuthTicketInfo(HttpContext.Current);
strUserIdentity = objTSFormAuthTicketInfo.UserIdentity;
strUserSID = objTSFormAuthTicketInfo.UserSid;
bPrivateMode = objTSFormAuthTicketInfo.PrivateMode;
strDomainUserName = objTSFormAuthTicketInfo.DomainUserName;
if ( bPrivateMode == true )
{
@ -163,9 +163,9 @@
WebFeed tswf = null;
try
{
tswf = new WebFeed(RdpType.Both, true);
tswf = new WebFeed(RdpType.Both);
strAppFeed = tswf.GenerateFeed(
strUserIdentity,
strUserSID,
FeedXmlVersion.Win8,
(Request.PathInfo.Length > 0) ? Request.PathInfo : "/",
false);
@ -174,11 +174,6 @@
{
BadFolderRedirect();
}
catch (InvalidTenantException)
{
Response.StatusCode = 404;
Response.End();
}
catch (WorkspaceUnavailableException wue)
{
// This exception is raised when we cannot contact the appropriate sources to obtain the workspace information.
@ -206,6 +201,30 @@
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
public static Uri GetRealRequestUri()
{
if ((HttpContext.Current == null) ||
(HttpContext.Current.Request == null))
throw new ApplicationException("Cannot get current request.");
return GetRealRequestUri(HttpContext.Current.Request);
}
public static Uri GetRealRequestUri(HttpRequest request)
{
if (String.IsNullOrEmpty(request.Headers["Host"]))
return request.Url;
UriBuilder ub = new UriBuilder(request.Url);
string[] realHost = request.Headers["Host"].Split(':');
string host = realHost[0];
ub.Host = host;
string portString = realHost.Length > 1 ? realHost[1] : "";
int port;
if (int.TryParse(portString, out port))
ub.Port = port;
return ub.Uri;
}
private void BadFolderRedirect()
{
Response.ContentType = "text/html";
@ -217,11 +236,14 @@
</head>
<body>
<p id=""BadFolder1"">" + L_BadFolderErrorBody_Text + @"</p>
</body>
</html>");
Response.End();
}
</script>
<%="<?xml-stylesheet type=\"text/xsl\" href=\"" + SecurityElement.Escape(stylesheetUrl.AbsoluteUri) + "\"?>"%>
<%="<?xml-stylesheet type=\"text/css\" href=\"" + SecurityElement.Escape(renderFailCssUrl.AbsoluteUri) + "\"?>"%>
@ -242,6 +264,7 @@
<p><%=L_RenderFailP1_Text%></p>
<p><%=L_RenderFailP2_Text%></p>
<p><%=L_RenderFailP3_Text%></p>
</body>
</html>
</RenderFailureMessage>
@ -518,6 +541,7 @@
background-color:white;
}
</Style>
<AppFeed
showpubliccheckbox="<%=bShowPublicCheckBox.ToString().ToLower()%>"
privatemode="<%=bPrivateMode.ToString().ToLower()%>"
@ -531,6 +555,9 @@
}
%>
>
<%=strAppFeed%>
</AppFeed>
</RDWAPage>

View file

@ -108,8 +108,8 @@
Response.End();
}
// gives us https://<hostname>[:port]/rdweb/pages/<lang>/
baseUrl = new Uri(new Uri(PageContentsHelper.GetBaseUri(Context), Request.FilePath), ".");
// gives us https://<machine>/rdweb/pages/<lang>/
baseUrl = new Uri(new Uri(Request.Url, Request.FilePath), ".");
AuthenticationSection objAuthenticationSection = ConfigurationManager.GetSection("system.web/authentication") as AuthenticationSection;
if ( objAuthenticationSection != null )
@ -155,7 +155,7 @@
}
}
objWorkspaceInfo = PageContentsHelper.GetWorkspaceInfo();
objWorkspaceInfo = RdwaConfig.GetWorkspaceInfo();
if ( objWorkspaceInfo != null )
{
string strWorkspaceName = objWorkspaceInfo.WorkspaceName;

View file

@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="cook.aspx.cs" Inherits="Pages_en_US_cook" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>

View file

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Pages_en_US_cook : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie myCookie = new HttpCookie("RadiusSessionId");
DateTime now = DateTime.Now;
// Set the cookie value.
myCookie.Value = now.ToString();
// Set the cookie expiration date.
myCookie.Expires = now.AddMinutes(480);
// Add the cookie.
Response.Cookies.Add(myCookie);
Response.Write("<p> The cookie has been written.");
}
}

View file

@ -6,13 +6,14 @@
<% @Import Namespace="System.Security" %>
<% @Import Namespace="Microsoft.TerminalServices.Publishing.Portal.FormAuthentication" %>
<% @Import Namespace="Microsoft.TerminalServices.Publishing.Portal" %>
<% @Import Namespace="RadiusClient" %>
<script language="C#" runat=server>
//
// Customizable Text
//
string L_CompanyName_Text = "Work Resources";
//
// Localizable Text
//
@ -25,6 +26,8 @@
const string L_ExistingWorkspaceLabel_Text = "Another user of your computer is currently using this connection. This user must disconnect before you can log on.";
const string L_DisconnectedWorkspaceLabel_Text = "Another user of your computer has disconnected from this connection. Please type your user name and password again.";
const string L_LogonFailureLabel_Text = "The user name or password that you entered is not valid. Try typing it again.";
const string L_LogonSMSFailureLabel_Text = "The token code that you entered is not valid. Try again.";
const string L_LogonRadiusFailureLabel_Text = "The radius server did not respond. Check radius configuration or give it another try.";
const string L_DomainNameMissingLabel_Text = "You must enter a valid domain name.";
const string L_AuthorizationFailureLabel_Text = "You arent authorized to log on to this connection. Contact your system administrator for authorization.";
const string L_ServerConfigChangedLabel_Text = "Your RD Web Access session expired due to configuration changes on the remote computer. Please sign in again.";
@ -42,27 +45,24 @@
const string L_RenderFailTitle_Text = "Error: Unable to display RD Web Access";
const string L_RenderFailP1_Text = "An unexpected error has occurred that is preventing this page from being displayed correctly.";
const string L_RenderFailP2_Text = "Viewing this page in Internet Explorer with the Enhanced Security Configuration enabled can cause such an error.";
const string L_RenderFailP3_Text = "Please try loading this page without the Enhanced Security Configuration enabled. If this error continues to be displayed, please contact your administrator.";
const string L_GenericClaimsAuthErrorLabel_Text = "We can't sign you in right now. Please try again later.";
const string L_WrongAxVersionWarningLabel_Text = "You don't have the right version of Remote Desktop Connection to use RD Web Access.";
const string L_ClaimsDomainUserNameLabel_Text = "Username@domain:";
const string L_RenderFailP3_Text = "Please try loading this page without the Enhanced Security Configuration enabled. If this error continues to be displayed, please contact your administrator.";
//
// Page Variables
//
public string strErrorMessageRowStyle;
public bool bFailedLogon = false, bFailedAuthorization = false, bFailedAuthorizationOverride = false, bServerConfigChanged = false, bWorkspaceInUse = false, bWorkspaceDisconnected = false, bPasswordExpired = false, bPasswordExpiredNoChange = false;
public string strDeliveryStyle;
public bool bFailedLogon = false, bFailedAuthorization = false, bServerConfigChanged = false, bWorkspaceInUse = false, bWorkspaceDisconnected = false, bPasswordExpired = false, bPasswordExpiredNoChange = false, bFailedSMSLogon = false, bFailedRadiusLogon = false, bOTP = false;
public string strWorkSpaceID = "";
public string strRDPCertificates = "";
public string strRedirectorName = "";
public string strClaimsHint = "";
public string strReturnUrl = "";
public string strReturnUrlPage = "";
public string strPasswordExpiredQueryString = "";
public string strEventLogUploadAddress = "";
public string sHelpSourceServer, sLocalHelp;
public Uri baseUrl;
public bool bEnableSMS = false;
public bool bEnableMail = false;
public string strPrivateModeTimeout = "240";
public string strPublicModeTimeout = "20";
@ -78,8 +78,9 @@
Response.End();
}
// gives us https://<hostname>[:port]/rdweb/pages/<lang>/
baseUrl = new Uri(new Uri(PageContentsHelper.GetBaseUri(Context), Request.FilePath), ".");
// gives us https://<machine>/rdweb/pages/<lang>/
// baseUrl = new Uri(new Uri(Request.Url, Request.FilePath), ".");
baseUrl = new Uri(new Uri(GetRealRequestUri(), Request.FilePath), ".");
sLocalHelp = ConfigurationManager.AppSettings["LocalHelp"];
if ((sLocalHelp != null) && (sLocalHelp == "true"))
@ -99,17 +100,88 @@
catch (Exception objException)
{
}
try
{
if (ConfigurationManager.AppSettings["OTP"].ToString().Equals("true", StringComparison.CurrentCultureIgnoreCase))
{
bOTP = true;
}
else
{
bOTP = false;
}
}
catch (Exception objException)
{
bOTP = false;
}
try
{
if (ConfigurationManager.AppSettings["EnableSMS"].ToString().Equals("true", StringComparison.CurrentCultureIgnoreCase))
{
bEnableSMS = true;
}
else
{
bEnableSMS = false;
}
}
catch (Exception objException)
{
bEnableSMS = false;
}
try
{
if (ConfigurationManager.AppSettings["EnableMail"].ToString().Equals("true", StringComparison.CurrentCultureIgnoreCase))
{
bEnableMail = true;
}
else
{
bEnableMail = false;
}
}
catch (Exception objException)
{
bEnableMail = false;
}
}
void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Session["UserPass"] = "";
Session["DomainUserName"] = "";
}
if ( Request.QueryString != null )
{
NameValueCollection objQueryString = Request.QueryString;
if ( objQueryString["ReturnUrl"] != null )
{
strReturnUrlPage = objQueryString["ReturnUrl"];
strReturnUrl = "?ReturnUrl=" + HttpUtility.UrlEncode(strReturnUrlPage);
string strSmsToken = ConfigurationManager.AppSettings["SmsToken"];
if (strSmsToken == null || !(strSmsToken.Equals("true", StringComparison.CurrentCultureIgnoreCase)))
{
strReturnUrlPage = objQueryString["ReturnUrl"];
strReturnUrl = "?ReturnUrl=" + HttpUtility.UrlEncode(strReturnUrlPage);
}
else
{
strReturnUrlPage = objQueryString["ReturnUrl"].ToLower();
strReturnUrl = "?ReturnUrl=" + HttpUtility.UrlEncode(strReturnUrlPage.Replace("default.aspx", "smstoken.aspx"));
}
}
if ( objQueryString["Error"] != null )
{
@ -125,10 +197,13 @@
{
bFailedAuthorization = true;
}
else if ( objQueryString["Error"].Equals("UnauthorizedAccessOverride", StringComparison.CurrentCultureIgnoreCase) )
else if (objQueryString["Error"].Equals("LoginSMSFailed", StringComparison.CurrentCultureIgnoreCase))
{
bFailedAuthorization = true;
bFailedAuthorizationOverride = true;
bFailedSMSLogon = true;
}
else if (objQueryString["Error"].Equals("LoginRadiusFailed", StringComparison.CurrentCultureIgnoreCase))
{
bFailedRadiusLogon = true;
}
else if ( objQueryString["Error"].Equals("ServerConfigChanged", StringComparison.CurrentCultureIgnoreCase) )
{
@ -182,7 +257,7 @@
if ( HttpContext.Current.User.Identity.IsAuthenticated != true )
{
// Only do this if we are actually rendering the login page, if we are just redirecting there is no need for these potentially expensive calls
objWorkspaceInfo = PageContentsHelper.GetWorkspaceInfo();
objWorkspaceInfo = RdwaConfig.GetWorkspaceInfo();
if ( objWorkspaceInfo != null )
{
strWorkSpaceID = objWorkspaceInfo.WorkspaceId;
@ -192,18 +267,31 @@
{
L_CompanyName_Text = strWorkspaceName;
}
if (!String.IsNullOrEmpty(objWorkspaceInfo.EventLogUploadAddress))
{
strEventLogUploadAddress = objWorkspaceInfo.EventLogUploadAddress;
}
}
strRDPCertificates = PageContentsHelper.GetRdpSigningCertificateHash();
strClaimsHint = PageContentsHelper.GetClaimsHint();
strRDPCertificates = RdwaConfig.GetRdpSigningCertificateHash();
}
if ( HttpContext.Current.User.Identity.IsAuthenticated == true )
{
SafeRedirect(strReturnUrlPage);
// if ((string)Session["SMSTOKEN"] == "NOT_SMS_AUTH")
// {
// bFailedLogon = false;
// Session["SMSTOKEN"] = "";
// }
// else
// {
string strSmsToken = ConfigurationManager.AppSettings["SmsToken"];
if (strSmsToken == null || !(strSmsToken.Equals("true", StringComparison.CurrentCultureIgnoreCase)))
{
SafeRedirect(strReturnUrlPage);
}
else
{
Session["SMSTOKEN"] = "NOT_SMS_AUTH";
SafeRedirect(strReturnUrlPage);
}
// }
}
else if ( HttpContext.Current.Request.HttpMethod.Equals("POST", StringComparison.CurrentCultureIgnoreCase) == true )
{
@ -218,14 +306,33 @@
{
bFailedLogon = false;
}
if (bFailedAuthorizationOverride)
{
bFailedLogon = false;
}
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
public static Uri GetRealRequestUri()
{
if ((HttpContext.Current == null) ||
(HttpContext.Current.Request == null))
throw new ApplicationException("Cannot get current request.");
return GetRealRequestUri(HttpContext.Current.Request);
}
public static Uri GetRealRequestUri(HttpRequest request)
{
if (String.IsNullOrEmpty(request.Headers["Host"]))
return request.Url;
UriBuilder ub = new UriBuilder(request.Url);
string[] realHost = request.Headers["Host"].Split(':');
string host = realHost[0];
ub.Host = host;
string portString = realHost.Length > 1 ? realHost[1] : "";
int port;
if (int.TryParse(portString, out port))
ub.Port = port;
return ub.Uri;
}
private void SafeRedirect(string strRedirectUrl)
{
@ -233,12 +340,11 @@
if (!String.IsNullOrEmpty(strRedirectUrl))
{
Uri baseUrl = PageContentsHelper.GetBaseUri(Context);
Uri redirectUri = new Uri(new Uri(baseUrl, Request.FilePath), strRedirectUrl + PageContentsHelper.AppendTenantIdToQuery(String.Empty));
Uri redirectUri = new Uri(GetRealRequestUri(), strRedirectUrl);
if (
redirectUri.Authority.Equals(baseUrl.Authority) &&
redirectUri.Scheme.Equals(baseUrl.Scheme)
redirectUri.Authority.Equals(Request.Url.Authority) &&
redirectUri.Scheme.Equals(Request.Url.Scheme)
)
{
strRedirectSafeUrl = redirectUri.AbsoluteUri;
@ -248,11 +354,26 @@
if (strRedirectSafeUrl == null)
{
strRedirectSafeUrl = "default.aspx" + PageContentsHelper.AppendTenantIdToQuery(String.Empty);
}
string strSmsToken = ConfigurationManager.AppSettings["SmsToken"];
if (strSmsToken == null || !(strSmsToken.Equals("true", StringComparison.CurrentCultureIgnoreCase)))
{
strRedirectSafeUrl = "default.aspx";
} else
{
string UserPass = Request.Form["UserPass"];
string DomainUserName =Request.Form["DomainUserName"];
string Delivery = Request.Form["rDelivery"];
Session["UserPass"] = UserPass;
Session["DomainUserName"]= DomainUserName;
Session["Delivery"] = Delivery;
strRedirectSafeUrl = "smstoken.aspx";
}
}
Response.Redirect(strRedirectSafeUrl);
}
</script>
<RDWAPage
helpurl="<%=sHelpSourceServer%>"
@ -278,35 +399,21 @@
onunload="onPageUnload(event)"/>
<HTMLMainContent>
<form id="FrmLogin" name="FrmLogin" action="login.aspx<%=SecurityElement.Escape(PageContentsHelper.AppendTenantIdToQuery(strReturnUrl))%>" method="post" onsubmit="return onLoginFormSubmit()">
<form id="FrmLogin" name="FrmLogin" action="login.aspx<%=SecurityElement.Escape(strReturnUrl)%>" method="post" onsubmit="return onLoginFormSubmit()">
<input type="hidden" name="WorkSpaceID" value="<%=SecurityElement.Escape(strWorkSpaceID)%>"/>
<input type="hidden" name="RDPCertificates" value="<%=SecurityElement.Escape(strRDPCertificates)%>"/>
<input type="hidden" name="PublicModeTimeout" value="<%=SecurityElement.Escape(strPublicModeTimeout)%>"/>
<input type="hidden" name="PrivateModeTimeout" value="<%=SecurityElement.Escape(strPrivateModeTimeout)%>"/>
<input type="hidden" name="WorkspaceFriendlyName" value="<%=SecurityElement.Escape(L_CompanyName_Text)%>"/>
<input type="hidden" name="EventLogUploadAddress" value="<%=SecurityElement.Escape(strEventLogUploadAddress)%>"/>
<input type="hidden" name="RedirectorName" value="<%=SecurityElement.Escape(strRedirectorName)%>"/>
<input type="hidden" name="ClaimsHint" value="<%=SecurityElement.Escape(strClaimsHint)%>"/>
<input type="hidden" name="ClaimsToken" value=""/>
<input name="isUtf8" type="hidden" value="1"/>
<input type="hidden" name="flags" value="0"/>
<table id="tableLoginDisabled" width="300" border="0" align="center" cellpadding="0" cellspacing="0" style="display:none">
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_WrongAxVersionWarningLabel_Text%></span></td>
</tr>
<tr>
<td height="50">&#160;</td>
</tr>
</table>
<table id="tableLoginForm" width="300" border="0" align="center" cellpadding="0" cellspacing="0" style="display:none">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20">&#160;</td>
@ -316,8 +423,7 @@
<td>
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="tdDomainUserNameLabel" width="130" align="right" style="display:none"><%=L_DomainUserNameLabel_Text%></td>
<td id="tdClaimsDomainUserNameLable" width="130" align="right" style="display:none"><%=L_ClaimsDomainUserNameLabel_Text%></td>
<td width="130" align="right"><%=L_DomainUserNameLabel_Text%></td>
<td width="7"></td>
<td align="right">
<label><input id="DomainUserName" name="DomainUserName" type="text" class="textInputField" runat="server" size="25" autocomplete="off" /></label>
@ -344,6 +450,42 @@
</td>
</tr>
<%
strDeliveryStyle = "style=\"display:none\"";
if ( bOTP )
{
strDeliveryStyle = "style=\"display:\"";
}
%>
<td height="7"></td>
<tr id="trDelivery" <%=strDeliveryStyle%> >
<td>
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="105" align="right">Token delivery:</td>
<td width="7"></td>
<td align="left" width="170">
<% if (bEnableSMS == true) { %>
<label> <input name="rDelivery" type="radio" size="25" value="SMS"
checked="checked"/>SMS</label>
<%} %>
<% if (bEnableMail == true) { %>
<% if (bEnableSMS == true) { %>
<label> <input name="rDelivery" type="radio" size="25" value="EMAIL"/>E-Mail </label>
<%} else { %>
<label> <input name="rDelivery" type="radio" size="25" value="EMAIL" checked="checked"/>E-Mail </label>
<%} %>
<%} %>
</td>
</tr>
</table>
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bPasswordExpiredNoChange == true)
@ -424,6 +566,46 @@
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bFailedSMSLogon == true )
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="tr1" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_LogonSMSFailureLabel_Text%></span></td>
</tr>
</table>
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bFailedRadiusLogon == true )
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="tr2" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_LogonRadiusFailureLabel_Text%></span></td>
</tr>
</table>
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bFailedLogon == true )
@ -457,9 +639,11 @@
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bFailedAuthorization || bFailedAuthorizationOverride )
if ( bFailedAuthorization )
{
strErrorMessageRowStyle = "style=\"display:\"";
}
@ -497,19 +681,6 @@
</td>
</tr>
<tr id="trErrorGenericClaimsAuthFailure" style="display:none" >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_GenericClaimsAuthErrorLabel_Text%></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="20">&#160;</td>
</tr>
@ -543,8 +714,8 @@
<td><%=L_PublicLabel_Text%></td>
</tr>
<tr id="trPubExp" style="display:none" >
<td width="30"></td>
<td><span class="expl"><%=L_PublicExplanationLabel_Text%></span></td>
<td width="30"></td>
<td><span class="expl"><%=L_PublicExplanationLabel_Text%></span></td>
</tr>
<tr>
<td height="7"></td>
@ -563,8 +734,8 @@
<td><%=L_PrivateLabel_Text%></td>
</tr>
<tr id="trPrvtExp" style="display:none" >
<td width="30"></td>
<td><span class="expl"><%=L_PrivateExplanationLabel_Text%></span></td>
<td width="30"></td>
<td><span class="expl"><%=L_PrivateExplanationLabel_Text%></span></td>
</tr>
<tr>
<td height="7"></td>

View file

@ -15,7 +15,7 @@
if ( HttpContext.Current.User.Identity.IsAuthenticated == true )
{
Response.Redirect( "default.aspx" + AppendTenantIdToQuery(String.Empty) );
Response.Redirect( "default.aspx" );
}
else
{
@ -32,34 +32,19 @@
else if ( objQueryString["Error"].Equals("WkSDisconnected", StringComparison.CurrentCultureIgnoreCase) )
{
strQueryString = "?Error=WkSDisconnected";
}
else if ( objQueryString["Error"].Equals("LoginSMSFailed", StringComparison.CurrentCultureIgnoreCase) )
{
strQueryString = "?Error=LoginSMSFailed";
}
else if ( objQueryString["Error"].Equals("LoginRadiusFailed", StringComparison.CurrentCultureIgnoreCase) )
{
strQueryString = "?Error=LoginRadiusFailed";
}
}
}
Response.Redirect( "login.aspx" + AppendTenantIdToQuery(strQueryString) );
Response.Redirect( "login.aspx" + strQueryString );
}
}
// BUGBUG: Temporary workaround while we need to expose the tenant ID as a query string to end-users
private const string tenantIdLabel = "tenantId";
public static string AppendTenantIdToQuery(string strQueryString)
{
if(HttpContext.Current.Request.QueryString != null)
{
if(!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString[tenantIdLabel]))
{
string strTenantIdParams = tenantIdLabel + "=" + HttpUtility.UrlEncode(HttpContext.Current.Request.QueryString[tenantIdLabel]);
if(String.IsNullOrEmpty(strQueryString))
{
return "?" + strTenantIdParams;
}
else
{
return strQueryString + "&" + strTenantIdParams;
}
}
}
return strQueryString;
}
</script>

Binary file not shown.

View file

@ -0,0 +1,33 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="token.aspx.cs" Inherits="Pages_en_US_token" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function doSomething() {
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
</div>
</form>
</body>
</html>

View file

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RadiusClient;
using System.Configuration;
public partial class Pages_en_US_token : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string tmpUser = Request.QueryString["User"];
string DomainUserName = tmpUser.Replace("UserName:s:", "");
// Label1.Text = DomainUserName;
HttpCookie myCookie = new HttpCookie("RadiusSessionId");
myCookie = Request.Cookies["RadiusSessionId"];
// Read the cookie information and display it.
if (myCookie != null)
{
string RadiusServer = ConfigurationManager.AppSettings["RadiusServer"];
string RadiusSecret = ConfigurationManager.AppSettings["RadiusSecret"];
Radius_Client myRadius = new Radius_Client(RadiusServer, 1812);
RADIUSPacket rp = default(RADIUSPacket);
VendorSpecificAttribute vsa = new VendorSpecificAttribute(VendorSpecificType.Generic, "LAUNCH");
RADIUSAttributes atts = new RADIUSAttributes();
// Dim ost As New RADIUSAttribute(RadiusAttributeType.VendorSpecific, att.VendorName & att.VendorType & att.VendorValue)
vsa.SetRADIUSAttribute(ref atts);
// RADIUSAttribute AppLaunch = new RADIUSAttribute(RadiusAttributeType.VendorSpecific, "LAUNCH");
//RADIUSAttribute AppLaunch = new RADIUSAttribute(RadiusAttributeType.VendorSpecific, att.VendorName + att.VendorType + att.VendorValue);
// atts.Add(AppLaunch);
// myRadius.Debug = true;
try
{
rp = myRadius.Authenticate(RadiusSecret, DomainUserName, myCookie.Value, atts);
if ((int)rp.Code == 2)
{
Response.Write("Ready to launch application. Granted access!");
}
else
{
Response.Write("Failure to authenticate session launch");
}
}
catch (Exception ex)
{
Response.Write("Exception!! failure. " + ex.Message);
}
// Response.Write("<p>" + myCookie.Name + "<p>" + myCookie.Value);
}
else
{
// redrect to login Response.Write("not found");
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before After
Before After

View file

@ -4,7 +4,6 @@ var strTransparentGif = "../images/clear.gif";
var g_objWorkspace = null;
var g_activeXSSOMode = false;
var g_activeXSSOModeSet = false;
var g_workspaceObjectVersion = -1;
var bFormAuthenticationMode = false;
var iSessionTimeout = 0;
var iConstSecToMilliSec = 1000;
@ -94,11 +93,11 @@ function onAuthenticatedPageload(e)
function onClickHelp()
{
if ( helpPopup == null || helpPopup.closed == true )
{
helpPopup = window.open( sHelpSource,
"_blank",
"height=600px, width=600px, left=600, top=150, toolbar=no, resizable=yes, scrollbars=yes, menubar=no" );
if ( helpPopup == null || helpPopup.closed == true )
{
helpPopup = window.open( sHelpSource,
"_blank",
"height=600px, width=600px, left=600, top=150, toolbar=no, resizable=yes, scrollbars=yes, menubar=no" );
}
else
{
@ -107,6 +106,125 @@ function onClickHelp()
}
}
function onLoginFormSubmit()
{
var bStopSubmission = false;
var iErrorCode;
var objWorkspace = null;
var objForm = document.getElementById("FrmLogin");
var strDomainName = null;
var strDomainUserName = "";
var strPassword = "";
var strWorkspaceId = "";
var strWorkspaceFriendlyName = "";
var strRedirectorName = "";
var strRDPCertificates = "";
var bPrivateMode = document.getElementById("rdoPrvt").checked;
var strTimeout = "0";
hideElement(document.getElementById("trErrorWorkSpaceInUse"));
hideElement(document.getElementById("trErrorWorkSpaceDisconnected"));
hideElement(document.getElementById("trErrorIncorrectCredentials"));
hideElement(document.getElementById("trErrorDomainNameMissing"));
hideElement(document.getElementById("trErrorUnauthorizedAccess"));
hideElement(document.getElementById("trErrorServerConfigChanged"));
if ( objForm != null )
{
strDomainUserName = objForm.elements["DomainUserName"].value;
strPassword = objForm.elements["UserPass"].value;
strWorkspaceId = objForm.elements["WorkSpaceID"].value;
strRDPCertificates = objForm.elements["RDPCertificates"].value;
strWorkspaceFriendlyName = objForm.elements["WorkspaceFriendlyName"].value;
strRedirectorName = objForm.elements["RedirectorName"].value;
if( bPrivateMode )
{
strTimeout = objForm.elements["PrivateModeTimeout"].value;
}
else
{
strTimeout = objForm.elements["PublicModeTimeout"].value;
}
if ( -1 != strDomainUserName.indexOf("\\") )
{
strDomainName = strDomainUserName.substring( 0, strDomainUserName.indexOf("\\") );
}
else if ( -1 != strDomainUserName.indexOf("@") )
{
strDomainName = strDomainUserName.substring( strDomainUserName.indexOf("@") + 1, strDomainUserName.length );
}
}
if ( strDomainUserName == null || strDomainUserName == "" ||
strPassword == null || strPassword == "" )
{
showElement(document.getElementById("trErrorIncorrectCredentials"));
bStopSubmission = true;
}
else if ( strDomainName == null || strDomainName == "" || strDomainName == "." )
{
showElement(document.getElementById("trErrorDomainNameMissing"));
bStopSubmission = true;
}
else
{
if (strWorkspaceId != null &&
strWorkspaceId != "" &&
GetActiveXSSOMode())
{
try
{
objWorkspace = GetWorkspaceObject2();
if (objWorkspace != null)
{
objWorkspace.StartWorkspaceEx(
strWorkspaceId,
strWorkspaceFriendlyName,
strRedirectorName,
strDomainUserName,
strPassword,
strRDPCertificates,
parseInt(strTimeout),
0 );
}
else
{
objWorkspace = GetWorkspaceObject();
objWorkspace.StartWorkspace(
strWorkspaceId,
strDomainUserName,
strPassword,
strRDPCertificates,
parseInt(strTimeout),
0);
}
}
catch (objException)
{
objWorkspace = null;
iErrorCode = (objException.number & 0xFFFF);
//
// 183 = ERROR_ALREADY_EXISTS.
//
if ( iErrorCode == 183 )
{
showElement(document.getElementById("trErrorWorkSpaceInUse"));
bStopSubmission = true;
}
}
}
}
// return false to stop form submission
return !bStopSubmission;
}
function onAutoDisconnect()
{
if ( bAsyncPageRequestSucceeded )
@ -140,7 +258,7 @@ function onAutoDisconnect()
}
}
window.location = strBaseUrl + "LogOff.aspx" + window.location.search;
window.location = strBaseUrl + "LogOff.aspx";
}
function onUserDisconnect()
@ -171,7 +289,7 @@ function onUserDisconnect()
}
}
window.location = strBaseUrl + "LogOff.aspx" + window.location.search;
window.location = strBaseUrl + "LogOff.aspx";
}
function onClickSecurity() {
@ -298,6 +416,66 @@ function getCookieCrumbValue(strCookieContents, strCookieCrumbName)
return strCookieCrumbValue;
}
function onLoginPageLoad(e)
{
var strDomainUserName = ""; // CrumbName: Name
var strMachineType = ""; // CrumbName: MachineType
var strWorkSpaceID = ""; // CrumbName: WorkSpaceID
var strCookieContents = "";
var iIndex;
var bActiveXSSOMode = GetActiveXSSOMode(); // as a side-effect, this caches the workspace ActiveX object
onPageload(e); // call the parent event
if (bActiveXSSOMode) {
document.getElementById("tablePublicOption").style.display = "";
document.getElementById("tablePrivateOption").style.display = "";
document.getElementById("spanToggleSecExplanation").style.display = "";
document.getElementById("rdoPblc").checked = true;
}
else {
document.getElementById("trPrvtWrnNoAx").style.display = "";
}
onClickSecurity();
strCookieContents = getCookieContents(strTSWACookieName);
if ( null != strCookieContents )
{
strDomainUserName = decodeURIComponent( getCookieCrumbValue(strCookieContents, "Name") );
strMachineType = getCookieCrumbValue(strCookieContents, "MachineType");
strWorkSpaceID = decodeURIComponent( getCookieCrumbValue(strCookieContents, "WorkSpaceID") );
if ( strMachineType != "" &&
strMachineType == "private")
{
document.getElementById("DomainUserName").value = strDomainUserName;
document.getElementById("rdoPrvt").checked = "private";
onClickSecurity();
}
//
// Set focus on UserName or Password field.
//
if ( strDomainUserName != "" )
{
document.getElementById("UserPass").focus();
}
else
{
document.getElementById("DomainUserName").focus();
}
}
else
{
document.getElementById("DomainUserName").focus();
}
}
function onAuthenticated()
{
var iErrorCode;
@ -324,11 +502,6 @@ function onAuthenticated()
return;
}
var strQueryStringPreamble = "?";
if (window.location.search) {
strQueryStringPreamble = window.location.search + "&";
}
if ( strDomainUserName.toLowerCase() == strLoggedOnDomainUserName.toLowerCase()) {
if (GetActiveXSSOMode()) {
try {
@ -349,13 +522,13 @@ function onAuthenticated()
// 183 = ERROR_ALREADY_EXISTS.
//
if (iErrorCode == 183) {
window.location = strBaseUrl + "LogOff.aspx" + strQueryStringPreamble + "Error=WkSInUse";
window.location = strBaseUrl + "LogOff.aspx?Error=WkSInUse";
}
//
// 1168 = ERROR_NOT_FOUND.
//
if (iErrorCode == 1168) {
window.location = strBaseUrl + "LogOff.aspx" + strQueryStringPreamble + "Error=WkSDisconnected";
window.location = strBaseUrl + "LogOff.aspx?Error=WkSDisconnected";
}
}
}
@ -366,47 +539,42 @@ function onAuthenticated()
//
// Ideally check workspace state before redirecting; if it has been authenticatd as well.
//
window.location = strBaseUrl + "LogOff.aspx" + strQueryStringPreamble + "Error=WkSInUse";
window.location = strBaseUrl + "LogOff.aspx?Error=WkSInUse";
}
}
}
function GetWorkspaceObject()
{
var objClientShell = null;
if( g_objWorkspace == null )
{
var objClientShell = new ActiveXObject("MsRdpWebAccess.MsRdpClientShell");
g_objWorkspace = objClientShell.MsRdpWorkspace3;
if(g_objWorkspace != null)
g_objWorkspace = GetWorkspaceObject2();
if (g_objWorkspace == null)
{
g_workspaceObjectVersion = 3;
}
else
{
g_objWorkspace = objClientShell.MsRdpWorkspace2;
if(g_objWorkspace != null)
{
g_workspaceObjectVersion = 2;
}
else
{
g_objWorkspace = objClientShell.MsRdpWorkspace;
if(g_objWorkspace != null)
{
g_workspaceObjectVersion = 1;
}
else
{
g_workspaceObjectVersion = 0;
}
}
objClientShell = new ActiveXObject("MsRdpWebAccess.MsRdpClientShell");
g_objWorkspace = objClientShell.MsRdpWorkspace;
}
}
return g_objWorkspace;
}
function GetWorkspaceObject2()
{
var objClientShell = null;
g_objWorkspace = null;
objClientShell = new ActiveXObject("MsRdpWebAccess.MsRdpClientShell");
g_objWorkspace = objClientShell.MsRdpWorkspace2;
return g_objWorkspace;
}
function GetActiveXSSOMode() {
if (!g_activeXSSOModeSet) {
@ -426,19 +594,6 @@ function GetActiveXSSOMode() {
return g_activeXSSOMode;
}
function GetWorkspaceObjectVersion()
{
if (g_workspaceObjectVersion == -1) {
try {
GetWorkspaceObject();
}
catch (objException) {
}
}
return g_workspaceObjectVersion;
}
function ApplyPngTransparency()
{
var objDocumentElements = document.all;

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://schemas.microsoft.com/ts/2007/05/tswf" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/ts/2007/05/tswf" xmlns:mstns="http://schemas.microsoft.com/ts/2007/05/tswf" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.1">
<xs:schema targetNamespace="http://schemas.microsoft.com/ts/2007/05/tswf" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/ts/2007/05/tswf" xmlns:mstns="http://schemas.microsoft.com/ts/2007/05/tswf" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
<xs:element name="ResourceCollection" type="ResourceCollectionType" />
<xs:complexType name="ResourceCollectionType">
<xs:sequence>
@ -113,7 +113,6 @@
</xs:attribute>
<xs:attribute name="RequiredCommandLine" type="xs:string" />
<xs:attribute name="ExecutableName" type="xs:string" />
<xs:attribute name="ShowByDefault" type="xs:boolean" />
<xs:anyAttribute processContents="lax" />
</xs:complexType>
<xs:complexType name="IconType">