Beispiel #1
0
 //CR00023 - Feb 09, 2010 - Add username in the IE title
 public string UserName()
 {
     try
     {
         if (System.Web.HttpContext.Current.Session["CurrentUserInfo"] != null)
         {
             iPAS_Base.CurrentUserInfo currentUserInfo = System.Web.HttpContext.Current.Session["CurrentUserInfo"] as iPAS_Base.CurrentUserInfo;
             return(currentUserInfo.UserName.ToString());
         }
         return(string.Empty);
     }
     catch
     {
         return(string.Empty);
     }
 }
Beispiel #2
0
 public string FirstName()
 {
     try
     {
         if (System.Web.HttpContext.Current.Session["CurrentUserInfo"] != null)
         {
             iPAS_Base.CurrentUserInfo currentUserInfo = System.Web.HttpContext.Current.Session["CurrentUserInfo"] as iPAS_Base.CurrentUserInfo;
             string userName = currentUserInfo.UserName.ToString();
             if (currentUserInfo.UserName.ToString().Length > 10)
             {
                 userName = currentUserInfo.UserName.ToString().Substring(0, 10);
                 userName = userName + "..";
             }
             return(userName);
         }
         return(string.Empty);
     }
     catch
     {
         return(string.Empty);
     }
 }
Beispiel #3
0
        protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
        {
            string emailID  = txtUserName.Text.Trim();
            string password = txtPassword.Text.Trim();
            string status   = string.Empty;

            try
            {
                if (emailID != string.Empty && password != string.Empty)
                {
                    string saltKeyValue         = GenerateSaltKey(emailID);
                    string encodedPwd           = GetHashedPasswordUsingSha256HashAlgorithm(password);
                    string hashedPwdWithSAltKey = GetHashedPasswordUsingSha256HashAlgorithm(encodedPwd + saltKeyValue);
                    string encryptedPassword    = Encoder.EncryptData(hashedPwdWithSAltKey);

                    currentUserInfo = iPAS_Base.CurrentUserInfo.GetCurrentUserInfo(emailID, encryptedPassword);
                    if (currentUserInfo != null)
                    {
                        System.Web.HttpContext.Current.Session["CurrentUserInfo"] = currentUserInfo;
                        args.IsValid = true;
                    }
                    else
                    {
                        args.IsValid = false;
                    }
                }
                else
                {
                    args.IsValid = false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }