예제 #1
0
        public DCUser2 AuthenticateUser(string sessionid, string username, string pwd, string pwdattempts)
        {
            UserBiz     m_ubiz = new UserBiz();
            User2Detail dtuser = null;
            DCUser2     dcusr  = null;
            GroupBiz    m_gbiz = new GroupBiz();

            try
            {
                dtuser = m_ubiz.AuthenticateUser(CryptoUtils.DecryptTripleDES(username), CryptoUtils.DecryptTripleDES(pwd),
                                                 GMConvert.GetInt16(CryptoUtils.DecryptTripleDES(pwdattempts)));
                if (dtuser != null && dtuser.LastLogon.HasValue)
                {
                    dtuser.Permissions = new List <int>();
                    List <Int32> groups = m_ubiz.GetGroups(dtuser.ID);
                    foreach (int group in groups)
                    {
                        dtuser.Permissions.AddRange(m_gbiz.GetPermissions(group));
                    }

                    dcusr = new DCUser2();
                    GMReflectionUtils.Copy(dtuser, dcusr);
                    SetCache(sessionid, dcusr);
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
            finally { m_ubiz.Dispose(); m_gbiz.Dispose(); }
            return(dcusr);
        }
예제 #2
0
 public void Save(User2Detail detusr, bool ispwdchangemanual)
 {
     if (ispwdchangemanual || !detusr.ID.HasValue || detusr.ID == 0)//when the password is getting changed manually or when a new user is created using the admin application
     {
         detusr.Password = GMUtilities.Security.CryptoUtils.EncryptSHA(detusr.Password);
     }
     m_db.Save(detusr);
 }
예제 #3
0
파일: User.cs 프로젝트: sravan202/Releases
        public User2Detail GetUserLogOn(string username, string pwd, Int16 pwdattempts, DateTime dtnow)
        {
            User2Map MapInstance = new User2Map();

            this.SetParameter(User2Map.Name, username);
            this.SetParameter(User2Map.Password, pwd);
            this.SetParameter(CommonMap.PasswordAttempts, pwdattempts);
            this.SetParameter(CommonMap.ServerDatetime, dtnow);
            User2Detail det = new User2Detail(GetReader(User2Map.ProcedureGetUserLogOn), MapInstance);

            return(det);
        }
예제 #4
0
파일: User.cs 프로젝트: sravan202/Releases
 public void Save(DCUser2 dcusr)
 {
     try
     {
         User2Detail detusr = new User2Detail();
         GMUtilities.GMReflectionUtils.Copy(dcusr, detusr);
         Save(detusr, (bool)dcusr.IsPasswordChangedManual);
         if ((bool)dcusr.IsPasswordChangedManual)
         {
             dcusr          = GetCache(dcusr.SessionID);
             dcusr.Password = CryptoUtils.EncryptSHA(dcusr.Password);
             SetCache(dcusr.SessionID, dcusr);
         }
     }
     catch (Exception exp)
     { throw exp; }
 }
예제 #5
0
        public User2Detail AuthenticateUser(string username, string pwd, Int16 pwdattempts)
        {
            Authentication auth   = new Authentication();
            User2Detail    dtuser = null;

            try
            {
                dtuser = auth.AuthenticateUser(username, pwd, pwdattempts);
            }
            catch (Exception exp) { throw exp; }
            finally
            {
                auth.Dispose();
                auth = null;
            }
            return(dtuser);
        }
예제 #6
0
파일: User.cs 프로젝트: sravan202/Releases
        public void ChangePassword(string sessionid, string userid, string oldpwd, string newpwd)
        {
            DCUser2 dcusr = GetCache(sessionid);

            if (string.Compare(dcusr.Password, CryptoUtils.EncryptSHA(oldpwd), true) != 0)
            {
                throw new ApplicationException(ErrorConstants.ExistingPassword);
            }
            User2Detail detusr = new User2Detail();

            detusr.ID                 = (Int32?)GMConvert.GetInt32(userid);
            detusr.Password           = CryptoUtils.EncryptSHA(newpwd);
            detusr.LastPassword       = CryptoUtils.EncryptSHA(oldpwd);
            detusr.PasswordChangeDate = DateTime.Now;
            detusr.IsChangePasssword  = false;
            detusr.ModifiedDate       = DateTime.Now;
            Save(detusr);
            dcusr.Password          = CryptoUtils.EncryptSHA(newpwd);
            dcusr.IsChangePasssword = false;
        }
예제 #7
0
파일: User2.cs 프로젝트: sravan202/Releases
 public void Save(User2Detail det)
 {
     Save(det, User2Map.ProcedureSave);
 }
예제 #8
0
파일: User.cs 프로젝트: sravan202/Releases
 private void Save(User2Detail detusr, bool ispwdchangemanual)
 {
     m_biz.Save(detusr, ispwdchangemanual);
 }
예제 #9
0
파일: User.cs 프로젝트: sravan202/Releases
 private void Save(User2Detail detusr)
 {
     Save(detusr, false);
 }
예제 #10
0
파일: User2.cs 프로젝트: sravan202/Releases
 public void Save(User2Detail det)
 {
     m_db.Save(det);
 }
예제 #11
0
 public void Save(User2Detail detusr)
 {
     Save(detusr, false);
 }