public ifr() { HttpContext.Current.Response.ContentType = "text/html"; // if (ForumUtils.IsCrossSitePost(DNTRequest.GetUrlReferrer(), DNTRequest.GetHost())) // return; // if (userid < 1) // return; string url = DNTRequest.GetQueryString("url"); int mid = DNTRequest.GetQueryInt("mid", 0); int uid = DNTRequest.GetQueryInt("uid", 0); ModuleInfo moduleinfo = Spaces.GetModuleById(mid, uid); if (moduleinfo == null) { return; } if (url != moduleinfo.ModuleUrl) { return; } UserPrefsSaved ups = new UserPrefsSaved(moduleinfo.UserPref); string path = BaseConfigs.GetForumPath + "space/modules/" + url; string modulefilepath = Utils.GetMapPath(path); ModulePref mp = ModuleXmlHelper.LoadModulePref(modulefilepath); ModuleContent mc = ModuleXmlHelper.LoadContent(modulefilepath); #if NET1 UserPrefCollection upc = ModuleXmlHelper.LoadUserPrefs(modulefilepath); #else UserPrefCollection <UserPref> upc = ModuleXmlHelper.LoadUserPrefs(modulefilepath); #endif StringBuilder registScript = new StringBuilder("<script type=\"text/javascript\">"); foreach (UserPref up in upc) { string userprefvalue = ups.GetValueByName(up.Name); userprefvalue = userprefvalue == string.Empty ? up.DefaultValue : userprefvalue; registScript.AppendFormat(PREF_SCRIPT_FORMAT, mid, up.Name, userprefvalue); } registScript.Append(ModuleXmlHelper.GetModuleRequireScript(mp, mc.Type == ModuleContentType.HtmlInline)); registScript.Append("</script>"); string html = string.Format(IFRAME_HTML, registScript.ToString(), mc.ContentHtml, BaseConfigs.GetForumPath); html = html.Replace("__MODULE_ID__", mid.ToString()).Replace("_IG_", "_DS_"); HttpContext.Current.Response.Write(html); HttpContext.Current.Response.End(); }
private void DelModuleAction() { int moduleid = DNTRequest.GetQueryInt("m", 0); if (moduleid == 0) { return; } int tabid = DNTRequest.GetQueryInt("m_" + moduleid + "_t", 0); ModuleInfo moduleinfo = Spaces.GetModuleById(moduleid, this.userid); if (moduleinfo.TabID != tabid || moduleinfo.Uid != this.userid) { return; } ISpaceCommand isc = Spaces.SetModuleBase(moduleinfo); isc.RemoveModule(); }
private void DefaultAction() { // string url = HttpContext.Current.Request.QueryString["url"].ToString(); // string et = HttpContext.Current.Request.QueryString["et"].ToString(); // string source = HttpContext.Current.Request.QueryString["source"].ToString(); // string pid = HttpContext.Current.Request.QueryString["pid"].ToString(); // string ap = HttpContext.Current.Request.QueryString["ap"].ToString(); // string prefid = HttpContext.Current.Request.QueryString["prefid"].ToString(); int mid = DNTRequest.GetQueryInt("mid", 0); /* * int tabid = DNTRequest.GetQueryInt("m_" + mid + "_t", 0); * TabInfo tab = Spaces.GetTabById(tabid); * if (tab == null || tab.UserID != userid) * { * //非本人模块不可修改 * return; * } */ // string host = HttpContext.Current.Request.QueryString["host"].ToString(); // string h1 = HttpContext.Current.Request.QueryString["h1"].ToString(); // string upPrefix = "m_" + mid + "_up_"; // // Hashtable ht = new Hashtable(); // NameValueCollection nvc = Request.QueryString; // foreach (string s in nvc.Keys) // { // if (s.StartsWith(upPrefix)) // { // ht.Add(s.Replace(upPrefix, string.Empty), nvc[s]); // } // } ModuleInfo module = Spaces.GetModuleById(mid, this.userid); /* if (module == null || module.TabID != tabid) * { * return; * } */ if (module == null || module.Uid != this.userid) { return; } // ModuleBase desktopModule = new ModuleBase(); // //create instance accord to the moduledef // if (module.ModuleDefID > 0) // { // ModuleDefInfo md = Spaces.GetModuleDefByID(module.ModuleDefID); // desktopModule = (ModuleBase)GetInstance(md.BussinessController); // desktopModule.ModuleDef = md; // // // // // //get module xml and isremote //// if (module.ModuleUrl.StartsWith("http://")) //// { //// desktopModule.IsRemote = true; //// } // // //can not support remote module yet. // // // } // desktopModule.Module = module; //SpaceConfigInfo config = Spaces.GetSpaceConfigByUserId(this.userid); ModuleBase desktopModule = Spaces.SetModuleBase(module); desktopModule.UserID = this.userid; //desktopModule.SpaceConfig = config; ISpaceCommand command = desktopModule; command.GetModulePost(HttpContext.Current); }