Skip to content

Commit 85f0307

Browse files
authored
Merge pull request #85 from jackbuehner/ts-filter
Filter the webfeed to a single terminal server by specifying the terminalServer query parameter
2 parents 9bd6360 + 3ef2c4b commit 85f0307

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

aspx/wwwroot/webfeed.aspx.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected void Page_Load(object sender, EventArgs e)
3939
ProcessMultiuserResources(multiuserResourcesFolder);
4040

4141
HttpContext.Current.Response.ContentType = (schemaVersion >= 2.0 ? "application/x-msts-radc+xml; charset=utf-8" : "text/xml; charset=utf-8");
42-
string serverName = System.Net.Dns.GetHostName();
42+
string serverName = searchParams["terminalServer"] ?? System.Net.Dns.GetHostName();
4343
string serverFQDN = HttpContext.Current.Request.Url.Host;
4444
string datetime = DateTime.Now.Year.ToString() + "-" + (DateTime.Now.Month + 100).ToString().Substring(1, 2) + "-" + (DateTime.Now.Day + 100).ToString().Substring(1, 2) + "T" + (DateTime.Now.Hour + 100).ToString().Substring(1, 2) + ":" + (DateTime.Now.Minute + 100).ToString().Substring(1, 2) + ":" + (DateTime.Now.Second + 100).ToString().Substring(1, 2) + ".0Z";
4545

@@ -507,6 +507,13 @@ public static System.Guid GetResourceGUID(string rdpFilePath, string suffix = ""
507507

508508
private void ProcessResource(Resource resource)
509509
{
510+
// if the terminal server is specified in the search parameters,
511+
// skip resources that do not match the terminal server
512+
if (!string.IsNullOrEmpty(searchParams["terminalServer"]) && resource.FullAddress != searchParams["terminalServer"])
513+
{
514+
return;
515+
}
516+
510517
string resourceTimestamp = resource.LastUpdated.ToString("yyyy-MM-ddTHH:mm:ssZ");
511518

512519
// add the timestamp to the terminal server timestamps if it is the latest one

0 commit comments

Comments
 (0)