Rename: RDSFactorWeb -> web, RDSFactor -> server

This commit is contained in:
Jakob Aarøe Dam 2015-04-28 11:58:23 +02:00
parent c3c10e1fd2
commit eebdaf9551
88 changed files with 12 additions and 11 deletions

View file

@ -0,0 +1,563 @@
<?xml version="1.0" encoding="UTF-8"?>
<% @Page Language="C#" Debug="true" ResponseEncoding="utf-8" ContentType="text/xml" %>
<% @Import Namespace="System.Globalization" %>
<% @Import Namespace="System.Web.Configuration" %>
<% @Import Namespace="System.Security" %>
<% @Import Namespace="Microsoft.TerminalServices.Publishing.Portal.FormAuthentication" %>
<% @Import Namespace="Microsoft.TerminalServices.Publishing.Portal" %>
<script runat="server">
//
// Customizable Text
//
string L_CompanyName_Text = "Work Resources";
//
// Localizable Text
//
const string L_RemoteAppProgramsLabel_Text = "RemoteApp and Desktops";
const string L_DesktopTab_Text = "Connect to a remote PC";
const string L_BadFolderErrorTitle_Text = "Folder does not exist. Redirecting...";
const string L_BadFolderErrorBody_Text = "You have attempted to load a folder that does not exist. In a moment, you will be redirected to the top-level folder.";
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.";
//
// Page Variables
//
public string sHelpSourceServer, sLocalHelp, sRDCInstallUrl, strWorkspaceName;
public Uri baseUrl, stylesheetUrl, renderFailCssUrl;
public bool bShowPublicCheckBox = false, bPrivateMode = false, bRTL = false;
public int SessionTimeoutInMinutes = 0;
public bool bShowOptimizeExperience = false, bOptimizeExperienceState = false;
public AuthenticationMode eAuthenticationMode = AuthenticationMode.None;
public string strTicketName = "";
public string strDomainUserName = "", strUserSID = "";
public string strAppFeed;
public WorkspaceInfo objWorkspaceInfo = null;
protected void Page_PreInit(object sender, EventArgs e)
{
string strReturnUrl = "";
string strReturnUrlPage = "";
// 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"];
if ( String.IsNullOrEmpty(strShowOptimzeExperienceValue) == false )
{
if ( strShowOptimzeExperienceValue.Equals( System.Boolean.TrueString, StringComparison.OrdinalIgnoreCase) )
{
bShowOptimizeExperience = true;
string strOptimizeExperienceStateValue = ConfigurationManager.AppSettings["OptimizeExperienceState"];
if ( String.IsNullOrEmpty(strOptimizeExperienceStateValue) == false )
{
if ( strOptimizeExperienceStateValue.Equals( System.Boolean.TrueString, StringComparison.OrdinalIgnoreCase) )
{
bOptimizeExperienceState = true;
}
}
}
}
}
catch (Exception objException)
{
}
AuthenticationSection objAuthenticationSection = ConfigurationManager.GetSection("system.web/authentication") as AuthenticationSection;
if ( objAuthenticationSection != null )
{
eAuthenticationMode = objAuthenticationSection.Mode;
}
if ( Request.QueryString != null )
{
NameValueCollection objQueryString = Request.QueryString;
if ( objQueryString["ReturnUrl"] != null )
{
strReturnUrlPage = objQueryString["ReturnUrl"];
strReturnUrl = "?ReturnUrl=" + HttpUtility.UrlEncode(strReturnUrlPage);
}
}
if ( eAuthenticationMode == AuthenticationMode.Forms )
{
if ( HttpContext.Current.User.Identity.IsAuthenticated == false | (string)Session["SMSTOKEN"] == "NOT_SMS_AUTH" )
{
if (String.IsNullOrEmpty(strReturnUrl))
{
Response.Redirect(new Uri(baseUrl,"login.aspx?ReturnUrl=" + Request.Path).AbsoluteUri);
}
else
{
Response.Redirect(new Uri(baseUrl, "login.aspx" + strReturnUrl).AbsoluteUri);
}
}
TSFormAuthTicketInfo objTSFormAuthTicketInfo = new TSFormAuthTicketInfo(HttpContext.Current);
strUserSID = objTSFormAuthTicketInfo.UserSid;
bPrivateMode = objTSFormAuthTicketInfo.PrivateMode;
strDomainUserName = objTSFormAuthTicketInfo.DomainUserName;
if ( bPrivateMode == true )
{
try
{
string strPrivateModeSessionTimeoutInMinutes = ConfigurationManager.AppSettings["PrivateModeSessionTimeoutInMinutes"].ToString();
SessionTimeoutInMinutes = Int32.Parse(strPrivateModeSessionTimeoutInMinutes);
}
catch (Exception objException)
{
Console.WriteLine("\nException : " + objException.Message);
SessionTimeoutInMinutes = 240;
}
}
else
{
try
{
string strPublicModeSessionTimeoutInMinutes = ConfigurationManager.AppSettings["PublicModeSessionTimeoutInMinutes"].ToString();
SessionTimeoutInMinutes = Int32.Parse(strPublicModeSessionTimeoutInMinutes);
}
catch (Exception objException)
{
Console.WriteLine("\nException : " + objException.Message);
SessionTimeoutInMinutes = 20;
}
}
}
else if ( eAuthenticationMode == AuthenticationMode.Windows )
{
bShowPublicCheckBox = true;
}
sRDCInstallUrl = ConfigurationManager.AppSettings["rdcInstallUrl"];
sLocalHelp = ConfigurationManager.AppSettings["LocalHelp"];
stylesheetUrl = new Uri(baseUrl, "../Site.xsl");
renderFailCssUrl = new Uri(baseUrl, "../RenderFail.css");
if ((sLocalHelp != null) && (sLocalHelp == "true"))
sHelpSourceServer = "./rap-help.htm";
else
sHelpSourceServer = "http://go.microsoft.com/fwlink/?LinkId=141038";
try {
bRTL = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft;
}
catch( NullReferenceException ) {
}
WebFeed tswf = null;
try
{
tswf = new WebFeed(RdpType.Both);
strAppFeed = tswf.GenerateFeed(
strUserSID,
FeedXmlVersion.Win8,
(Request.PathInfo.Length > 0) ? Request.PathInfo : "/",
false);
}
catch (WorkspaceUnknownFolderException)
{
BadFolderRedirect();
}
catch (WorkspaceUnavailableException wue)
{
// This exception is raised when we cannot contact the appropriate sources to obtain the workspace information.
// This is an edge case that can ocurr e.g. if the cpub server we're pointing to is down and the values are not specified in the Web.config.
Response.StatusCode = 503;
Response.End();
}
if ( tswf != null )
{
objWorkspaceInfo = tswf.GetFetchedWorkspaceInfo();
if ( objWorkspaceInfo != null )
{
strWorkspaceName = objWorkspaceInfo.WorkspaceName;
}
}
if ( String.IsNullOrEmpty(strWorkspaceName ) )
{
strWorkspaceName = L_CompanyName_Text;
}
}
protected void Page_Init(object sender, EventArgs e)
{
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";
Response.Write(
@"<html>
<head>
<meta http-equiv=""refresh"" content=""10;url=" + Request.FilePath + @"""/>
<title>" + L_BadFolderErrorTitle_Text + @"</title>
</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) + "\"?>"%>
<RDWAPage
helpurl="<%=sHelpSourceServer%>"
domainuser="<%=SecurityElement.Escape(strDomainUserName)%>"
workspacename="<%=SecurityElement.Escape(strWorkspaceName)%>"
baseurl="<%=SecurityElement.Escape(baseUrl.AbsoluteUri)%>"
>
<RenderFailureMessage>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><%=L_RenderFailTitle_Text%></title>
</head>
<body>
<h1><%=L_RenderFailTitle_Text%></h1>
<p><%=L_RenderFailP1_Text%></p>
<p><%=L_RenderFailP2_Text%></p>
<p><%=L_RenderFailP3_Text%></p>
</body>
</html>
</RenderFailureMessage>
<HeaderJS>
bFormAuthenticationMode = false;
<% if ( eAuthenticationMode == AuthenticationMode.Forms ) { %>
bFormAuthenticationMode = true;
<% } %>
iSessionTimeout = parseInt("<%=SessionTimeoutInMinutes%>");
</HeaderJS>
<BodyAttr
onload="onAuthenticatedPageload(event)"
onunload="onPageUnload(event)"
onmousedown="onUserActivity(event)"
onmousewheel="onUserActivity(event)"
onscroll="onUserActivity(event)"
onkeydown="onUserActivity(event)" />
<NavBar
<% if ( eAuthenticationMode == AuthenticationMode.Forms ) { %>
showsignout="true"
<% } %>
activetab="PORTAL_REMOTE_PROGRAMS"
>
<Tab id="PORTAL_REMOTE_PROGRAMS" href="Default.aspx"><%=L_RemoteAppProgramsLabel_Text%></Tab>
<%
if (ConfigurationManager.AppSettings["ShowDesktops"].ToString() == "true")
{
%>
<Tab id="PORTAL_REMOTE_DESKTOPS" href="Desktops.aspx"><%=L_DesktopTab_Text%></Tab>
<%
}
%>
</NavBar>
<Style>
.tswa_appboard {width:850px;}
.tswa_ShowOptimizeExperienceShiftedUp
{
position:absolute;
left:10px;
top:397px;
width:850px;
height:20px;
background-color:white;
}
#PORTAL_REMOTE_DESKTOPS
{
display:none;
}
<%
if ( bShowPublicCheckBox )
{
%>
.tswa_ShowOptimizeExperience
{
position:absolute;
left:10px;
top:445px;
width:850px;
height:20px;
background-color:white;
}
<%
}
else
{
%>
.tswa_ShowOptimizeExperience
{
position:absolute;
left:10px;
top:462px;
width:850px;
height:20px;
background-color:white;
}
<%
}
%>
.tswa_PublicCheckboxMore
{
position:absolute;
left:10px;
top:417px;
width:850px;
height:50px;
border-top: 1px solid gray;
background-color:white;
z-index:4000;
padding-top:4px;
}
.tswa_PublicCheckboxLess
{
position:absolute;
left:10px;
top:462px;
width:850px;
height:20px;
background-color:white;
}
<% if (bRTL) { %>
/* Rules that are specific to RTL language environments */
.tswa_appboard
{
padding-right:10px;
}
.tswa_boss, .tswa_folder_boss, .tswa_up_boss
{
float:right;
}
.tswa_error_icon
{
margin-left: 0px;
padding-left: 0px;
margin-right:10px;
padding-right:45px;
}
.tswa_error_msg
{
margin-left:0px;
padding-right:0px;
margin-right:55px;
padding-left:10px;
}
<% } %>
</Style>
<Style condition="if IE 6">
.tswa_appdisplay
{
background-color:transparent;left:5px;top:0px;height:450px;width:850px;
}
.tswa_ShowOptimizeExperienceShiftedUp
{
position:absolute;
left:10px;
top:415px;
width:850px;
height:20px;
background-color:white;
}
<%
if ( bShowPublicCheckBox )
{
%>
.tswa_ShowOptimizeExperience
{
position:absolute;
left:10px;
top:463px;
width:850px;
height:20px;
background-color:white;
}
<%
}
else
{
%>
.tswa_ShowOptimizeExperience
{
position:absolute;
left:10px;
top:480px;
width:850px;
height:20px;
background-color:white;
}
<%
}
%>
.tswa_PublicCheckboxMore
{
position:absolute;
left:10px;
top:435px;
width:850px;
height:50px;
border-top: 1px solid gray;
background-color:white;
z-index:4000;
padding-top:4px;
}
.tswa_PublicCheckboxLess
{
position:absolute;
left:10px;
top:480px;
width:850px;
height:20px;
background-color:white;
}
</Style>
<Style condition="if gte IE 7">
.tswa_appdisplay
{
background-color:transparent;
left:5px;
top:0px;
height:440px;
width:850px;
}
.tswa_ShowOptimizeExperienceShiftedUp
{
position:absolute;
left:10px;
top:397px;
width:850px;
height:20px;
background-color:white;
}
<%
if ( bShowPublicCheckBox )
{
%>
.tswa_ShowOptimizeExperience
{
position:absolute;
left:10px;
top:445px;
width:850px;
height:20px;
background-color:white;
}
<%
}
else
{
%>
.tswa_ShowOptimizeExperience
{
position:absolute;
left:10px;
top:462px;
width:850px;
height:20px;
background-color:white;
}
<%
}
%>
.tswa_PublicCheckboxMore
{
position:absolute;
left:10px;
top:417px;
width:850px;
height:50px;
border-top: 1px solid gray;
background-color:white;
z-index:4000;
padding-top:4px;
}
.tswa_PublicCheckboxLess
{
position:absolute;
left:10px;
top:462px;
width:850px;
height:20px;
background-color:white;
}
</Style>
<AppFeed
showpubliccheckbox="<%=bShowPublicCheckBox.ToString().ToLower()%>"
privatemode="<%=bPrivateMode.ToString().ToLower()%>"
showoptimizeexperience="<%=bShowOptimizeExperience.ToString().ToLower()%>"
optimizeexperiencestate="<%=bOptimizeExperienceState.ToString().ToLower()%>"
<%
if (!String.IsNullOrEmpty(sRDCInstallUrl)) {
%>
rdcinstallurl="<%=SecurityElement.Escape(sRDCInstallUrl)%>"
<%
}
%>
>
<%=strAppFeed%>
</AppFeed>
</RDWAPage>

View file

@ -0,0 +1,973 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../Site.xsl"?>
<?xml-stylesheet type="text/css" href="../RenderFail.css"?>
<% @Page Language="C#" Debug="false" ResponseEncoding="utf-8" ContentType="text/xml" %>
<% @Import Namespace="System.Globalization " %>
<% @Import Namespace="System.Web.Configuration" %>
<% @Import Namespace="System.Security" %>
<% @Import Namespace="Microsoft.TerminalServices.Publishing.Portal.FormAuthentication" %>
<% @Import Namespace="Microsoft.TerminalServices.Publishing.Portal" %>
<script runat="server">
//
// Customizable Text
//
string L_CompanyName_Text = "Work Resources";
//
// Localizable Text
//
const string L_RemoteAppProgramsLabel_Text = "RemoteApp and Desktops";
const string L_DesktopTab_Text = "Connect to a remote PC";
const string L_SignOutTab_Text = "Sign out";
const string L_HelpTab_Text = "Help";
const string L_DesktopHeader_Text = "Remote Desktop Services Remote Desktop Web Connection";
const string L_DesktopDesc_Text = "Enter the name of the remote computer that you want to connect to, specify options, and then click Connect.";
const string L_Options_Text = "<u>O</u>ptions";
const string L_ConnectionOptionsHeader_Text = "Connection options";
const string L_RemoteDesktopSize_Text = "<u>R</u>emote desktop size:";
const string L_FullScreenLabel_Text = "Full screen";
const string L_800x600Label_Text = "800 x 600 pixels";
const string L_1024x768Label_Text = "1024 x 768 pixels";
const string L_1280x1024Label_Text = "1280 x 1024 pixels";
const string L_1600x1200Label_Text = "1600 x 1200 pixels";
const string L_ConnectLabel_Text = "Co<u>n</u>nect";
const string L_MachineNameAccessKey_Text = "c";
const string L_MachineName_Text = "<u>C</u>onnect to:";
const string L_ResolutionAccessKey_Text = "r";
const string L_Resolution_Text="<u>R</u>emote desktop size:";
const string L_OptionsAccessKey_Text = "o";
const string L_ConnectAccessKey_Text = "n";
const string L_DevAndRes_Text = "Devices and resources";
const string L_DevAndResDesc_Text = "Select the devices and resources that you want to use in your remote session.";
const string L_PrinterLabel_Text = "Prin<u>t</u>ers";
const string L_ClipboardLabel_Text = "C<u>l</u>ipboard";
const string L_DrivesLabel_Text = "Dr<u>i</u>ves";
const string L_PNPLabel_Text = "Supported Plug and Pl<u>a</u>y devices";
const string L_SerialLabel_Text = "S<u>e</u>rial ports";
const string L_PrinterRedirectionAccessKey_Text = "t";
const string L_ClipboardAccessKey_Text = "l";
const string L_DrivesAccessKey_Text = "i";
const string L_PNPAccessKey_Text="a";
const string L_SerialAccessKey_Text="e";
const string L_AdditionalOptions_Text = "Additional options";
const string L_SoundLabel_Text = "Remote computer <u>s</u>ound:";
const string L_SoundToComputerLabel_Text = "Bring to this computer";
const string L_SoundDisabledLabel_Text = "Do not play";
const string L_SoundAtServerLabel_Text = "Leave at remote computer";
const string L_KeyLabel_Text = "Apply <u>k</u>eyboard shortcuts:";
const string L_KeyAtServerLabel_Text = "On the remote computer";
const string L_KeyAtComputerLabel_Text = "On the local computer";
const string L_KeyAtServerFullScreenLabel_Text = "In Full screen mode only";
const string L_PerformanceLabel_Text = "<u>P</u>erformance:";
const string L_ModemLabel_Text = "Modem (56 Kbps)";
const string L_LowSpeedBroadbandLabel_Text = "Low-speed broadband (256 Kbps - 2 Mbps)";
const string L_SatelliteLabel_Text = "Satellite (2 Mbps - 16 Mbps with high latency)";
const string L_HighSpeedBroadbandLabel_Text = "High-speed broadband (2 Mbps - 10 Mbps)";
const string L_WANLabel_Text = "WAN (10 Mbps or higher with high latency)";
const string L_LANLabel_Text = "LAN (10 Mbps or higher)";
const string L_AutoDetectBandWidth_Text = "Detect connection quality automatically";
const string L_KeyboardAccessKey_Text = "k";
const string L_PerformanceAccessKey_Text = "p";
const string L_SoundAccessKey_Text = "s";
const string L_PrivateDesc_Text = "By selecting this option you can save your credentials so that they can be used in the future when connecting to these programs. Before you select this option, please ensure that saving your credentials is in compliance with your organization's security policy.";
const string L_HideInfoLabel_Text = "Hide additional information...";
const string L_MoreInfoLabel_Text = "More information...";
const string L_PrivateLabel_Text = "I am using a private computer that complies with my organization's security policy.";
const string L_InvalidMachineName_Text = "You must enter a remote computer name.";
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.";
//
// Page Variables
//
public string sHelpSourceServer, sLocalHelp;
public bool bPrivateMode = false;
public int SessionTimeoutInMinutes = 0;
public string DefaultTSGateway = "";
public string GatewayCredentialsSource = "";
public string xPrinterRedirection;
public string xClipboard;
public string xDriveRedirection;
public string xPnPRedirection;
public string xPortRedirection;
public string strDomainUserName = "";
public AuthenticationMode eAuthenticationMode = AuthenticationMode.None;
public Uri baseUrl;
public WorkspaceInfo objWorkspaceInfo = null;
protected void Page_PreInit(object sender, EventArgs e)
{
// Deny requests with "additional path information"
if (Request.PathInfo.Length != 0)
{
Response.StatusCode = 404;
Response.End();
}
// 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 )
{
eAuthenticationMode = objAuthenticationSection.Mode;
}
if ( eAuthenticationMode == AuthenticationMode.Forms )
{
if ( HttpContext.Current.User.Identity.IsAuthenticated == false )
{
Response.Redirect("login.aspx?ReturnUrl=desktops.aspx");
}
TSFormAuthTicketInfo objTSFormAuthTicketInfo = new TSFormAuthTicketInfo(HttpContext.Current);
bPrivateMode = objTSFormAuthTicketInfo.PrivateMode;
strDomainUserName = objTSFormAuthTicketInfo.DomainUserName;
if ( bPrivateMode == true )
{
try
{
string strPrivateModeSessionTimeoutInMinutes = ConfigurationManager.AppSettings["PrivateModeSessionTimeoutInMinutes"].ToString();
SessionTimeoutInMinutes = Int32.Parse(strPrivateModeSessionTimeoutInMinutes);
}
catch (Exception objException)
{
Console.WriteLine("\nException : " + objException.Message);
SessionTimeoutInMinutes = 240;
}
}
else
{
try
{
string strPublicModeSessionTimeoutInMinutes = ConfigurationManager.AppSettings["PublicModeSessionTimeoutInMinutes"].ToString();
SessionTimeoutInMinutes = Int32.Parse(strPublicModeSessionTimeoutInMinutes);
}
catch (Exception objException)
{
Console.WriteLine("\nException : " + objException.Message);
SessionTimeoutInMinutes = 20;
}
}
}
objWorkspaceInfo = RdwaConfig.GetWorkspaceInfo();
if ( objWorkspaceInfo != null )
{
string strWorkspaceName = objWorkspaceInfo.WorkspaceName;
if ( String.IsNullOrEmpty(strWorkspaceName ) == false )
{
L_CompanyName_Text = strWorkspaceName;
}
}
sLocalHelp = ConfigurationManager.AppSettings["LocalHelp"];
if ((sLocalHelp != null) && (sLocalHelp == "true"))
sHelpSourceServer = "./rap-help.htm";
else
sHelpSourceServer = "http://go.microsoft.com/fwlink/?LinkId=141038";
}
protected void Page_Init(object sender, EventArgs e)
{
DefaultTSGateway = ConfigurationManager.AppSettings["DefaultTSGateway"].ToString();
GatewayCredentialsSource = ConfigurationManager.AppSettings["GatewayCredentialsSource"].ToString();
xPrinterRedirection = ConfigurationManager.AppSettings["xPrinterRedirection"].ToString();
xClipboard = ConfigurationManager.AppSettings["xClipboard"].ToString();
xDriveRedirection = ConfigurationManager.AppSettings["xDriveRedirection"].ToString();
xPnPRedirection = ConfigurationManager.AppSettings["xPnPRedirection"].ToString();
xPortRedirection = ConfigurationManager.AppSettings["xPortRedirection"].ToString();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
private string IsChecked(string xArg)
{
return (xArg == "true") ? "checked='checked'" : "";
}
</script>
<RDWAPage
helpurl="<%=sHelpSourceServer%>"
domainuser="<%=SecurityElement.Escape(strDomainUserName)%>"
workspacename="<%=SecurityElement.Escape(L_CompanyName_Text)%>"
baseurl="<%=SecurityElement.Escape(baseUrl.AbsoluteUri)%>"
>
<RenderFailureMessage>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><%=L_RenderFailTitle_Text%></title>
</head>
<body>
<h1><%=L_RenderFailTitle_Text%></h1>
<p><%=L_RenderFailP1_Text%></p>
<p><%=L_RenderFailP2_Text%></p>
<p><%=L_RenderFailP3_Text%></p>
</body>
</html>
</RenderFailureMessage>
<HeaderJS>
bFormAuthenticationMode = false;
<% if ( eAuthenticationMode == AuthenticationMode.Forms ) { %>
bFormAuthenticationMode = true;
<% } %>
iSessionTimeout = parseInt("<%=SessionTimeoutInMinutes%>");
</HeaderJS>
<BodyAttr onload="onAuthenticatedPageload(event)" onunload="onPageUnload(event)" onmousedown="onUserActivity(event)" onmousewheel="onUserActivity(event)" onscroll="onUserActivity(event)" onkeydown="onUserActivity(event)"/>
<NavBar
<% if ( eAuthenticationMode == AuthenticationMode.Forms ) { %>
showsignout="true"
<% } %>
activetab="PORTAL_REMOTE_DESKTOPS"
>
<Tab id="PORTAL_REMOTE_PROGRAMS" href="Default.aspx"><%=L_RemoteAppProgramsLabel_Text%></Tab>
<Tab id="PORTAL_REMOTE_DESKTOPS" href="Desktops.aspx"><%=L_DesktopTab_Text%></Tab>
</NavBar>
<HTMLMainContent>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30">&#160;</td>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr height="20">
<td></td>
</tr>
<tr>
<td><%=L_DesktopDesc_Text%></td>
</tr>
<tr height="20">
<td></td>
</tr>
<tr>
<td><b><%=L_ConnectionOptionsHeader_Text%></b></td>
</tr>
<tr height="7">
<td></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="right" valign="middle" style="width:160px;padding-bottom:3px;">
<label accesskey="<%=L_MachineNameAccessKey_Text %>" for="MachineName"><%=L_MachineName_Text %></label>
</td>
<td width="7"></td>
<td valign="top" style="padding-bottom:4px;padding-right:4px;" colspan="2">
&#160;<input name="MachineName" maxlength="255" id="MachineName" class="textInputField" type="text"
onfocus="updateConnectButtonState(this);" onblur="updateConnectButtonState(this);"
onkeyup="onConnectToKeyUp(this);" onpropertychange="onConnectToPropertyChange(this);"/>
</td>
</tr>
<tr id="trErrorInvalidMachine" style="display:none" >
<td align="right" valign="top">&#160;</td>
<td width="7"></td>
<td height="20">&#160;<span class="wrng"><%=L_InvalidMachineName_Text%></span></td>
</tr>
<tr>
<td align="right" valign="top">
<label accesskey="<%=L_ResolutionAccessKey_Text %>" for="comboResolution"><%=L_Resolution_Text %></label>
</td>
<td width="7"></td>
<td valign="top" style="padding-bottom: 4px;">
&#160;<select class="topspace" id="comboResolution" style="width: 270px" name="comboResolution">
<option value="0" selected="selected"><%=L_FullScreenLabel_Text %></option>
<option value="1"><%=L_800x600Label_Text %></option>
<option value="2"><%=L_1024x768Label_Text %></option>
<option value="3"><%=L_1280x1024Label_Text %></option>
<option value="4"><%=L_1600x1200Label_Text %></option>
</select>
</td>
</tr>
<tr>
<td align="right" valign="top">&#160;</td>
<td width="7"></td>
<td valign="top" style="padding-top: 4px; padding-bottom: 10px;">
&#160;<button type="button" id="ButtonOptions" name="ButtonOptions" class="formButton" onclick="jscript:hideshowOptions();" accesskey="<%=L_OptionsAccessKey_Text %>"><%=L_Options_Text %> &gt;&gt;</button>
&#160;<button type="button" id="ButtonConnect" name="ButtonConnect" disabled="disabled" class="formButton" onclick="BtnConnect()" accesskey="<%=L_ConnectAccessKey_Text %>"><%=L_ConnectLabel_Text %></button>
</td>
</tr>
</table>
</td>
</tr>
<tr height="20">
<td></td>
</tr>
<!-- ******************** Hidden Row for 'Additional Options' ******************** -->
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" id="opt_panel" style="visibility: hidden;">
<tr>
<td><b><%=L_DevAndRes_Text%></b></td>
</tr>
<tr height="7">
<td></td>
</tr>
<tr>
<td><%=L_DevAndResDesc_Text %></td>
</tr>
<tr height="7">
<td></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="167"></td>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><input type="checkbox" value="OFF" id="xPrinterRedirection" name="xPrinterRedirection" <%=IsChecked(xPrinterRedirection)%>/></td>
<td><label accesskey="<%=L_PrinterRedirectionAccessKey_Text %>" for="xPrinterRedirection"><%=L_PrinterLabel_Text %></label></td>
<td width="7"></td>
<td><input type="checkbox" value="OFF" id="xClipboard" name="xClipboard" <%=IsChecked(xClipboard)%>/></td>
<td><label accesskey="<%=L_ClipboardAccessKey_Text %>" for="xClipboard"><%=L_ClipboardLabel_Text %></label></td>
</tr>
<tr>
<td><input type="checkbox" value="OFF" id="xDriveRedirection" name="xDriveRedirection" <%=IsChecked(xDriveRedirection)%> /></td>
<td><label id="xDriveRedirection_Label" accesskey="<%=L_DrivesAccessKey_Text %>" for="xDriveRedirection"><%=L_DrivesLabel_Text %> </label></td>
<td width="7"></td>
<td><input type="checkbox" value="OFF" id="xPnPRedirection" name="xPnPRedirection" <%=IsChecked(xPnPRedirection)%> /></td>
<td><label id="xPnPRedirection_Label" accesskey="<%=L_PNPAccessKey_Text %>" for="xPnPRedirection"><%=L_PNPLabel_Text %></label></td>
</tr>
<tr>
<td><input type="checkbox" value="OFF" id="xPortRedirection" name="xPortRedirection" <%=IsChecked(xPortRedirection)%> /></td>
<td><label id="xPortRedirection_Label" accesskey="<%=L_SerialAccessKey_Text %>" for="xPortRedirection"><%=L_SerialLabel_Text %></label></td>
<td width="7"></td>
<td></td>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr height="20">
<td></td>
</tr>
<tr>
<td><b><%=L_AdditionalOptions_Text%></b></td>
</tr>
<tr height="7">
<td></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="right" valign="top" width="160">
<label accesskey="<%=L_SoundAccessKey_Text %>" for="comboAudio"><%=L_SoundLabel_Text %></label>
</td>
<td width="7"></td>
<td valign="top" style="padding-bottom: 4px;" width="300">
&#160;<select class="topspace" id="comboAudio" style="width: 270px" name="comboAudio">
<option value="0" selected="selected"><%=L_SoundToComputerLabel_Text %></option>
<option value="1"><%=L_SoundAtServerLabel_Text %></option>
<option value="2"><%=L_SoundDisabledLabel_Text %></option>
</select>
</td>
</tr>
<tr>
<td align="right" valign="top">
<label accesskey="<%=L_KeyboardAccessKey_Text %>" for="comboKeyboard"><%=L_KeyLabel_Text %></label>
</td>
<td width="7"></td>
<td valign="top" style="padding-bottom: 4px;">
&#160;<select class="topspace" id="comboKeyboard" style="width: 270px" name="comboKeyboard">
<option value="0"><%=L_KeyAtComputerLabel_Text %></option>
<option value="1"><%=L_KeyAtServerLabel_Text %></option>
<option value="2" selected="selected"><%=L_KeyAtServerFullScreenLabel_Text %></option>
</select>
</td>
</tr>
<tr>
<td align="right" valign="top">
<label accesskey="<%=L_PerformanceAccessKey_Text %>" for="comboPerfomance"><%=L_PerformanceLabel_Text %></label>
</td>
<td width="7"></td>
<td valign="top" style="padding-bottom: 4px;">
&#160;<select class="topspace" id="comboPerfomance" style="width: 270px" name="comboPerfomance"
onchange="jscript:setPerf();">
<option value="1"><%=L_ModemLabel_Text%></option>
<option value="2"><%=L_LowSpeedBroadbandLabel_Text%></option>
<option value="3"><%=L_SatelliteLabel_Text%></option>
<option value="4"><%=L_HighSpeedBroadbandLabel_Text%></option>
<option value="5"><%=L_WANLabel_Text%></option>
<option value="6"><%=L_LANLabel_Text%></option>
<option value="7" selected="selected"><%=L_AutoDetectBandWidth_Text%></option>
</select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div style="display:none;height:0px; width:0px; background-color:Transparent;">
<script type="text/vbscript" language="vbscript">
<!--
Function TSMsgBox(sMsg, iButtons, sTitle)
TSMsgBox = MsgBox(sMsg, iButtons, sTitle)
End Function
-->
</script>
<span id="DefaultTSGateway" style="display:none"><%=SecurityElement.Escape(DefaultTSGateway) %></span>
<span id="GatewayCredentialsSource" style="display:none"><%=SecurityElement.Escape(GatewayCredentialsSource) %></span>
<script type="text/javascript" language="javascript">
<![CDATA[
var DefaultTSGateway = document.getElementById("DefaultTSGateway").innerHTML;
var GatewayCredentialsSource = document.getElementById("GatewayCredentialsSource").innerHTML;
document.getElementById("MachineName").focus()
window.onerror = fnErrTrap;
var vbCritical = 16;
var vbInformation = 64;
var L_sTitle_Text = "Remote Desktop Connection";
function updateConnectButtonState( objMachineName )
{
if ( objMachineName.value.length == 0 )
{
document.getElementById("ButtonConnect").disabled = true;
}
else if ( objMachineName.value.length > 0 )
{
hideElement(document.getElementById("trErrorInvalidMachine"));
document.getElementById("ButtonConnect").disabled = false;
}
}
function onConnectToFocus( objMachineName )
{
updateConnectButtonState( objMachineName );
}
function onConnectToBlur( objMachineName )
{
updateConnectButtonState( objMachineName );
}
function onConnectToPropertyChange( objMachineName )
{
// make sure it it's the value that changed
if ( window.event.propertyName == "value" )
{
updateConnectButtonState( objMachineName );
}
}
function TestMN(s)
{
//-- Admins can set up their own validation here --//
var r, re;
//
// Match between 1 and 256 occurences of these characters: "\f\n\r\t'space'"*+,;=?|¦"
// starting from a word boundary (/b).
// See: http://msdn.microsoft.com/en-us/library/1400241x(VS.85).aspx
//
re = new RegExp("[\b\f\n\r\t\x20\x22\x2A-\x2C\x3B-\x3F\x7C\xA6]{1,256}");
r = s.match(re);
var retval = (r == null)? false : true;
return retval;
}
function TestTxt( objMachineName )
{
var retval = false;
if ( TestMN(objMachineName.value) )
{
document.getElementById("ButtonConnect").disabled = true;
showElement(document.getElementById("trErrorInvalidMachine"));
retval = true;
}
return retval;
}
function onConnectToKeyUp( objMachineName )
{
if ( window.event.keyCode == 13 )
{
if ( objMachineName.value.length > 0 )
{
BtnConnect();
}
else
{
showElement(document.getElementById("trErrorInvalidMachine"));
}
}
}
function fnErrTrap(sMsg,sUrl,sLine)
{
var retval;
var L_errMsg_Text = "To use this Web site, your computer must be running the Remote Desktop Connection (RDC) client. \n\nTo continue, install the latest RDC client and the most recent updates from the Microsoft Update Web site, and then try again.";
if (sMsg.indexOf('is undefined') != -1)
{
retval = TSMsgBox(L_errMsg_Text, vbInformation, L_sTitle_Text);
}
else if (sMsg.indexOf('is null or not an object') != -1)
{
retval = TSMsgBox(L_errMsg_Text, vbInformation, L_sTitle_Text);
}
else if (sMsg.indexOf('canceled by the user') != -1)
{
return true;
}
else
{
var L_errMsg2_Text = "An application error was caught:\n\nError:%ErrorMessage%\nURL:%URL%\nLine:%ErrorLineNumber%" ; // {Placeholder="%ErrorMessage%","%URL%","%ErrorLineNumber%"}
var errMsg2 = L_errMsg2_Text
errMsg2 = errMsg2.replace("%ErrorMessage%",sMsg);
errMsg2 = errMsg2.replace("%ErrorNumber%",sURL);
errMsg2 = errMsg2.replace("%ErrorLineNumber%",sLine);
retval = TSMsgBox(L_errMsg2_Text, vbInformation, L_sTitle_Text);
}
return true;
}
var WebAccessControlPresent = IsWebAccessControlPresent();
try
{
document.write("<object type=\"application/x-oleobject\"");
document.write("id=\"MsRdpClient\" name=\"MsRdpClient\"");
document.write("onerror=\"OnControlLoadError\"");
document.write("height=\"0\" width=\"0\"");
if ( WebAccessControlPresent ) {
document.write("classid=\"CLSID:6A5B0C7C-5CCB-4F10-A043-B8DE007E1952\">");
}
else {
document.write("classid=\"CLSID:4eb89ff4-7f78-4a0f-8b8d-2bf02e94e4b2\">");
}
document.write("</object>");
}
catch(e)
{
throw e;
}
var MsRdpClientShell;
var MsRdpClient = document.getElementById("MsRdpClient");
if ( WebAccessControlPresent ) {
MsRdpClientShell = MsRdpClient;
}
else {
MsRdpClientShell = MsRdpClient.MsRdpClientShell;
}
function OnControlLoadError()
{
var L_errMsgLoad_Text = "A problem was detected while loading the ActiveX Control.";
var retval = TSMsgBox(L_errMsgLoad_Text, vbInformation, L_sTitle_Text);
return true;
}
function IsWebAccessControlPresent()
{
var retval = false;
try {
var WebAccessControl = new ActiveXObject("MsRdpWebAccess.MsRdpClientShell");
if ( WebAccessControl ) {
retval = true;
}
}
catch(e) {
retval = false;
}
return retval;
}
]]>
</script>
</div>
<script type="text/javascript" language="javascript">MsRdpClient.MsRdpClientShell</script>
<script type="text/javascript" language="javascript">
<![CDATA[
function CheckDisableRedirections()
{
var fRedirsAllowed = false;
try
{
fRedirsAllowed = MsRdpClient.GetSecuredRedirsEnabled();
}
catch(e)
{
// If the client doesnt have the new SecuredRedirections check, fall-back...
fRedirsAllowed = MsRdpClient.SecuredSettingsEnabled;
}
if (!fRedirsAllowed)
{
document.getElementById("xDriveRedirection").checked = false;
document.getElementById("xPnPRedirection").checked = false;
document.getElementById("xPortRedirection").checked = false;
document.getElementById("xDriveRedirection").disabled = true;
document.getElementById("xPnPRedirection").disabled = true;
document.getElementById("xPortRedirection").disabled = true;
document.getElementById("xDriveRedirection_Label").disabled = true;
document.getElementById("xPnPRedirection_Label").disabled = true;
document.getElementById("xPortRedirection_Label").disabled = true;
}
}
function hideshowOptions()
{
if (document.getElementById("opt_panel").style.visibility == "hidden") {
document.getElementById("opt_panel").style.visibility = "visible";
document.getElementById("ButtonOptions").innerHTML = "<%= L_Options_Text%>" +" &lt;&lt;";
}
else {
document.getElementById("opt_panel").style.visibility = "hidden";
document.getElementById("ButtonOptions").innerHTML = "<%= L_Options_Text%>" +" &gt;&gt;";
}
}
var objPerformanceOptions = new Array(8);
function setPerf()
{
var iIndex;
for (iIndex = 0; iIndex < objPerformanceOptions.length; iIndex++)
{
objPerformanceOptions[iIndex] = 0;
}
//
// Based on the choosen Performance option
// from the Experience tab, turn ON specific options.
//
switch(parseInt(document.getElementById("comboPerfomance").value)) {
case 1: // Modem
objPerformanceOptions[6] = 1;
break;
case 2: // Low-speed broadband
objPerformanceOptions[5] = 1;
objPerformanceOptions[6] = 1;
break;
case 3: // Satellite
case 4: // High-speed broadband
objPerformanceOptions[2] = 1;
objPerformanceOptions[5] = 1;
objPerformanceOptions[6] = 1;
break;
case 5: // WAN
case 6: // LAN
objPerformanceOptions[0] = 1;
objPerformanceOptions[1] = 1;
objPerformanceOptions[2] = 1;
objPerformanceOptions[3] = 1;
objPerformanceOptions[4] = 1;
objPerformanceOptions[5] = 1;
objPerformanceOptions[6] = 1;
break;
case 7:
objPerformanceOptions[5] = 1;
objPerformanceOptions[6] = 1;
objPerformanceOptions[7] = 1;
default:
break;
}
}
function setRes()
{
var retval;
var iRes = GetParam("comboResolution", false, "0");
var RDPstr1 = "screen mode id:i:2\n";
var RDPstr2 = "Desktop Size ID:i:" + iRes + "\n";
if (iRes == "0") {
retval = RDPstr1;
}
else {
retval = RDPstr2;
}
return retval;
}
function flipBit (iVal)
{
return (iVal == 1) ? 0:1;
}
function BtnConnect()
{
var iConnectionType = 0;
var RDPstr = "full address:s:" + GetParam("MachineName", true, "") + "\n";
RDPstr += "authentication level:i:2\n";
RDPstr += "gatewayhostname:s:" + DefaultTSGateway + "\n";
RDPstr += "gatewaycredentialssource:i:" + GatewayCredentialsSource + "\n";
if ((DefaultTSGateway != null) && (DefaultTSGateway.length > 0)) {
RDPstr += "gatewayusagemethod:i:2\n";
RDPstr += "gatewayprofileusagemethod:i:1\n";
}
else {
RDPstr += "gatewayusagemethod:i:2\n";
RDPstr += "gatewayprofileusagemethod:i:0\n";
}
setPerf();
RDPstr += "disable wallpaper:i:" + flipBit(objPerformanceOptions[0]).toString() + "\n";
RDPstr += "allow font smoothing:i:" + objPerformanceOptions[1].toString() + "\n";
RDPstr += "allow desktop composition:i:" + objPerformanceOptions[2].toString() + "\n";
RDPstr += "disable full window drag:i:" + flipBit(objPerformanceOptions[3]).toString() + "\n";
RDPstr += "disable menu anims:i:" + flipBit(objPerformanceOptions[4]).toString() + "\n";
RDPstr += "disable themes:i:" + flipBit(objPerformanceOptions[5]).toString() + "\n";
RDPstr += "bitmapcachepersistenable:i:" + objPerformanceOptions[6].toString() + "\n";
RDPstr += "bandwidthautodetect:i:1\n";
RDPstr += "networkautodetect:i:" + objPerformanceOptions[7].toString() + "\n";
iConnectionType = document.getElementById("comboPerfomance").value;
if (iConnectionType == 7) {
//
// default to lowspeed-broadband
//
iConnectionType = 2;
}
RDPstr += "connection type:i:" + iConnectionType + "\n";
RDPstr += setRes();
RDPstr += "displayconnectionbar:i:1\n";
RDPstr += "session bpp:i:32\n";
RDPstr += "redirectclipboard:i:" + GetParam("xClipboard", false, "0") + "\n";
if (GetParam("xDriveRedirection", false, "0") == 1)
{
RDPstr += "redirectdrives:i:1\n";
RDPstr += "drivestoredirect:s:*\n";
}
else
{
RDPstr += "redirectdrives:i:0\n";
}
RDPstr += "redirectcomports:i:" + GetParam("xPortRedirection", false, "0") + "\n";
RDPstr += "devicestoredirect:s:" + ((document.getElementById("xPnPRedirection").checked) ? "*" : "") + "\n";
RDPstr += "keyboardhook:i:" + parseInt(document.getElementById("comboKeyboard").value) + "\n";
RDPstr += "audiomode:i:" + parseInt(document.getElementById("comboAudio").value) + "\n";
RDPstr += "redirectprinters:i:" + GetParam("xPrinterRedirection", false, "0") + "\n";
RDPstr += "redirectsmartcards:i:1\n";
RDPstr += "compression:i:1\n";
RDPstr += "autoreconnection enabled:i:1\n";
RDPstr += getUserNameRdpProperty();
RDPstr += "";
<%
if ( eAuthenticationMode == AuthenticationMode.Forms )
{
%>
MsRdpClientShell.PublicMode = <%=(!bPrivateMode).ToString().ToLower(CultureInfo.InvariantCulture)%>;
<%
}
else
{
%>
MsRdpClientShell.PublicMode = !(document.getElementById("PublicCheckbox").checked);
<%
}
%>
MsRdpClientShell.RdpFileContents = RDPstr;
if (TestTxt(document.getElementById("MachineName"))== false)
{
try
{
MsRdpClientShell.Launch();
}
catch(e)
{
if (e.number==-2147467259)
{
var L_ErrMsgLaunch_Text = "The security settings of your browser are preventing this Remote Desktop Services website from launching the remote program. Please add this Remote Desktop Services website to the Trusted sites or Local intranet zone of your browser and try again.";
var retval = TSMsgBox(L_ErrMsgLaunch_Text, vbInformation, L_sTitle_Text);
}
else
{
throw e
}
}
}
else
{
document.getElementById("MachineName").focus();
}
}
function GetParam(sParam, bReqd, vDefault)
{
var obj = document.getElementById(sParam);
if(obj != null)
{
switch(obj.tagName)
{
case "SELECT":
return obj.selectedIndex;
break;
case "INPUT":
if (obj.type == "checkbox") return ((obj.checked) ? 1 : 0);
if (obj.type == "hidden") return obj.value;
if (obj.type == "text") return obj.value;
break;
default:
break;
}
}
else
{
if ((bReqd) && ((vDefault == "") || (vDefault == null) || (obj == null)))
{
var L_ErrMsgInvalid_Text = "%ParameterName% is not a valid or available parameter name."; // {Placeholder="%ParameterName%"}
var errMsgInvalid = sParam;
errMsgInvalid = errMsgInvalid.replace("%ParameterName%", sParam);
var retval = TSMsgBox(errMsgInvalid, vbInformation, L_sTitle_Text);
return null;
}
else
{
return vDefault;
}
}
}
]]>
</script>
</td>
</tr>
</table>
</HTMLMainContent>
<ExtraRows>
<!-- Row 7.1 - Empty -->
<tr>
<td height="40">
</td>
</tr>
<%
if ( eAuthenticationMode == AuthenticationMode.Windows )
{
%>
<!-- Row 7.2 - Checkbox -->
<tr>
<td height="30">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30">&#160;</td>
<td>
<table width="100%" cellspacing="0" cellpadding="0" border="0" id='contentPublicCheckbox' class='tswa_PublicCheckboxLess' >
<tr>
<td valign="top" width="30">
<input id='PublicCheckbox' type="checkbox" value="ON" />
</td>
<td id='SecurityText2' valign="top" style="padding-top:2px"><%=L_PrivateLabel_Text %>
<span id='p2M' onclick="toggle(this);">(<a href="javascript:toggle(this)"><%=L_MoreInfoLabel_Text %></a>)</span>
<span id='privateMore' style="display:none"><br /><%=L_PrivateDesc_Text %>
<span id='p2L' onclick="toggle(this);">(<a href="javascript:toggle(this)"><%=L_HideInfoLabel_Text %></a>)</span>
</span>
</td>
</tr>
</table>
<!--[if IE 6]>
<script type="text/javascript" language="javascript">
document.styleSheets[0].addRule('.tswa_PublicCheckboxMore', 'position:relative');
document.styleSheets[0].addRule('.tswa_PublicCheckboxLess', 'position:relative');
</script>
<![endif]-->
<!--[if IE 7]>
<script type="text/javascript" language="javascript">
document.styleSheets[0].addRule('.tswa_PublicCheckboxMore', 'position:relative');
document.styleSheets[0].addRule('.tswa_PublicCheckboxLess', 'position:relative');
</script>
<![endif]-->
<script type="text/javascript" language="javascript">
function toggle(e)
{
if (e.id == "p2M")
{
p2M.style.display = "none";
p2L.style.display = "";
privateMore.style.display = "";
contentPublicCheckbox.className = "tswa_PublicCheckboxMore";
}
else if (e.id == "p2L")
{
p2M.style.display = "";
p2L.style.display = "none";
privateMore.style.display = "none";
contentPublicCheckbox.className = "tswa_PublicCheckboxLess";
}
}
CheckDisableRedirections();
document.getElementById("MachineName").focus();
</script>
</td>
</tr>
</table>
</td>
</tr>
<%
}
%>
</ExtraRows>
</RDWAPage>

View file

@ -0,0 +1,22 @@
<?xml version="1.0"?>
<rdwastr:strings xmlns:rdwastr="urn:microsoft.com:rdwastrings">
<string id="PageTitle">RD Web Access</string>
<string id="NoScriptWarning">
<p id="NoScript1">RD Web Access requires JScript. This Web browser either does not support JScript, or scripts are being blocked.</p>
<br/>
<br/>
<p id="NoScript2">To find out whether your browser supports JScript, or to allow scripts, see the browser's online Help.</p>
</string>
<string id="HeadingRDWA">RD Web Access</string>
<string id="HeadingApplicationName">RemoteApp and Desktop Connection</string>
<string id="Help">Help</string>
<string id="SignOut">Sign out</string>
<string id="SearchingForApps">Searching for available RemoteApp programs... </string>
<string id="CurrentFolder">Current folder: </string>
<string id="ParentFolder">Up</string>
<string id="OptimizeMyExperience">Optimize my experience for a LAN network when connecting to the computer or application.</string>
<string id="PrivateComputer">I am using a private computer that complies with my organization's security policy.</string>
<string id="MoreInformation">More information...</string>
<string id="PrivateMore">By selecting this option you can save your credentials so that they can be used in the future when connecting to these programs. Before you select this option, please ensure that saving your credentials is in compliance with your organization's security policy.</string>
<string id="HideMore">Hide additional information...</string>
</rdwastr:strings>

View file

@ -0,0 +1,2 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="checktoken.aspx.cs" Inherits="CheckToken" %>

View file

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using RADAR;
public partial class CheckToken : System.Web.UI.Page
{
String radiusServer = ConfigurationManager.AppSettings["RadiusServer"];
String radiusSharedSecret = ConfigurationManager.AppSettings["RadiusSecret"];
RADIUSClient radiusClient;
String username;
String token;
public CheckToken()
{
radiusClient = new RADIUSClient(radiusServer, 1812, radiusSharedSecret);
}
// Check validity of token (radius session id) by authenticating against
// the RADIUS server
//
// Called when clicking on applications
//
// Returns 401 if not valid
protected void Page_Load(object sender, EventArgs e)
{
username = (string)Session["DomainUserName"];
HttpCookie tokenCookie = Request.Cookies["RadiusSessionId"];
if (tokenCookie == null)
{
throw new HttpException(401, "Token required");
}
token = tokenCookie.Value;
VendorSpecificAttribute vsa = new VendorSpecificAttribute(VendorSpecificType.Generic, "LAUNCH");
RADIUSAttributes atts = new RADIUSAttributes();
vsa.SetRADIUSAttribute(ref atts);
try
{
RADIUSPacket response = radiusClient.Authenticate(username, token, atts);
if (response.Code == RadiusPacketCode.AccessAccept)
{
Response.Write("Ready to launch application. Granted access!");
}
else
{
throw new HttpException(401, "Token is no longer valid!");
}
}
catch (Exception ex)
{
throw new HttpException(500, "Exception! failure. " + ex.Message);
}
}
}

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

@ -0,0 +1,769 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../Site.xsl"?>
<?xml-stylesheet type="text/css" href="../RenderFail.css"?>
<% @Page Language="C#" Debug="false" ResponseEncoding="utf-8" ContentType="text/xml" %>
<% @Import Namespace="System " %>
<% @Import Namespace="System.Security" %>
<% @Import Namespace="Microsoft.TerminalServices.Publishing.Portal.FormAuthentication" %>
<% @Import Namespace="Microsoft.TerminalServices.Publishing.Portal" %>
<script language="C#" runat=server>
//
// Customizable Text
//
string L_CompanyName_Text = "Work Resources";
//
// Localizable Text
//
const string L_DomainUserNameLabel_Text = "Domain\\user name:";
const string L_PasswordLabel_Text = "Password:";
const string L_PasswordExpiredChangeBeginning_Text = "Your password is expired. Click ";
const string L_PasswordExpiredChangeLink_Text = "here";
const string L_PasswordExpiredChangeEnding_Text = " to change it.";
const string L_PasswordExpiredNoChange_Text = "Your password is expired. Please contact your administrator for assistance.";
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_SessionExpired_Text = "The session has expired. Please login again.";
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.";
const string L_SecurityLabel_Text = "Security";
const string L_ShowExplanationLabel_Text = "show explanation";
const string L_HideExplanationLabel_Text = "hide explanation";
const string L_PublicLabel_Text = "This is a public or shared computer";
const string L_PublicExplanationLabel_Text = "Select this option if you use RD Web Access on a public computer. Be sure to log off when you have finished using RD Web Access and close all windows to end your session.";
const string L_PrivateLabel_Text = "This is a private computer";
const string L_PrivateExplanationLabel_Text = "Select this option if you are the only person who uses this computer. Your server will allow a longer period of inactivity before logging you off.";
const string L_PrivateWarningLabel_Text = "Warning: By selecting this option, you confirm that this computer complies with your organization's security policy.";
const string L_PrivateWarningLabelNoAx_Text = "Warning: By logging in to this web page, you confirm that this computer complies with your organization's security policy.";
const string L_SignInLabel_Text = "Sign in";
const string L_TSWATimeoutLabel_Text = "To protect against unauthorized access, your RD Web Access session will automatically time out after a period of inactivity. If your session ends, refresh your browser and sign in again.";
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.";
//
// Page Variables
//
public string strErrorMessageRowStyle;
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 strReturnUrl = "";
public string strReturnUrlPage = "";
public string strPasswordExpiredQueryString = "";
public string sHelpSourceServer, sLocalHelp;
public Uri baseUrl;
public bool bEnableSMS = false;
public bool bEnableMail = false;
public bool bSessionExpired = false;
public string strPrivateModeTimeout = "240";
public string strPublicModeTimeout = "20";
public WorkspaceInfo objWorkspaceInfo = null;
void Page_PreInit(object sender, EventArgs e)
{
// Deny requests with "additional path information"
if (Request.PathInfo.Length != 0)
{
Response.StatusCode = 404;
Response.End();
}
// gives us https://<machine>/rdweb/pages/<lang>/
baseUrl = new Uri(new Uri(GetRealRequestUri(), Request.FilePath), ".");
sLocalHelp = ConfigurationManager.AppSettings["LocalHelp"];
if ((sLocalHelp != null) && (sLocalHelp == "true"))
{
sHelpSourceServer = "./rap-help.htm";
}
else
{
sHelpSourceServer = "http://go.microsoft.com/fwlink/?LinkId=141038";
}
strPrivateModeTimeout = ConfigurationManager.AppSettings["PrivateModeSessionTimeoutInMinutes"];
strPublicModeTimeout = ConfigurationManager.AppSettings["PublicModeSessionTimeoutInMinutes"];
bOTP = ConfigurationManager.AppSettings["OTP"] == "true";
bEnableSMS = ConfigurationManager.AppSettings["EnableSMS"] == "true";
bEnableMail = ConfigurationManager.AppSettings["EnableMail"] == "true";
}
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 )
{
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", "tokenform.aspx"));
}
}
if ( objQueryString["Error"] != null )
{
if ( objQueryString["Error"].Equals("WkSInUse", StringComparison.CurrentCultureIgnoreCase) )
{
bWorkspaceInUse = true;
}
else if (objQueryString["Error"].Equals("SessionExpired"))
{
bSessionExpired = true;
}
else if ( objQueryString["Error"].Equals("WkSDisconnected", StringComparison.CurrentCultureIgnoreCase) )
{
bWorkspaceDisconnected = true;
}
else if ( objQueryString["Error"].Equals("UnauthorizedAccess", StringComparison.CurrentCultureIgnoreCase) )
{
bFailedAuthorization = true;
}
else if (objQueryString["Error"].Equals("LoginSMSFailed", StringComparison.CurrentCultureIgnoreCase))
{
bFailedSMSLogon = true;
}
else if (objQueryString["Error"].Equals("LoginRadiusFailed", StringComparison.CurrentCultureIgnoreCase))
{
bFailedRadiusLogon = true;
}
else if ( objQueryString["Error"].Equals("ServerConfigChanged", StringComparison.CurrentCultureIgnoreCase) )
{
bServerConfigChanged = true;
}
else if ( objQueryString["Error"].Equals("PasswordExpired", StringComparison.CurrentCultureIgnoreCase) )
{
string strPasswordChangeEnabled = ConfigurationManager.AppSettings["PasswordChangeEnabled"];
if (strPasswordChangeEnabled != null && strPasswordChangeEnabled.Equals("true", StringComparison.CurrentCultureIgnoreCase))
{
bPasswordExpired = true;
if (objQueryString["UserName"] != null)
{
strPasswordExpiredQueryString = "?UserName=" + Uri.EscapeDataString(objQueryString["UserName"]);
}
}
else
{
bPasswordExpiredNoChange = true;
}
}
}
}
//
// Special case to handle 'ServerConfigChanged' error from Response's Location header.
//
try
{
if ( Response.Headers != null )
{
NameValueCollection objResponseHeader = Response.Headers;
if ( !String.IsNullOrEmpty( objResponseHeader["Location"] ) )
{
Uri objLocationUri = new Uri( objResponseHeader["Location"] );
if ( objLocationUri.Query.IndexOf("ServerConfigChanged") != -1 )
{
if ( !bFailedAuthorization )
{
bServerConfigChanged = true;
}
}
}
}
}
catch (Exception objException)
{
}
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 = RdwaConfig.GetWorkspaceInfo();
if ( objWorkspaceInfo != null )
{
strWorkSpaceID = objWorkspaceInfo.WorkspaceId;
strRedirectorName = objWorkspaceInfo.RedirectorName;
string strWorkspaceName = objWorkspaceInfo.WorkspaceName;
if ( String.IsNullOrEmpty(strWorkspaceName ) == false )
{
L_CompanyName_Text = strWorkspaceName;
}
}
strRDPCertificates = RdwaConfig.GetRdpSigningCertificateHash();
}
if ( HttpContext.Current.User.Identity.IsAuthenticated == true )
{
// 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 )
{
bFailedLogon = true;
if ( bFailedAuthorization )
{
bFailedAuthorization = false; // Make sure to show one message.
}
}
if (bPasswordExpired)
{
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)
{
string strRedirectSafeUrl = null;
if (!String.IsNullOrEmpty(strRedirectUrl))
{
Uri redirectUri = new Uri(GetRealRequestUri(), strRedirectUrl);
if (
redirectUri.Authority.Equals(Request.Url.Authority) &&
redirectUri.Scheme.Equals(Request.Url.Scheme)
)
{
strRedirectSafeUrl = redirectUri.AbsoluteUri;
}
}
if (strRedirectSafeUrl == null)
{
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 = "tokenform.aspx";
}
}
Response.Redirect(strRedirectSafeUrl);
}
</script>
<RDWAPage
helpurl="<%=sHelpSourceServer%>"
workspacename="<%=SecurityElement.Escape(L_CompanyName_Text)%>"
baseurl="<%=SecurityElement.Escape(baseUrl.AbsoluteUri)%>"
>
<RenderFailureMessage>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><%=L_RenderFailTitle_Text%></title>
</head>
<body>
<h1><%=L_RenderFailTitle_Text%></h1>
<p><%=L_RenderFailP1_Text%></p>
<p><%=L_RenderFailP2_Text%></p>
<p><%=L_RenderFailP3_Text%></p>
</body>
</html>
</RenderFailureMessage>
<BodyAttr
onload="onLoginPageLoad(event)"
onunload="onPageUnload(event)"/>
<HTMLMainContent>
<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="RedirectorName" value="<%=SecurityElement.Escape(strRedirectorName)%>"/>
<input name="isUtf8" type="hidden" value="1"/>
<input type="hidden" name="flags" value="0"/>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td>
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<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>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="7"></td>
</tr>
<tr>
<td>
<table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="130" align="right"><%=L_PasswordLabel_Text%></td>
<td width="7"></td>
<td align="right">
<label><input id="UserPass" name="UserPass" type="password" class="textInputField" runat="server" size="25" autocomplete="off" /></label>
</td>
</tr>
</table>
</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)
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="trPasswordExpiredNoChange" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_PasswordExpiredNoChange_Text%></span></td>
</tr>
</table>
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bPasswordExpired == true)
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="trPasswordExpired" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_PasswordExpiredChangeBeginning_Text%><a id = "passwordchangelink" href="password.aspx<%=strPasswordExpiredQueryString%>"><%=L_PasswordExpiredChangeLink_Text%></a><%=L_PasswordExpiredChangeEnding_Text%></span></td>
</tr>
</table>
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bWorkspaceInUse == true )
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="trErrorWorkSpaceInUse" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_ExistingWorkspaceLabel_Text%></span></td>
</tr>
</table>
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bWorkspaceDisconnected == true )
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="trErrorWorkSpaceDisconnected" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_DisconnectedWorkspaceLabel_Text%></span></td>
</tr>
</table>
</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 ( bSessionExpired == true )
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="tr2" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_SessionExpired_Text %></span></td>
</tr>
</table>
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bFailedLogon == true )
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="trErrorIncorrectCredentials" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_LogonFailureLabel_Text%></span></td>
</tr>
</table>
</td>
</tr>
<tr id="trErrorDomainNameMissing" style="display:none" >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_DomainNameMissingLabel_Text%></span></td>
</tr>
</table>
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bFailedAuthorization )
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="trErrorUnauthorizedAccess" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_AuthorizationFailureLabel_Text%></span></td>
</tr>
</table>
</td>
</tr>
<%
strErrorMessageRowStyle = "style=\"display:none\"";
if ( bServerConfigChanged )
{
strErrorMessageRowStyle = "style=\"display:\"";
}
%>
<tr id="trErrorServerConfigChanged" <%=strErrorMessageRowStyle%> >
<td>
<table>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><span class="wrng"><%=L_ServerConfigChangedLabel_Text%></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%=L_SecurityLabel_Text%>&#160;<span id="spanToggleSecExplanation" style="display:none">(<a href="javascript:onclickExplanation('lnkShwSec')" id="lnkShwSec"><%=L_ShowExplanationLabel_Text%></a><a href="javascript:onclickExplanation('lnkHdSec')" id="lnkHdSec" style="display:none"><%=L_HideExplanationLabel_Text%></a>)</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" style="display:none" id="tablePublicOption" >
<tr>
<td width="30">
<label><input id="rdoPblc" type="radio" name="MachineType" value="public" class="rdo" onclick="onClickSecurity()" /></label>
</td>
<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>
</tr>
<tr>
<td height="7"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" style="display:none" id="tablePrivateOption" >
<tr>
<td width="30">
<label><input id="rdoPrvt" type="radio" name="MachineType" value="private" class="rdo" onclick="onClickSecurity()" checked="checked" /></label>
</td>
<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>
</tr>
<tr>
<td height="7"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr id="trPrvtWrn" style="display:none" >
<td width="30"></td>
<td><span class="wrng"><%=L_PrivateWarningLabel_Text%></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr id="trPrvtWrnNoAx" style="display:none">
<td><span class="wrng"><%=L_PrivateWarningLabelNoAx_Text%></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td align="right"><label><input type="submit" class="formButton" id="btnSignIn" value="<%=L_SignInLabel_Text%>" /></label>
</td>
</tr>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td height="20">&#160;</td>
</tr>
<tr>
<td><%=L_TSWATimeoutLabel_Text%></td>
</tr>
<tr>
<td height="30">&#160;</td>
</tr>
</table>
</form>
</HTMLMainContent>
</RDWAPage>

