예제 #1
0
        public static XVar clearSecuritySession()
        {
            dynamic toClear = XVar.Array();

            XSession.Session.Abandon();
            MVCFunctions.SetCookie(new XVar("username"), new XVar(""), (XVar)(MVCFunctions.time() - (365 * 1440) * 60));
            MVCFunctions.SetCookie(new XVar("password"), new XVar(""), (XVar)(MVCFunctions.time() - (365 * 1440) * 60));
            MVCFunctions.RemoveCookie("username");
            MVCFunctions.RemoveCookie("password");
            XSession.Session.Remove("UserID");
            XSession.Session.Remove("UserName");
            XSession.Session.Remove("AccessLevel");
            XSession.Session.Remove("fromFacebook");
            XSession.Session.Remove("UserRights");
            XSession.Session.Remove("LastReadRights");
            XSession.Session.Remove("GroupID");
            XSession.Session.Remove("OwnerID");
            XSession.Session.Remove("securityOverrides");
            toClear = XVar.Clone(XVar.Array());
            foreach (KeyValuePair <XVar, dynamic> v in XSession.Session.GetEnumerator())
            {
                if (MVCFunctions.substr((XVar)(v.Key), new XVar(-8)) == "_OwnerID")
                {
                    toClear.InitAndSetArrayItem(v.Key, null);
                }
            }
            foreach (KeyValuePair <XVar, dynamic> v in toClear.GetEnumerator())
            {
                XSession.Session.Remove(v.Key);
            }
            return(null);
        }
예제 #2
0
 protected virtual XVar assignCookieParams()
 {
     if ((XVar)(!(XVar)(MVCFunctions.strlen((XVar)(MVCFunctions.GetCookie("paramsLogger"))))) && (XVar)(!(XVar)(this.userID)))
     {
         MVCFunctions.SetCookie(new XVar("paramsLogger"), (XVar)(CommonFunctions.generatePassword(new XVar(24))), (XVar)(MVCFunctions.time() + (5 * 365) * 86400));
     }
     this.cookie = XVar.Clone(MVCFunctions.GetCookie("paramsLogger"));
     return(null);
 }
예제 #3
0
        public virtual XVar setCredentialsCookie(dynamic _param_pUsername, dynamic _param_pPassword)
        {
            #region pass-by-value parameters
            dynamic pUsername = XVar.Clone(_param_pUsername);
            dynamic pPassword = XVar.Clone(_param_pPassword);
            #endregion

            MVCFunctions.SetCookie(new XVar("username"), (XVar)((XVar.Pack(this.rememberPassword) ? XVar.Pack(pUsername) : XVar.Pack(""))), (XVar)(MVCFunctions.time() + (365 * 1440) * 60));
            MVCFunctions.SetCookie(new XVar("password"), (XVar)((XVar.Pack(this.rememberPassword) ? XVar.Pack(pPassword) : XVar.Pack(""))), (XVar)(MVCFunctions.time() + (365 * 1440) * 60));
            return(null);
        }