| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- /**
- * 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();
- //Traceback("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();
- }
- }
- }
|