using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sphorium.WebDAV.Server.Framework;
using System.Reflection;
using System.Web;
using System.Web.Security;
namespace Everest.CmsServices.Rfc{
public class WebDAVHandler : WebDAVHandlerBase, IRfcHandler
{
#region Application
private string application;
public string Application
{
get
{
if (string.IsNullOrEmpty(application))
{
return Context.Request.QueryString["Application"];
}
return application;
}
set
{
application = value;
}
}
#endregion
public WebDAVHandler()
{
Authentication = Sphorium.WebDAV.Server.Framework.Classes.Authentication.None;
}
static WebDAVHandler()
{
DavSourceAssembly = Assembly.GetExecutingAssembly();
}
protected override void OnBasicAuthorization(Sphorium.WebDAV.Server.Framework.Classes.BasicAuthorizationArgs e)
{
base.OnBasicAuthorization(e);
if (string.IsNullOrEmpty(e.UserName))
{
throw new Exception(Resources.Account_SpecifyUserName);
}
e.Authorized = Membership.ValidateUser(e.UserName, e.Password);
}
#region IHttpHandler Members
public override void ProcessRequest(HttpContext context)
{
Context = context;
base.ProcessRequest(context);
context.Response.End();
}
public bool IsReusable
{
get { return false; }
}
#endregion
protected HttpContext Context { get; private set; }
}
}
|