Files
mono/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs
T
Gaurav Vaish 640cca0055 2002-03-05 Gaurav Vaish <[email protected]>
* I am screwed up. I will now go back and read some theory and develop
  some architecture before I proceed on.

svn path=/trunk/mcs/; revision=2903
2002-03-05 11:46:49 +00:00

106 lines
2.3 KiB
C#

/**
* Namespace: System.Web.Security
* Class: FormsAuthentication
*
* Author: Gaurav Vaish
* Maintainer: [email protected]
* Contact: <[email protected]>, <[email protected]>
* Implementation: yes
* Status: ??%
*
* (C) Gaurav Vaish (2002)
*/
using System;
using System.Web;
using System.Web.Configuration;
namespace System.Web.Security
{
public sealed class FormsAuthentication
{
private static formsCookieName;
private static formsCookiePath;
private static bool isIntialized = false;
public FormsAuthentication()
{
}
public static string FormsCookieName
{
get
{
Initialize();
return formsCookieName;
}
}
public static string FormsCookiePath
{
get
{
Initialize();
return formsCookiePath;
}
}
[MonoTODO]
public static bool Authenticate(string name, string password)
{
if(name != null && password != null)
{
Initialize();
AuthenticationConfig cfg = (AuthenticatonConfig)HttpContext.Current.GetConfig("system.web/authentication");
Hashtable db = cfg.Credentials;
if(db == null)
{
//TraceBack("No_user_database");
return false;
}
string passwd = (String)(db[name.ToLower()]);
if(passwd == null)
{
//Traceback("No_user_in_databse")
return false;
}
throw new NotImplementedException();
/*
switch(cfg.PasswordFormat)
{
}*/
}
return false;
}
[MonoTODO]
public static FormsAuthenticationTicket Decrypt(string encryptedTicket)
{
if(encryptedTicket == null || encryptedTicket.Length == 0)
{
throw new HttpException(HttpRuntime.FormatResourceString("InvalidArgumentValue", "encryptedTicket"));
}
Initialize();
//Traceack("Decrypting cookie:" + encryptedTicket);
byte[] bytes = HexStringToBytesArray(encryptedTicket);
if(bytes == null || bytes.Length == 0)
{
throw new HttpException(HttpRuntime.FormatResourceString("InvalidArgumentValue", "encryptedTicket"));
}
throw new NotImplementedException();
}
private byte[] HexStringToBytesArray(string str)
{
throw new NotImplementedException();
}
private static void Traceback(string str)
{
// throw new NotImplementedException();
}
}
}