private bool GetHashCodeFromFile(string filePath, out string hashCode)
        {
            bool result = false;

            hashCode = string.Empty;

            try
            {
                var bytes = File.ReadAllBytes(filePath);

                if (bytes != null && bytes.Length > 0)
                {
                    var encodedBytes = Convert.ToBase64String(bytes);

                    hashCode = CryptHelpers.ToMD5(encodedBytes);

                    result = true;
                }
            }
            catch (Exception e)
            {
                MsgLogger.Exception($"{GetType().Name}", e);
            }

            return(result);
        }
Ejemplo n.º 2
0
        public ActionResult RFIEPLevelDetails_Data(SearchCorporateER search)
        {
            try
            {
                string JCREmailDomain  = "@JCRINC.COM";
                string JCREmailDomain2 = "@JCAHO.COM";
                string encryptionKey   = ConfigurationManager.AppSettings.Get("EncryptionKey");

                JsonResult jr = new JsonResult();
                if (search.ProgramIDs == "-1")
                {
                    search.ProgramIDs = null;
                }
                if (search.SelectedChapterIDs == "-1")
                {
                    search.SelectedChapterIDs = null;
                }
                if (search.SelectedStandardIDs == "-1")
                {
                    search.SelectedStandardIDs = null;
                }

                List <RFIEPFinding> Level2Data = new List <RFIEPFinding>();
                Level2Data = TJCRFIFinding.GetRfiEPDetails(search);

                if (!AppSession.EmailAddress.ToUpper().Contains(JCREmailDomain) && !AppSession.EmailAddress.ToUpper().Contains(JCREmailDomain2))
                {
                    Level2Data.ToList().ForEach(data =>
                    {
                        data.TJCFinding = CryptHelpers.RFIDecrypt(data.TJCFinding, encryptionKey);
                    });
                }
                else
                {
                    Level2Data.ToList().ForEach(data => data.TJCFinding = string.Empty);
                }

                jr = Json(Level2Data, JsonRequestBehavior.AllowGet);
                jr.MaxJsonLength  = Int32.MaxValue;
                jr.RecursionLimit = 100;
                return(jr);
            }

            catch (Exception ex)
            {
                ExceptionLog exceptionLog = new ExceptionLog
                {
                    ExceptionText = "Reports: " + ex.Message,
                    PageName      = "TjcRFIFinding",
                    MethodName    = "RFIEPLevelDetails_Data",
                    UserID        = Convert.ToInt32(AppSession.UserID),
                    SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                    TransSQL      = "",
                    HttpReferrer  = null
                };
                exceptionService.LogException(exceptionLog);

                return(RedirectToAction("Error", "Transfer"));
            }
        }
Ejemplo n.º 3
0
        private bool GenerateOutput(string base64EncodedInput)
        {
            bool result = false;

            if (FileHelper.ChangeFileNameExtension(InputFileName, "md5", out var md5Path))
            {
                try
                {
                    string hashCode = CryptHelpers.ToMD5(base64EncodedInput);

                    OutputHashCode = hashCode;

                    File.WriteAllText(md5Path, hashCode);

                    OutputFileName = md5Path;
                }
                catch (Exception e)
                {
                    MsgLogger.Exception($"{GetType().Name} - GenerateOutput", e);
                }

                result = true;
            }
            else
            {
                MsgLogger.WriteError($"{GetType().Name} - Run", $"Cannot change file '{InputFileName}' extension!");
            }

            return(result);
        }
Ejemplo n.º 4
0
        public static async Task <string> GetImageHashCode(ImageSource image)
        {
            var base64 = await GetImageAsBase64(image);

            string result = CryptHelpers.ToMD5(base64);

            return(result);
        }
Ejemplo n.º 5
0
        public static UserIdentity HashPassword(this UserIdentity identity)
        {
            var result = identity.Clone();

            result.Password = CryptHelpers.ToSha256(identity.Password);

            return(result);
        }
