Exemplo n.º 1
0
        public static XVar saveRedirectURL()
        {
            dynamic query = null, url = null;

            url   = XVar.Clone(MVCFunctions.GetScriptName());
            query = new XVar("");
            foreach (KeyValuePair <XVar, dynamic> value in MVCFunctions.EnumeratePOST())
            {
                if ((XVar)(value.Key == "a") && (XVar)(value.Value == "logout"))
                {
                    continue;
                }
                if (query != XVar.Pack(""))
                {
                    query = MVCFunctions.Concat(query, "&");
                }
                if (XVar.Pack(MVCFunctions.is_array((XVar)(value.Value))))
                {
                    query = MVCFunctions.Concat(query, MVCFunctions.RawUrlEncode((XVar)(MVCFunctions.Concat(value.Key, "[]"))), "=");
                    query = MVCFunctions.Concat(query, MVCFunctions.implode((XVar)(MVCFunctions.Concat(MVCFunctions.RawUrlEncode((XVar)(MVCFunctions.Concat(value.Key, "[]"))), "=")), (XVar)(value.Value)));
                }
                else
                {
                    query = MVCFunctions.Concat(query, MVCFunctions.RawUrlEncode((XVar)(value.Key)));
                    if (XVar.Pack(MVCFunctions.strlen((XVar)(value.Value))))
                    {
                        query = MVCFunctions.Concat(query, "=", MVCFunctions.RawUrlEncode((XVar)(value.Value)));
                    }
                }
            }
            if (query != XVar.Pack(""))
            {
                url = MVCFunctions.Concat(url, "?", query);
            }
            XSession.Session["MyURL"] = url;
            return(null);
        }
Exemplo n.º 2
0
        public virtual XVar getFullUrl()
        {
            dynamic https = null;

            https = XVar.Clone((XVar)(MVCFunctions.strlen((XVar)(MVCFunctions.GetServerVariable("HTTPS"))) != 0) && (XVar)(!XVar.Equals(XVar.Pack(MVCFunctions.GetServerVariable("HTTPS")), XVar.Pack("off"))));
            return(MVCFunctions.Concat((XVar.Pack(https) ? XVar.Pack("https://") : XVar.Pack("http://")), (XVar.Pack(MVCFunctions.strlen((XVar)(MVCFunctions.GetRemoteUser())) != 0) ? XVar.Pack(MVCFunctions.Concat(MVCFunctions.GetRemoteUser(), "@")) : XVar.Pack("")), (XVar.Pack(MVCFunctions.SERVERKeyExists("HTTP_HOST")) ? XVar.Pack(MVCFunctions.GetServerVariable("HTTP_HOST")) : XVar.Pack(MVCFunctions.Concat(MVCFunctions.GetServerName(), (XVar.Pack((XVar)((XVar)(https) && (XVar)(XVar.Equals(XVar.Pack(MVCFunctions.GetServerPort()), XVar.Pack(443)))) || (XVar)(XVar.Equals(XVar.Pack(MVCFunctions.GetServerPort()), XVar.Pack(80)))) ? XVar.Pack("") : XVar.Pack(MVCFunctions.Concat(":", MVCFunctions.GetServerPort())))))), MVCFunctions.substr((XVar)(MVCFunctions.GetScriptName()), new XVar(0), (XVar)(MVCFunctions.strrpos((XVar)(MVCFunctions.GetScriptName()), new XVar("/"))))));
        }