示例#1
0
 // Token: 0x06000028 RID: 40 RVA: 0x000045F0 File Offset: 0x000027F0
 protected override void View()
 {
     if (this.ispost)
     {
         string @string = FPRequest.GetString("pluname");
         if (this.action == "delete")
         {
             if (@string != "" && Directory.Exists(FPUtils.GetMapPath(this.webpath + "plugins/" + @string)))
             {
                 Directory.Delete(FPUtils.GetMapPath(this.webpath + "plugins/" + @string), true);
             }
         }
         else if (this.action == "download")
         {
             using (FPZip fpzip = new FPZip())
             {
                 DirectoryInfo directoryInfo = new DirectoryInfo(FPUtils.GetMapPath(this.webpath + "plugins/" + @string));
                 foreach (DirectoryInfo directoryInfo2 in directoryInfo.GetDirectories())
                 {
                     fpzip.AddDirectory(directoryInfo2.FullName);
                 }
                 foreach (FileInfo fileInfo in directoryInfo.GetFiles())
                 {
                     fpzip.AddFile(fileInfo.FullName, "");
                 }
                 fpzip.ZipDown(FPUtils.UrlEncode(@string + ".plu"));
             }
         }
     }
     this.pluginlist = PluginBll.GetPluginList();
     base.SaveRightURL();
 }
示例#2
0
 // Token: 0x0600006B RID: 107 RVA: 0x00009964 File Offset: 0x00007B64
 protected override void View()
 {
     if (this.ispost)
     {
         if (this.action == "delete")
         {
             string @string = FPRequest.GetString("chkdel");
             foreach (string text in @string.Split(new char[]
             {
                 ','
             }))
             {
                 if (text != "" && Directory.Exists(FPUtils.GetMapPath(this.webpath + "sites/" + text)))
                 {
                     Directory.Delete(FPUtils.GetMapPath(this.webpath + "sites/" + text), true);
                 }
             }
         }
         else if (this.action == "create")
         {
             string string2 = FPRequest.GetString("sitepath");
             string message = "";
             if (!SiteBll.CreateSite(string2, out message))
             {
                 this.ShowErr(message);
                 return;
             }
             base.AddMsg("站点编译成功!");
         }
         else if (this.action == "download")
         {
             string     string3  = FPRequest.GetString("sitepath");
             SiteConfig siteInfo = SiteConfigs.GetSiteInfo(string3);
             string     str      = ((siteInfo.name != "") ? siteInfo.name : siteInfo.sitepath) + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".fpsite";
             using (FPZip fpzip = new FPZip())
             {
                 DirectoryInfo directoryInfo = new DirectoryInfo(FPUtils.GetMapPath(this.webpath + "sites/" + string3));
                 foreach (DirectoryInfo directoryInfo2 in directoryInfo.GetDirectories())
                 {
                     fpzip.AddDirectory(directoryInfo2.FullName);
                 }
                 foreach (FileInfo fileInfo in directoryInfo.GetFiles())
                 {
                     fpzip.AddFile(fileInfo.FullName, "");
                 }
                 fpzip.ZipDown(FPUtils.UrlEncode(str));
             }
         }
     }
     this.sitelist = SiteBll.GetSiteList();
     base.SaveRightURL();
 }
示例#3
0
 // Token: 0x0600000D RID: 13 RVA: 0x000029C8 File Offset: 0x00000BC8
 protected override void View()
 {
     this.appinfo = DbHelper.ExecuteModel <AppInfo>(this.id);
     if (this.appinfo.id == 0)
     {
         this.ShowErr("对不起,该应用已被删除或不存在。");
     }
     else
     {
         string mapPath = FPUtils.GetMapPath(this.webpath + this.appinfo.installpath);
         if (this.ispost)
         {
             string @string = FPRequest.GetString("setpath");
             if (@string == "")
             {
                 this.ShowErr("对不起,应用默认安装目录名称不能为空。");
             }
             else
             {
                 string pattern = "^[a-zA-Z0-9_\\w]+$";
                 if (this.err == 0 && !Regex.IsMatch(@string.Trim(), pattern, RegexOptions.IgnoreCase))
                 {
                     base.AddErr("默认安装目录名称只能由数字、字母或下划线组成。");
                 }
                 this.appinfo.setpath = @string;
                 DbHelper.ExecuteUpdate <AppInfo>(this.appinfo);
                 FPSerializer.Save <AppInfo>(this.appinfo, FPUtils.GetMapPath(this.webpath + this.appinfo.installpath + "/app.config"));
                 string str = this.appinfo.name + ".fpk";
                 if (this.appinfo.files != "")
                 {
                     using (FPZip fpzip = new FPZip())
                     {
                         foreach (string text in FPUtils.SplitString(this.appinfo.files))
                         {
                             if (text.StartsWith("bin/"))
                             {
                                 fpzip.AddFile(FPUtils.GetMapPath(WebConfig.WebPath + text), text);
                             }
                             else
                             {
                                 fpzip.AddFile(mapPath + "/" + text, text);
                             }
                         }
                         fpzip.ZipDown(FPUtils.UrlEncode(str));
                     }
                 }
                 else
                 {
                     using (FPZip fpzip = new FPZip())
                     {
                         DirectoryInfo directoryInfo = new DirectoryInfo(mapPath);
                         foreach (DirectoryInfo directoryInfo2 in directoryInfo.GetDirectories())
                         {
                             fpzip.AddDirectory(directoryInfo2.FullName);
                         }
                         foreach (FileInfo fileInfo in directoryInfo.GetFiles())
                         {
                             if (fileInfo.Name != "site.config")
                             {
                                 fpzip.AddFile(fileInfo.FullName, "");
                             }
                         }
                         string mapPath2 = FPUtils.GetMapPath(this.webpath + "sites/" + this.appinfo.installpath + "/site.config");
                         if (File.Exists(mapPath2))
                         {
                             SiteConfig siteConfig = SiteConfigs.LoadConfig(mapPath2);
                             if (siteConfig.inherits != "")
                             {
                                 if (siteConfig.inherits.EndsWith(".Controller"))
                                 {
                                     fpzip.AddFile(FPUtils.GetMapPath(this.webpath + "bin/" + siteConfig.inherits.Replace(".Controller", "") + ".dll"), "bin/" + siteConfig.inherits.Replace(".Controller", "") + ".dll");
                                 }
                                 else
                                 {
                                     fpzip.AddFile(FPUtils.GetMapPath(this.webpath + "bin/" + siteConfig.inherits + ".dll"), "bin/" + siteConfig.inherits + ".dll");
                                 }
                             }
                             if (siteConfig.import != "")
                             {
                                 foreach (string text in siteConfig.import.Split(new string[]
                                 {
                                     "\r\n",
                                     ";",
                                     ",",
                                     "|"
                                 }, StringSplitOptions.RemoveEmptyEntries))
                                 {
                                     fpzip.AddFile(FPUtils.GetMapPath(this.webpath + "bin/" + text + ".dll"), "bin/" + text + ".dll");
                                 }
                             }
                         }
                         fpzip.ZipDown(FPUtils.UrlEncode(str));
                     }
                 }
             }
         }
     }
 }