Ejemplo n.º 6
0
        public int UpdateUserPassword(int userId, string password, out string rtnMessage)
        {
            int rtn;

            try
            {
                // validatePassword

                password = Encoding.Default.GetString(Convert.FromBase64String(password));

                if (password.Length < 6)
                {
                    rtnMessage = "A new password between 6 and 10 characters is required...";
                    rtn        = 0;
                    return(rtn);
                }


                char[] anyChars = { ';', '\'', '-' }; // special chars

                int index = password.IndexOfAny(anyChars);
                if (index >= 0)
                {
                    rtnMessage = "Password should not contain special character ';', '\'', '-'";
                    rtn        = 0;
                }
                else
                {
                    password = CryptHelpers.Encrypt(password.Trim(), WebConstants.EncryptionKey);
                    int      passwordResetInterval = GetPasswordResetInterval(userId);
                    DateTime expirationDate        = DateTime.Now.AddDays(passwordResetInterval);
                    UpdateUserSecurityAttribute(userId, (int)Enums.UserSecurityAttributeType.Password, password, DateTime.Now, expirationDate);
                    UpdateUserSecurityAttribute(userId, (int)Enums.UserSecurityAttributeType.ForcePasswordReset, "FALSE", DateTime.Now, DateTime.Now);

                    rtnMessage = "Your password was successfully reset. Use the new password to login.";

                    rtn = 1;
                }
            }
            catch (Exception ex)
            {
                if (password.Length < 6)
                {
                    rtnMessage = "A new password between 6 and 10 characters is required...";
                }
                else
                {
                    rtnMessage = "Password should not contain special character ';', '\'', '-'";
                }


                rtn = 0;
            }

            return(rtn);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Portal
        /// </summary>
        /// <returns>redirects to portal</returns>
        public ActionResult Portal()
        {
            string url = string.Format("{0}?FromProduct={1}",
                                       ConfigurationManager.AppSettings["JcrPortalUrl"],
                                       CryptHelpers.Encrypt(AppSession.UserID + "|" + ((int)AppSession.SelectedSiteId).ToString(),
                                                            WebConstants.ENCRYPT_KEY));

            //AppSession.AbandonSession();
            return(Redirect(url));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Checks for autrhorization header in the request and parses it, creates user credentials and returns as BasicAuthenticationIdentity
        /// </summary>
        /// <param name="filterContext"></param>
        protected virtual BasicAuthenticationIdentity FetchAuthHeader(HttpActionContext filterContext)
        {
            string authHeaderValue = null;
            var    authRequest     = filterContext.Request.Headers.Authorization;

            if (authRequest != null && !String.IsNullOrEmpty(authRequest.Scheme) && authRequest.Scheme == "Basic")
            {
                authHeaderValue = authRequest.Parameter;
            }
            if (string.IsNullOrEmpty(authHeaderValue))
            {
                return(null);
            }
            authHeaderValue = Encoding.Default.GetString(Convert.FromBase64String(authHeaderValue));
            var credentials = authHeaderValue.Split(':');

            var isGuestUser = false;

            if (authHeaderValue.Contains("guestuser"))
            {
                isGuestUser = true;
            }
            //Encoding password to match with Database password
            // var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(credentials[1]);
            // password =  System.Convert.ToBase64String(credentials[1]);
            var password = string.Empty;

            if (isGuestUser)
            {
                password = credentials[1].Trim();
            }
            else
            {
                password = CryptHelpers.Encrypt(credentials[1].Trim(), "jcr");
            }

            int?subscriptionTypeId = null;
            int tempInt            = 0;

            if (credentials.Length > 2 && int.TryParse(credentials[2].Trim(), out tempInt))
            {
                subscriptionTypeId = Convert.ToInt32(credentials[2].Trim());
            }
            string errorMessage = string.Empty;

            return(credentials.Length < 2 ? null : new BasicAuthenticationIdentity(credentials[0], password, subscriptionTypeId, errorMessage, isGuestUser));
        }
Ejemplo n.º 9
0
        public void RedirectToWebApp(string webApp, int pageID, string searchstring)
        {
            try {
                string productUrl = string.Empty;
                string plainText  = string.Format("UserID|{0}|Token|{1}|PageID|{2}|AdminUserID|{3}|UserOriginalRoleID|{4}|SearchString|{5}|currentUTCtime|{6}",
                                                  AppSession.UserID,
                                                  AppSession.AuthToken,
                                                  pageID,
                                                  AppSession.AdminUserID,
                                                  AppSession.UserOriginalRoleID,
                                                  searchstring,
                                                  DateTime.UtcNow.ToString(CultureInfo.InvariantCulture));

                if (AppSession.HasValidSession)
                {
                    switch (webApp.ToLower())
                    {
                    case "tracers":
                        productUrl = ConfigurationManager.AppSettings["TracersUrl"];
                        break;

                    case "amp":
                        productUrl = ConfigurationManager.AppSettings["AmpUrl"];
                        break;

                    case "admin":
                        productUrl = ConfigurationManager.AppSettings["AdminUrl"];
                        break;
                    }

                    // System.Diagnostics.Debug.WriteLine(string.Format("{0}?FromProduct={1}", productUrl, plainText));
                    // Example URL created above:
                    // http://localhost:8284/Transfer/Index?FromProduct=UserID|100106|Token|0e5f063e-a5e9-43a0-9d56-30436278918c|PageID|31|AdminUserID|178276|UserOriginalRoleID|5|currentUTCtime|10/20/2017 17:53:34

                    string url = string.Format("{0}?FromProduct={1}", productUrl, CryptHelpers.Encrypt(plainText, WebConstants.ENCRYPT_KEY));
                    Response.Redirect(url);
                }
            }
            catch (Exception ex) {
                throw (ex);
            }
        }
Ejemplo n.º 10
0
        public ActionResult RFIReport_Data(SearchCorporateER search, int LevelIdentifier)
        {
            try
            {
                JsonResult jr = new JsonResult();
                if (search.ProgramIDs == "-1")
                {
                    search.ProgramIDs = null;
                }
                if (search.SelectedChapterIDs == "-1")
                {
                    search.SelectedChapterIDs = null;
                }
                if (search.SelectedStandardIDs == "-1")
                {
                    search.SelectedStandardIDs = null;
                }

                string JCREmailDomain  = "@JCRINC.COM";
                string JCREmailDomain2 = "@JCAHO.COM";
                string encryptionKey   = ConfigurationManager.AppSettings.Get("EncryptionKey");

                switch (LevelIdentifier)
                {
                case (int)WebConstants.RFISummaryLevels.Level1_Program:
                {
                    List <RFIProgramFinding> Level1Data = new List <RFIProgramFinding>();
                    Level1Data = TJCRFIFinding.GetRFIFindingByProgram(search);

                    jr = Json(Level1Data, JsonRequestBehavior.AllowGet);
                    break;
                }

                case (int)WebConstants.RFISummaryLevels.Level2_Chapter:
                {
                    if (search.IsDuplicateLoadCall)
                    {
                        jr = TempData["PTR_Level2Data"] as JsonResult;
                    }
                    else
                    {
                        List <RFIChapterFinding> Level2Data = new List <RFIChapterFinding>();
                        Level2Data = TJCRFIFinding.GetRFIFindingByChapter(search);
                        jr         = Json(Level2Data, JsonRequestBehavior.AllowGet);
                        TempData["PTR_Level2Data"] = jr;
                    }
                    break;
                }

                case (int)WebConstants.RFISummaryLevels.Level3_Standard:
                {
                    if (search.IsDuplicateLoadCall)
                    {
                        jr = TempData["PTR_Level3Data"] as JsonResult;
                    }
                    else
                    {
                        List <RFIStandardFinding> Level3Data = new List <RFIStandardFinding>();
                        Level3Data = TJCRFIFinding.GetRFIFindingByStandard(search);

                        var max = Convert.ToInt32(Level3Data.Max(r => r.CumulativePerc));
                        Session["MaxStandardCount"] = max >= 100 ? 100 : max;

                        jr = Json(Level3Data, JsonRequestBehavior.AllowGet);
                        TempData["PTR_Level3Data"] = jr;
                    }
                    break;
                }

                case (int)WebConstants.RFISummaryLevels.Level4_EP:
                {
                    string tjcFinding = string.Empty;
                    List <RFIEPFinding> Level4Data = new List <RFIEPFinding>();

                    Level4Data = TJCRFIFinding.GetRfiEPDetails(search);

                    if (!AppSession.EmailAddress.ToUpper().Contains(JCREmailDomain) && !AppSession.EmailAddress.ToUpper().Contains(JCREmailDomain2))
                    {
                        Level4Data.ToList().ForEach(data =>
                            {
                                data.TJCFinding = CryptHelpers.RFIDecrypt(data.TJCFinding, encryptionKey);
                            });
                    }
                    else
                    {
                        Level4Data.ToList().ForEach(data => data.TJCFinding = string.Empty);
                    }

                    jr = Json(Level4Data, JsonRequestBehavior.AllowGet);
                    break;
                }

                case (int)WebConstants.RFISummaryLevels.Level5_EPDetails:
                {
                    List <RFIStandardFinding> Level5Data = new List <RFIStandardFinding>();
                    Level5Data = TJCRFIFinding.GetRFIFindingByStandard(search);
                    jr         = Json(Level5Data, JsonRequestBehavior.AllowGet);
                    break;
                }
                }
                jr.MaxJsonLength  = Int32.MaxValue;
                jr.RecursionLimit = 100;
                return(jr);
            }

            catch (Exception ex)
            {
                ExceptionLog exceptionLog = new ExceptionLog
                {
                    ExceptionText = "Reports: " + ex.Message,
                    PageName      = "TjcRFIFinding",
                    MethodName    = "RFIReport_Data",
                    UserID        = Convert.ToInt32(AppSession.UserID),
                    SiteId        = Convert.ToInt32(AppSession.SelectedSiteId),
                    TransSQL      = "",
                    HttpReferrer  = null
                };
                exceptionService.LogException(exceptionLog);

                return(RedirectToAction("Error", "Transfer"));
            }
        }
Ejemplo n.º 11
0
        public static string ValidatePasswordRules(int userId, string newPassword)
        {
            //get existing site settings
            string attributeList = "";
            int    siteId;
            string existingPassword;

            List <ApiSelectSiteAttributeMapReturnModel> passwordRestrictions = new List <ApiSelectSiteAttributeMapReturnModel>();

            attributeList = ((int)Enums.CodeCategoryEnum.SitePasswordResetInterval).ToString() + "," +
                            ((int)Enums.CodeCategoryEnum.SitePasswordSpecialRequirements).ToString() + "," +
                            ((int)Enums.CodeCategoryEnum.SitePasswordLength).ToString() + "," +
                            ((int)Enums.CodeCategoryEnum.SitePasswordUpperCaseRequirements).ToString() + "," +
                            ((int)Enums.CodeCategoryEnum.SitePasswordNumericRequirements).ToString();
            ExceptionLogServices exceptionLog = new ExceptionLogServices();

            using (var db = new DBAMPContext())
            {
                try
                {
                    siteId = db.ApiGetUserDefaultSiteId(userId).FirstOrDefault().DefaultSelectedSiteId;
                }
                catch (Exception ex)
                {
                    string sqlParam   = "ApiGetUserDefaultSiteId(" + userId + ")";
                    string methodName = "JCRAPI/Business/UserServices/ValidatePasswordRules";
                    exceptionLog.ExceptionLogInsert(ex.Message.ToString(), "", methodName, userId, null, sqlParam, string.Empty);

                    siteId = 0;
                }
                try
                {
                    existingPassword = db.ApiGetUserPassword(userId).FirstOrDefault().AttributeValue;
                }
                catch (Exception ex)
                {
                    string sqlParam   = "ApiGetUserPassword(" + userId + ")";
                    string methodName = "JCRAPI/Business/UserServices/ValidatePasswordRules";
                    exceptionLog.ExceptionLogInsert(ex.Message.ToString(), "", methodName, userId, siteId, sqlParam, string.Empty);

                    existingPassword = string.Empty;
                }
            }

            using (var db = new DBMEdition01Context())
            {
                try
                {
                    passwordRestrictions = db.ApiSelectSiteAttributeMap(siteId, attributeList);
                }
                catch (Exception ex)
                {
                    string sqlParam   = "ApiSelectSiteAttributeMap(" + siteId + "," + attributeList + ")";
                    string methodName = "JCRAPI/Business/UserServices/ValidatePasswordRules";
                    exceptionLog.ExceptionLogInsert(ex.Message.ToString(), "", methodName, userId, siteId, sqlParam, string.Empty);

                    existingPassword = string.Empty;
                }
            }


            bool   textRestrictions = false;
            string retValue         = "";
            bool   passwordGood     = true;


            foreach (var restriction in passwordRestrictions)

            {
                int rowCode  = Convert.ToInt32(restriction.AttributeTypeID.ToString());
                int rowValue = Convert.ToInt32(restriction.AttributeValueID.ToString());
                switch (rowCode)
                {
                case (int)Enums.CodeCategoryEnum.SitePasswordLength:
                    if (newPassword.Trim().Length < rowValue)
                    {
                        retValue    += "###Minimum Password Length is " + rowValue.ToString() + " Characters";
                        passwordGood = false;
                    }
                    break;

                case (int)Enums.CodeCategoryEnum.SitePasswordResetInterval:

                    string encyptEnteredPwd = "";
                    if (newPassword.Trim().Length > 0)
                    {
                        encyptEnteredPwd = CryptHelpers.Encrypt(newPassword.Trim(), WebConstants.EncryptionKey);
                    }

                    if (encyptEnteredPwd == existingPassword)
                    {
                        retValue    += "###Existing password cannot be used";
                        passwordGood = false;
                    }
                    break;

                case (int)Enums.CodeCategoryEnum.SitePasswordSpecialRequirements:
                    if (rowValue == 1)
                    {
                        char[] anyChars =
                        {
                            '!', '#', '$', '%', '&', '(',  ')', '*', '+', ',', '.', '/', ':', '<',
                            '='
                            ,    '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~',
                            '"'
                        };
                        // special chars
                        int index = newPassword.IndexOfAny(anyChars);
                        if (index < 0)
                        {
                            passwordGood = false;
                            retValue    +=
                                "###At least one Special Character is required: ! # $ % & ( ) * + , . / : < = > ? @ [ \\ ] ^ _ ` { | } ~ \"  Characters below cannot be used  ' - ; ";
                        }
                        textRestrictions = true;
                    }
                    break;

                case (int)Enums.CodeCategoryEnum.SitePasswordUpperCaseRequirements:
                    if (rowValue == 1)
                    {
                        char[] anyChars =
                        {
                            'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
                            'O'
                            ,    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
                        };
                        // special chars
                        int index = newPassword.IndexOfAny(anyChars);
                        if (index < 0)
                        {
                            passwordGood = false;
                            retValue    += "###At least one Upper Case Character is required ";
                        }
                        textRestrictions = true;
                    }
                    break;

                case (int)Enums.CodeCategoryEnum.SitePasswordNumericRequirements:
                    if (rowValue == 1)
                    {
                        char[] anyChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };     // special chars
                        int    index    = newPassword.IndexOfAny(anyChars);
                        if (index < 0)
                        {
                            passwordGood = false;
                            retValue    += "###At least one Numeric Character is required ";
                        }
                        textRestrictions = true;
                    }
                    break;
                }
            }
            if (textRestrictions)
            {
                char[] anyChars =
                {
                    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
                    'q',
                    'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
                };                   // special chars
                int index = newPassword.IndexOfAny(anyChars);
                if (index < 0)
                {
                    passwordGood = false;
                    retValue    += "###At least one Lower Case Character is required";
                }
            }
            if (passwordGood)
            {
                retValue = "";
            }
            return(retValue);
        }
Ejemplo n.º 12
0
        public ActionResult AdminRedirect()
        {
            // int pageID = (int)Enum.Parse(typeof(ApplicationPage), pageName);
            string url = "";

            if (AppSession.HasValidSession)
            {
                var linkType = ((int)WebConstants.LinkType.AmpHome).ToString();
                var appurl   = ConfigurationManager.AppSettings["AdminUrl"].ToString();
                var fromType = "FromPortal";

                var sbQueryString = new StringBuilder();

                sbQueryString.Append(ProductQueryStringKey.LinkType);
                sbQueryString.Append("|");
                sbQueryString.Append(linkType);
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.UserName);
                sbQueryString.Append("|");
                sbQueryString.Append(AppSession.EmailAddress);
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.SelectedSiteID);
                sbQueryString.Append("|");
                sbQueryString.Append(((int)AppSession.SelectedSiteId).ToString());
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.SelectedSiteName);
                sbQueryString.Append("|");
                sbQueryString.Append(AppSession.SelectedSiteName);
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.SelectedProgramID);
                sbQueryString.Append("|");

                sbQueryString.Append(AppSession.SelectedProgramId);

                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.SelectedProgramName);
                sbQueryString.Append("|");
                sbQueryString.Append(AppSession.SelectedProgramName);
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.SelectedCertificationItemID);
                sbQueryString.Append("|");
                sbQueryString.Append(AppSession.SelectedCertificationItemID);
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.UserID);
                sbQueryString.Append("|");
                sbQueryString.Append(AppSession.UserID);
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.RoleID);
                sbQueryString.Append("|");
                sbQueryString.Append(AppSession.RoleID.ToString());
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.currentUTCtime);
                sbQueryString.Append("|");
                sbQueryString.Append(DateTime.UtcNow.ToString(CultureInfo.InvariantCulture));
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.PageID);
                sbQueryString.Append("|");
                sbQueryString.Append((int)ApplicationPage.AccessDenied);
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.CycleID);
                sbQueryString.Append("|");
                sbQueryString.Append(((int)AppSession.CycleID).ToString());
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.UserOriginalRoleID);  // When GAdmin is logged-in as customer, this value is 5.
                sbQueryString.Append("|");
                sbQueryString.Append(AppSession.UserOriginalRoleID);
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.UserOriginalID);  // When GAdmin is [email protected], logged-in as customer, this value is 178276
                sbQueryString.Append("|");
                sbQueryString.Append(AppSession.AdminUserID);
                sbQueryString.Append("|");
                sbQueryString.Append(ProductQueryStringKey.IsAdmin);
                sbQueryString.Append("|");
                sbQueryString.Append("Admin");

                // If Global Admin logged-in as customer and went from AMP to Reports and now wants to go to Global Admin, here's what
                // the Querystring might look like:
                // http://localhost:44444/Login.aspx?FromPortal=LinkType|1|UserName|[email protected]|SelectedSiteID|681|SelectedSiteName|Edith Nourse Rogers Memorial Veterans Hospital|SelectedProgramID|2|SelectedProgramName|Hospital|SelectedCertificationItemID|0|UserID|100106|RoleID|1|currentUTCtime|11/27/2017 20:47:36|PageID|18|CycleID|22|UserOriginalRoleID|5|UserOriginalID|178276|IsAdmin|Admin
                // System.Diagnostics.Debug.WriteLine(string.Format("{0}?{1}={2}", appurl, fromType, sbQueryString.ToString()));
                // System.Diagnostics.Debug.WriteLine("pause");

                url = string.Format("{0}?{1}={2}",
                                    appurl, fromType,
                                    CryptHelpers.Encrypt(sbQueryString.ToString(),
                                                         WebConstants.ENCRYPT_KEY));
            }
            else
            {
                url = ConfigurationManager.AppSettings["JcrPortalUrl"].ToString() + "?qs=1";
            }

            //AppSession.AbandonSession();
            return(Redirect(url));
        }