/// <summary>
        /// Every guid module in page is set in cookie.
        /// This method is override in edit &amp; view controls for read the cookie
        /// and pass or denied access to edit or view module.
        /// [email protected] (2004/07/22)
        /// </summary>
        protected virtual void ModuleGuidInCookie()
        {
            HttpCookie cookie;
            DateTime   time;
            TimeSpan   span;
            string     guidsInUse = string.Empty;
            Guid       guid;

            ModulesDB mdb = new ModulesDB();

            if (portalSettings.ActivePage.Modules.Count > 0)
            {
                foreach (ModuleSettings ms in portalSettings.ActivePage.Modules)
                {
                    guid = mdb.GetModuleGuid(ms.ModuleID);
                    if (guid != Guid.Empty)
                    {
                        guidsInUse += guid.ToString().ToUpper() + "@";
                    }
                }
            }
            cookie         = new HttpCookie("RainbowSecurity", guidsInUse);
            time           = DateTime.Now;
            span           = new TimeSpan(0, 2, 0, 0, 0); // 120 minutes to expire
            cookie.Expires = time.Add(span);
            Response.AppendCookie(cookie);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This method override the security cookie for allow
        /// to access property pages of selected module in tab.
        /// [email protected] (2004/07/23)
        /// </summary>
        private void SetSecurityAccess()
        {
            HttpCookie cookie;
            DateTime   time;
            TimeSpan   span;
            string     guidsInUse = string.Empty;
            Guid       guid;

            ModulesDB mdb = new ModulesDB();

            foreach (ListItem li in leftPane.Items)
            {
                guid = mdb.GetModuleGuid(int.Parse(li.Value));
                if (guid != Guid.Empty)
                {
                    guidsInUse += guid.ToString().ToUpper() + "@";
                }
            }

            foreach (ListItem li in contentPane.Items)
            {
                guid = mdb.GetModuleGuid(int.Parse(li.Value));
                if (guid != Guid.Empty)
                {
                    guidsInUse += guid.ToString().ToUpper() + "@";
                }
            }

            foreach (ListItem li in rightPane.Items)
            {
                guid = mdb.GetModuleGuid(int.Parse(li.Value));
                if (guid != Guid.Empty)
                {
                    guidsInUse += guid.ToString().ToUpper() + "@";
                }
            }

            cookie         = new HttpCookie("RainbowSecurity", guidsInUse);
            time           = DateTime.Now;
            span           = new TimeSpan(0, 2, 0, 0, 0);    // 120 minutes to expire
            cookie.Expires = time.Add(span);
            base.Response.AppendCookie(cookie);
        }