How to add starfield validation to titanium sites

In the site root folder (typically server/tld/domain/www) create a file called starfield.ashx. Add the following code to the file:

<%@ WebHandler Language="C#" Class="StarfieldHandler" %>

using System.Web;
using TitaniumCore.Models;

public class StarfieldHandler : IHttpHandler
{
	public void ProcessRequest(HttpContext context)
	{
		// Get the "starfield" configuration entry from the database
		TitaniumCore.Models.Configuration starfieldConfig = TitaniumCore.Models.Configuration.GetConfigurationEntry("starfield");

		// Output the configuration value as plain text
		if (starfieldConfig != null)
		{
			context.Response.ContentType = "text/plain";
			context.Response.Write(starfieldConfig.Value);
		}
		else
		{
			context.Response.StatusCode = 404;
			context.Response.Write("Starfield configuration not found.");
		}
	}

	public bool IsReusable
	{
		get { return false; }
	}
}

Update global.asax.cs
in the SetAppRoutes() method add the following line of code above the line with the following comment:

//Adds the Ignore Routes:

RouteTable.Routes.IgnoreRoute(".well-known/{*pathInfo}"); // Ignore .well-known requests so the CMS doesn't handle them

Update web.config
before the closing </system.webServer> tag (note if there is already a <rewrite><rules> block only add the <rule></rule> block):



	  
			
				  
				  
			
	  

(You will need to use the inspector to view the above code or edit this page, then edit the above module to copy/paste the code as web.config uses formatting that may be interpreted as HTML and does not display properly on this page. DO NOT INCUDE THE <pre> AND <code> TAGS!)