示例#1
0
        private void LoadBaseData()
        {
            XmlNode userNode = Content.GetSubControl("basedata")["currentuser"];

            CommonXml.GetNode(userNode, "username").InnerText = CurrentUser;
            XmlNode groupNode = CommonXml.GetNode(userNode, "groups");

            object[]      resultsGroups = Plugins.InvokeAll("users", "list_groups", CurrentUser);
            List <string> userGroups    = new List <string>(Common.Common.FlattenToStrings(resultsGroups));

            foreach (string group in userGroups)
            {
                CommonXml.GetNode(groupNode, "group", EmptyNodeHandling.ForceCreateNew).InnerText = group;
            }

            ControlList baseData = Content.GetSubControl("basedata");

            baseData["pageviewcount"].InnerText = PageViewCount().ToString(CultureInfo.InvariantCulture);
            baseData["defaultpage"].InnerText   = Settings["sitetree/stdpage"];

            foreach (string pageInHistory in History())
            {
                XmlDocument ownerDocument = baseData["history"].OwnerDocument;
                if (ownerDocument != null)
                {
                    XmlNode historyNode = ownerDocument.CreateElement("item");
                    historyNode.InnerText = pageInHistory;
                    baseData["history"].AppendChild(historyNode);
                }
            }
        }
示例#2
0
        public Process Run(System.Web.UI.Page httpPage)
        {
            Plugins = new PluginServices();
            Process process = new Process(httpPage, Plugins);

            Plugins.InvokeAll("system", "init");
            //? lay tu cache ra - neu k co cache thi lay o dau ra?
            XmlDocument xmlDocument = process.Cache["process"] as XmlDocument;
            XmlNode     xmlNode     = xmlDocument.DocumentElement;

            string[] args = process.CurrentProcess.Trim('/').Split('/');

            LoopThroughProcess(args, xmlNode, process);

            Plugins.InvokeAll("system", "exit");
            Plugins.ClosePlugins();

            return(process);
        }
示例#3
0
        public Process Run(Page httpPage)
        {
            _plugins = new PluginServices();
            Process process = new Process(httpPage, _plugins);

            _plugins.InvokeAll("system", "init");

            XmlDocument xmlDocument = process.Cache["process"] as XmlDocument;

            if (xmlDocument != null)
            {
                XmlNode  xmlNode = xmlDocument.DocumentElement;
                string[] args    = process.CurrentProcess.Trim('/').Split('/');

                LoopThroughProcess(args, xmlNode, process);
            }

            _plugins.InvokeAll("system", "exit");
            _plugins.ClosePlugins();

            return(process);
        }
示例#4
0
        public bool Login(string username, string password)
        {
            object[] results = Plugins.InvokeAll("users", "verify", username, password);
            if (results.Length > 0)
            {
                bool verified = false;
                foreach (object result in results)
                {
                    if ((bool)result)
                    {
                        verified = true;
                    }
                }

                if (verified)
                {
                    this.HttpPage.Session["current_username"] = username;
                    this.Content.GetSubControl("basedata")["currentuser"].InnerText = username;
                    return(true);
                }
            }
            return(false);
        }