View file

@ -0,0 +1,50 @@
<% @Page Language="C#" Debug="true" %>
<script language="C#" runat=server>
void Page_Load(object sender, EventArgs e)
{
// Deny requests with "additional path information"
if (Request.PathInfo.Length != 0)
{
Response.StatusCode = 404;
Response.End();
}
string strQueryString = "";
if ( HttpContext.Current.User.Identity.IsAuthenticated == true )
{
Response.Redirect( "default.aspx" );
}
else
{
if ( Request.QueryString != null )
{
NameValueCollection objQueryString = Request.QueryString;
if ( objQueryString["Error"] != null )
{
if ( objQueryString["Error"].Equals("WkSInUse", StringComparison.CurrentCultureIgnoreCase) )
{
strQueryString = "?Error=WkSInUse";
}
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" + strQueryString );
}
}
</script>

Binary file not shown.

View file

@ -0,0 +1,429 @@
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<title ID=HELP_TITLE>RD Web Access Help</title>
<style>
.style1 {
}
.TSHelp{
font-family: "Segoe UI", "Calibri", Tahoma, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
font-variant: normal;
color: #000000;
line-height: normal;
text-transform: none;
background-color: #FFFFFF;
}
.UI{
font-weight: bold;
}
li {
margin-bottom: 3pt;
margin-top: 3pt;
}
h3 {
font-size: small;
color: #006666;
}
.WebUI {
font-weight: bold;
}
a:visited {
text-decoration: none;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple class="TSHelp">
<a name="_TopOfPage"></a><br><ID ID=INTRODUCTION>
<p>For the most current version of this information, see <a href="http://go.microsoft.com/fwlink/?LinkId=141038">http://go.microsoft.com/fwlink/?LinkId=141038</a>.</p>
<p>The Remote Desktop Web Access (RD Web Access) Web site enables you to use a web browser to access RemoteApp and Desktop Connections.</p>
</ID>
<h3 ID=TOPICS>Help Topics</h3>
<ul>
<li id=REMOTE_APP_DESKTOP_CONNECTIONS><a href="#UserTopic_What_is_RemoteApp_and_Desktop_Connections">What is RemoteApp and Desktop Connections?</a></li>
<li id=REMOTE_PROGRAMS><a href="#UserTopic_What_are_Remote_Programs">What is RemoteApp?</a></li>
<li id=STARTING_REMOTE_PROGRAMS><a href="#UserTopic_Starting_a_RemoteProgram">Starting a RemoteApp program</a></li>
<li id=STARTING_REMOTE_DESKTOP_TAB><a href="#UserTopic_What_is_the_Remote_Desktop_tab">What is the Remote Desktop tab?</a></li>
<li id=PUBLIC_PRIVATE_MODE><a href="#UserTopic_Public_Private_Mode">Public vs. private computer settings</a></li>
<li id=COMPUTER_REQ><a href="#UserTopic_Computer_requirements">Computer requirements</a></li>
<li id=CONTROL><a href="#UserTopic_Get_ActiveX">I am prompted to run the Remote Desktop Services ActiveX Client control. How do I do that?</a></li>
</ul>
<hr>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3><a name="UserTopic_What_is_RemoteApp_and_Desktop_Connections"><id id=REMOTE_APP_DESKTOP_CONNECTIONS2>What is RemoteApp and Desktop Connection?</id></a></h3>
<p ID=REMOTE_PROGRAMS_EXPLANATION >RemoteApp and Desktop Connection gives you a customized view of RemoteApp programs and virtual desktops
that have been made available to you by your network administrator.</p>
<p id=BACK><a href="#_TopOfPage">Back to topics</a></p>
<hr>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3><a name="UserTopic_What_are_Remote_Programs"><id id=REMOTE_PROGRAMS2>What is RemoteApp?</id></a></h3>
<p ID=REMOTE_PROGRAMS_EXPLANATION >Using RemoteApp, you can access programs on a remote computer through Remote Desktop Services.
Although the programs are running on a remote computer, RemoteApp programs behave as if they are running on your local computer.
For example, a RemoteApp program has its own entry in the taskbar, and you can resize, minimize, or maximize the program window.</p>
<p id=BACK><a href="#_TopOfPage">Back to topics</a></p>
<hr>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id=STARTING_REMOTE_PROGRAMS2><a name="UserTopic_Starting_a_RemoteProgram">Starting a RemoteApp program</a></h3>
<p ID=STARTING_REMOTE_PROGRAMS_EXPLANATION >To start a RemoteApp program or Remote Desktop session,
click the program icon in RD Web Access. When you&#39;re prompted for user credentials,
log on with your network user name and password.</p>
<p id=BACK><a href="#_TopOfPage">Back to topics</a></p>
<hr>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id=STARTING_REMOTE_DESKTOP_TAB2><a name="UserTopic_What_is_the_Remote_Desktop_tab">What is the Remote Desktop tab?</a></h3>
<p ID=STARTING_REMOTE_DESKTOP_TAB_EXPLANATION >The Remote Desktop tab allows you to connect from the RD Web Access website
to any desktop that is configured to accept Remote Desktop connections.</p>
<p id=BACK><a href="#_TopOfPage">Back to topics</a></p>
<hr>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id=PUBLIC_PRIVATE_MODE2><a name="UserTopic_Public_Private_Mode">Public vs. private computer settings</a></h3>
<p ID=PUBLIC_PRIVATE_MODE_EXPLANATION >If you connect to the RD Web Access site from a public computer,
such as a kiosk computer in a public establishment, or from a computer that you share with other users,
click <b>This is a public or shared computer</b>. You will need to provide both your user name and password
each time you sign in to the RD Web Access website.<br><br>
If you&#39;re using a work computer assigned to you, that you don&#39;t share with other people, click
<b>This is a private computer</b>. Your user name will be remembered, so you&#39;ll only have to provide your password
each time you sign in to the RD Web Access website.<br><br>
To protect against unauthorized access, RD Web Access sessions automatically end after a period of inactivity.
If your RD Web Access session ends, you&#39;ll need to sign in again. The amount of time before a session ends
is determined by your administrator.
</p>
<p id=BACK><a href="#_TopOfPage">Back to topics</a></p>
<hr>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id=COMPUTER_REQ2><a name="UserTopic_Computer_requirements">Computer requirements</a></h3>
<p ID=COMPUTER_REQ_EXPLANATION >To use RD Web Access, your computer must be running at least Internet Explorer 6.0 and
a version of Remote Desktop Connection (RDC) that supports at least Remote Desktop Protocol (RDP) 6.1.<BR><BR>
To determine the RDP version that RDC supports, start Remote Desktop Connection,
click the icon in the upper-left corner of the Remote Desktop Connection dialog box, and then click About.
The RDP version that RDC supports is listed in the About Remote Desktop Connection dialog box.<BR><BR>
RDC 6.1 supports Remote Desktop Protocol 6.1. RDC 6.1 is included with the following operating systems:<BR><BR>
<ul>
<li ID=LONGHORN >Windows&nbsp;Server 2008 </li>
<li ID=VISTA >Windows&nbsp;Vista with SP1</li>
<li ID=XP >Windows&nbsp;XP with SP3</li>
</ul>
The version of RDC in Windows 7 and Windows Server 2008 R2 supports RDP 7.0.<BR><BR>
Additionally, the Remote Desktop Services ActiveX Client control must be enabled. The ActiveX control
is included with RDC 6.1 and the version of RDC in Windows 7 and Windows Server 2008 R2.<BR><BR>
The version of RDC that you&#39;re using determines which features of RD Web Access are available to you.<BR><BR>
For more information about client requirements for using RD Web Access, see
<a href="http://go.microsoft.com/fwlink/?LinkId=142240">http://go.microsoft.com/fwlink/?LinkId=142240</a>.
</p>
<p id=BACK><a href="#_TopOfPage">Back to topics</a></p>
<hr>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3 id=CONTROL2><a name="UserTopic_Get_ActiveX">I am prompted to run the Remote Desktop Services ActiveX Client control. How can I do that?</a></h3>
<p ID=CONTROL_EXPLANATION >If you&#39;re prompted to run the Remote Desktop Services ActiveX Client control when you access RD Web Access,
do either of the following, depending on your operating system:
<ul>
<li ID=LONGHORN >If you&#39;re running Windows Server 2003 or Windows XP, and youre prompted to run the
Remote Desktop Services ActiveX Client control, click the message line,
click <b>Run ActiveX Control</b>, and then click <b>Run</b>.
After you have enabled the control, refresh the Web page.</li>
<li ID=VISTA >If you&#39;re running Windows Server 2008 or Windows Vista, click the warning message on
the Internet Explorer Information bar, point to <b>Add-on Disabled</b>,
and then click <b>Run ActiveX Control</b>. When you do this, you might see a
security warning. Make sure that the publisher of the ActiveX control is &quot;Microsoft Corporation&quot;
before you click <b>Run</b>.</li>
<li ID=XP >If you&#39;re running Windows Server 2008 R2 or Windows 7, in addition to the above steps, you can
choose to allow the ActiveX control to run only on this website.</li>
</ul>
If the Internet Explorer Information bar doesn&#39;t appear, you can enable the ActiveX control by using
the <b>Manage Add-ons</b> tool on the <b>Tools</b> menu of Internet Explorer.<BR><BR>
If your computer meets all of the client requirements but you do not see any programs listed,
contact your network administrator or the webmaster of the website.
</p>
<p id=BACK><a href="#_TopOfPage">Back to topics</a></p>
<hr>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>

Binary file not shown.

View file

@ -0,0 +1,173 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Helpers;
using System.Configuration;
using RADAR;
public partial class SMSToken : System.Web.UI.Page
{
String radiusServer;
String radiusSecret;
//
// Localizable Text
//
public const string L_SmsToken_Text = "Enter SMS Token:";
public const string L_LogonFailureLabel_Text = "The user name or password that you entered is not valid. Try typing it again.";
public const string L_SubmitLabel_Text = "Submit";
public const string L_CancelLabel_Text = "Cancel";
//
// Page Variables
//
public string sHelpSourceServer, sLocalHelp, strWorksSpaceName;
public Uri baseUrl;
public SMSToken() {
radiusServer = ConfigurationManager.AppSettings["RadiusServer"];
radiusSecret = ConfigurationManager.AppSettings["RadiusSecret"];
}
public void btnSignIn_Click(object sender, EventArgs e){
String username = (string)Session["DomainUserName"];
RADIUSAttributes atts = new RADIUSAttributes();
RADIUSAttribute state = (RADIUSAttribute)Session["state"];
RADIUSClient client = new RADIUSClient(radiusServer, 1812, radiusSecret);
atts.Add(state);
String encryptedChallangeResult = Crypto.SHA256(username + SmsToken.Text + radiusSecret);
RADIUSPacket response = client.Authenticate(username, encryptedChallangeResult, atts);
onRadiusResponse(response);
}
public void btnCancel_Click(object sender, EventArgs e){
SafeRedirect("logoff.aspx");
}
void onRadiusResponse(RADIUSPacket response) {
if (response.Code == RadiusPacketCode.AccessChallenge) {
onRadiusChallange(response);
}
else if (response.Code == RadiusPacketCode.AccessAccept) {
onRadiusAccept(response);
}
else {
Session["UserPass"] = "";
Session["DomainUserName"] = "";
SafeRedirect("logoff.aspx?Error=LoginSMSFailed");
}
}
void onRadiusChallange(RADIUSPacket response){
RADIUSAttribute state = response.Attributes.GetFirstAttribute(RadiusAttributeType.State);
Session["State"] = state;
}
void onRadiusAccept(RADIUSPacket response){
string sessionGuid = response.Attributes.GetFirstAttribute(RadiusAttributeType.ReplyMessage).GetString();
Session["SESSIONGUID"] = sessionGuid;
HttpCookie myCookie = new HttpCookie("RadiusSessionId");
DateTime now = DateTime.Now;
myCookie.Value = sessionGuid;
myCookie.Expires = now.AddMinutes(480);
Response.Cookies.Add(myCookie);
Session["SMSTOKEN"] = "SMS_AUTH";
SafeRedirect("default.aspx");
}
void SafeRedirect(string strRedirectUrl){
string strRedirectSafeUrl = null;
if (!String.IsNullOrEmpty(strRedirectUrl)){
Uri redirectUri = new Uri(GetRealRequestUri(), strRedirectUrl);
if (redirectUri.Authority.Equals(Request.Url.Authority) && redirectUri.Scheme.Equals(Request.Url.Scheme)){
strRedirectSafeUrl = redirectUri.AbsoluteUri;
}
}
if (strRedirectSafeUrl == null){
strRedirectSafeUrl = "default.aspx";
}
Response.Redirect(strRedirectSafeUrl, false);
}
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;
}
public static Uri GetRealRequestUri()
{
if ((HttpContext.Current == null) || (HttpContext.Current.Request == null))
throw new ApplicationException("Cannot get current request.");
return GetRealRequestUri(HttpContext.Current.Request);
}
void Page_PreInit(object Sender, EventArgs e){
// Deny requests with "additional path information"
if (Request.PathInfo.Length != 0)
{
Response.StatusCode = 404;
Response.End();
}
// gives us https://<machine>/rdweb/pages/<lang>/
baseUrl = new Uri(new Uri(GetRealRequestUri(), Request.FilePath), ".");
sLocalHelp = ConfigurationManager.AppSettings["LocalHelp"];
if ((sLocalHelp != null) && (sLocalHelp == "true")){
sHelpSourceServer = "./rap-help.htm";
}
else{
sHelpSourceServer = "http://go.microsoft.com/fwlink/?LinkId=141038";
}
}
void Page_Load(object sender, EventArgs e){
btnSignIn.Text = L_SubmitLabel_Text;
btnCancel.Text = L_CancelLabel_Text;
if (Page.IsPostBack){
return;
}
String username = (string)Session["DomainUserName"];
String password = (string)Session["UserPass"];
deliveryLabel.Text = (string)Session["Delivery"];
RADIUSClient client = new RADIUSClient(radiusServer, 1812, radiusSecret);
RADIUSAttributes atts = new RADIUSAttributes();
try{
VendorSpecificAttribute vsa = new VendorSpecificAttribute(VendorSpecificType.Generic, (string)Session["Delivery"]);
vsa.SetRADIUSAttribute(ref atts);
RADIUSPacket response = client.Authenticate(username, password, atts);
onRadiusResponse(response);
}
catch (Exception ex){
Session["UserPass"] = "";
Session["DomainUserName"] = "";
SafeRedirect("logoff.aspx?Error=LoginRadiusFailed");
}
}
}

View file

@ -0,0 +1,284 @@

#content
{
position:relative;
height:490px;
background-color:white;
color:Black;
vertical-align:top;
margin:0px;
padding:5px;
}
#homemain
{
position:relative;
top:0px;
width:900px;
margin-top:0px;
padding:0px;
background-color:Transparent;
text-align:left;
z-index:0;
}
body
{
background-image: url(../images/bg_globe_01.jpg);
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center center;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #7fa4bf;
}
body,td,th,select
{
font-family: "Segoe UI", "Calibri", Tahoma, sans-serif;
font-size: 12px;
color: #000000;
}
.pageBorder
{
border: 1px solid #444444;
}
.textInputField
{
font-family: "Segoe UI", "Calibri", Tahoma, sans-serif;
font-size: 12px;
color: #000000;
background-color: #EAF4FF;
}
.formButton
{
font-family: "Segoe UI", "Calibri", Tahoma, sans-serif;
font-size: 12px;
color: #000000;
}
/* Style for the Apply button in the Web-Part Edit Zone */
#ApplyButton
{
font-family: "Segoe UI", "Calibri", Tahoma, sans-serif;
font-size: 12px;
color: #000000;
}
.wrng
{
color: #C00000
}
.expl
{
color: #336699
}
.headingCompanyName
{
font-size: 24px;
font-family: "Segoe UI", "Calibri", Tahoma, sans-serif;
}
td.cellMSLogo > table
{
margin-right:0;
margin-left:auto;
}
td.cellSecondaryNavigationBar > table
{
margin-right:0;
margin-left:auto;
}
.headingApplicationName
{
font-size: 12px;
}
.headingTSWA
{
font-size: 11px;
}
.headingForActivePageInNavigationBar
{
font-size: 14px;
font-weight: bold;
color: #336699;
}
.linkPrimaryNavigiationBar a
{
color: #000000;
text-decoration: none;
font-size: 14px;
font-weight: bold;
}
.linkPrimaryNavigiationBar a:hover
{
color: #336699;
text-decoration: underline;
}
.linkSecondaryNavigiationBar a
{
color: #000000;
text-decoration: none;
font-size: 14px;
font-weight: bold;
}
.linkSecondaryNavigiationBar a:hover
{
color: #336699;
text-decoration: underline;
}
.dividerInNavigationBar
{
color: #CCCCCC;
}
.tswa_appboard
{
background-color:transparent;
position:relative;
top:18px;
font-size:12px;
}
.tswa_boss, .tswa_folder_boss, .tswa_up_boss
{
position:relative;
width:83px;
height:90px;
margin:0px;
padding:0px;
background-color:Transparent;
text-align:center;
vertical-align:middle;
float:left;
}
.tswa_boss_spacer
{
margin: 0px;
padding: 12px 1px 0px 4px;
}
.tswa_boss_img
{
border:none;
}
.tswa_iconimg
{
position:relative;
margin:0px;
top:-4px;
width:32px;
height:32px;
text-align:center;
}
.tswa_ttext
{
position:relative;
top:-1px;
width:70px;
height:42px;
font-size:11px;
line-height:13px;
text-overflow:ellipsis;
overflow:hidden;
text-align:center;
}
.tswa_vis0
{
visibility:hidden;
position:absolute;
top:0px;
left:3px;
height:85px;
width:77px;
background-color:Transparent;
}
.tswa_vis1
{
visibility:visible;
position:absolute;
top:0px;
left:3px;
height:85px;
width:77px;
background-color:Transparent;
}
.tswa_PublicCheckboxMore
{
position:relative;
font-size:12px;
}
.tswa_PublicCheckboxLess
{
position:relative;
font-size:12px;
}
.tswa_ShowOptimizeExperienceShiftedUp
{
position:relative;
font-size:12px;
}
.tswa_ShowOptimizeExperience
{
position:relative;
font-size:12px;
}
.tswa_error_icon
{
background-color:Transparent;
font-size:17px;
line-height:32px;
height:32px;
width:300px;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src='../images/erroricon.png',sizingMethod='crop');
margin-left:10px;
padding-left:45px
}
.tswa_error_msg
{
font-size:12px;
margin-left:55px;
padding-right:10px;
}
.tswa_CurrentFolderLabel
{
font-family: "Segoe UI", "Calibri", Tahoma, sans-serif;
color: #000000;
font-weight: bold;
font-size: 14px;
text-decoration : none;
margin-left: 25px;
margin-bottom: 10px;
}