using System;
using Orciid.Core;

namespace Orciid.WebServices
{
	public class OrciidWebService: System.Web.Services.WebService
	{
		protected void CheckSSLRequirement(bool credentials)
		{
			string requiressl = Configuration.Instance.ContainsKey("ui.requiressl") ?
				Configuration.Instance.GetString("ui.requiressl") :
				"false";
			if (!Context.Request.IsSecureConnection &&
				(requiressl == "true" || (requiressl == "login" && credentials)))
					throw new Exception("SSL is required for this web service call.");
		}
	}
}
