| Server IP : 199.79.62.161 / Your IP : 216.73.216.245 [ Web Server : Microsoft-IIS/10.0 System : Windows NT MDUS-PP-WB12 10.0 build 20348 (Windows Server 2022) AMD64 User : IWPD_5096(nirmaowd) ( 0) PHP Version : 8.3.30 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/INETPUB/VHOSTS/nirmalamatha.edu.in/ponnuguruvayurappan.org/App_Code/ |
Upload File : |
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using DL;
namespace SoftTech.Aspnet.OdbcProvider
{
public class CustomMembership : MembershipProvider
{
public CustomMembership()
{
}
public override bool EnablePasswordReset
{
get { throw new Exception("The method or operation is not implemented.EnablePasswordReset"); }
}
public override bool EnablePasswordRetrieval
{
get { throw new Exception("The method or operation is not implemented.EnablePasswordRetrieval"); }
}
public override bool RequiresQuestionAndAnswer
{
get { throw new Exception("The method or operation is not implemented.RequiresQuestionAndAnswer"); }
}
public override string ApplicationName
{
get
{
throw new Exception("The method or operation is not implemented.ApplicationName");
}
set
{
throw new Exception("The method or operation is not implemented.ApplicationName");
}
}
public override int MaxInvalidPasswordAttempts
{
get { throw new Exception("The method or operation is not implemented.MaxInvalidPasswordAttempts"); }
}
public override int PasswordAttemptWindow
{
get { throw new Exception("The method or operation is not implemented.PasswordAttemptWindow"); }
}
public override bool RequiresUniqueEmail
{
get { throw new Exception("The method or operation is not implemented.RequiresUniqueEmail"); }
}
public override MembershipPasswordFormat PasswordFormat
{
get { throw new Exception("The method or operation is not implemented.PasswordFormat"); }
}
public override int MinRequiredPasswordLength
{
get { throw new Exception("The method or operation is not implemented.MinRequiredPasswordLength"); }
}
public override int MinRequiredNonAlphanumericCharacters
{
get { throw new Exception("The method or operation is not implemented.MinRequiredNonAlphanumericCharacters"); }
}
public override string PasswordStrengthRegularExpression
{
get { throw new Exception("The method or operation is not implemented.PasswordStrengthRegularExpression"); }
}
public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
throw new Exception("The method or operation is not implemented.CreateUser");
}
public override bool ChangePassword(string username, string oldPassword, string newPassword)
{
throw new Exception("The method or operation is not implemented.ChangePassword");
}
public override string ResetPassword(string username, string answer)
{
throw new Exception("The method or operation is not implemented.ResetPassword");
}
public override void UpdateUser(MembershipUser user)
{
throw new Exception("The method or operation is not implemented.UpdateUser");
}
public override bool ValidateUser(string username, string password)
{
using (DAL db = new DAL())
{
int count = (int)db.GetScalar("SELECT COUNT(AGENT_ID) FROM AGENTS WHERE USERNAME = '" + username + "' AND PWD = '" + password + "'");
if (count > 0)
return true;
else
return false;
}
}
public override bool UnlockUser(string userName)
{
throw new Exception("The method or operation is not implemented.UnlockUser");
}
public override MembershipUser GetUser(object providerUserKey, bool userIsOnline)
{
throw new Exception("The method or operation is not implemented.GetUser");
}
public override MembershipUser GetUser(string username, bool userIsOnline)
{
throw new Exception("The method or operation is not implemented.GetUser");
}
public override string GetUserNameByEmail(string email)
{
throw new Exception("The method or operation is not implemented.GetUserNameByEmail");
}
public override bool DeleteUser(string username, bool deleteAllRelatedData)
{
throw new Exception("The method or operation is not implemented.DeleteUser");
}
public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
{
using (DAL db = new DAL())
{
SqlDataReader dr = db.GetDataReader("SELECT FIRST_NAME FROM AGENTS ORDER BY FIRST_NAME");
if (dr == null)
{ totalRecords = 0; return null; }
MembershipUserCollection mem = new MembershipUserCollection();
while (dr.Read())
{
MembershipUser m = new MembershipUser("CustomMembership", dr["MEM_NAME"].ToString(), null, null, null, null, true, true, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now);
mem.Add(m);
}
totalRecords = dr.RecordsAffected;
dr.Close();
return mem;
}
}
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
{
base.Initialize(name, config);
}
public override int GetNumberOfUsersOnline()
{
throw new Exception("The method or operation is not implemented.GetNumberOfUsersOnline");
}
public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
throw new Exception("The method or operation is not implemented.FindUsersByName");
}
public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
{
throw new Exception("The method or operation is not implemented.FindUsersByEmail");
}
public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
{
throw new Exception("The method or operation is not implemented.ChangePasswordQuestionAndAnswer");
}
public override string GetPassword(string username, string answer)
{
throw new Exception("The method or operation is not implemented.GetPassword");
}
}
}