2 * Namespace: System.Web.Security
\r
3 * Class: FormsAuthentication
\r
5 * Author: Gaurav Vaish
\r
6 * Maintainer: gvaish@iitk.ac.in
\r
7 * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
\r
8 * Implementation: yes
\r
11 * (C) Gaurav Vaish (2002)
\r
17 namespace System.Web.Security
\r
19 public sealed class FormsAuthentication
\r
21 private static formsCookieName;
\r
22 private static formsCookiePath;
\r
24 private static bool isIntialized = false;
\r
26 public FormsAuthentication()
\r
30 public static string FormsCookieName
\r
35 return formsCookieName;
\r
39 public static string FormsCookiePath
\r
44 return formsCookiePath;
\r
48 public static bool Authenticate(string name, string password)
\r
50 if(name != null && password != null)
\r
53 AuthenticationConfig cfg = (AuthenticatonConfig)HttpContext.Current.GetConfig("system.web/authentication");
\r
54 Hashtable db = cfg.Credentials;
\r
57 //TraceBack("No_user_database");
\r
60 string passwd = (String)(db[name.ToLower()]);
\r
63 //Traceback("No_user_in_databse")
\r
66 switch(cfg.PasswordFormat)
\r