/// <summary>
        /// Gets the login URL.
        /// </summary>
        /// <param name="returnURL">The URL to redirect to after logging in.</param>
        /// <param name="override">if set to <c>true</c>, show the login control on the current page, even if there is a login page defined for the site.</param>
        /// <returns>Formatted URL.</returns>
        public string LoginURL(Int32 StrUserId, DateTime LastModifiedOnDate, string returnURL, bool @override)
        {
            string strURL         = "";
            var    portalSettings = PortalController.Instance.GetCurrentPortalSettings();

            if (!string.IsNullOrEmpty(returnURL))
            {
                returnURL = String.Format("returnurl={0}", returnURL);
            }
            //var popUpParameter = "";
            //if (HttpUtility.UrlDecode(returnURL).Contains("popUp=true"))
            //{
            //    popUpParameter = "popUp=true";
            //}


            String TokenString = String.Format("token={0}", HttpUtility.UrlEncode(CryptionHelper.EncryptString(StrUserId.ToString(), "123456789")));
            String DateString  = String.Format("d={0}", HttpUtility.UrlEncode(CryptionHelper.EncryptString(LastModifiedOnDate.Ticks.ToString(), "x1x2x3x4x5")));

            if (portalSettings.LoginTabId != -1 && !@override)
            {
                if (Globals.ValidateLoginTabID(portalSettings.LoginTabId))
                {
                    strURL = string.IsNullOrEmpty(returnURL)
                                        ? Globals.NavigateURL(portalSettings.LoginTabId, "", TokenString, DateString)
                                        : Globals.NavigateURL(portalSettings.LoginTabId, "", returnURL, TokenString, DateString);
                }
                else
                {
                    string strMessage = String.Format("error={0}", Localization.GetString("NoLoginControl", Localization.GlobalResourceFile));
                    //No account module so use portal tab
                    strURL = string.IsNullOrEmpty(returnURL)
                                 ? Globals.NavigateURL(portalSettings.ActiveTab.TabID, "Login", strMessage, TokenString, DateString)
                                 : Globals.NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnURL, strMessage, TokenString, DateString);
                }
            }
            else
            {
                //portal tab
                strURL = string.IsNullOrEmpty(returnURL)
                                ? Globals.NavigateURL(portalSettings.ActiveTab.TabID, "Login", TokenString, DateString)
                                : Globals.NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnURL, TokenString, DateString);
            }
            return(strURL);
        }