// Token: 0x0600003C RID: 60 RVA: 0x00003DA0 File Offset: 0x00001FA0 public static void WriteCookie(string strName, string strValue) { HttpCookie httpCookie = HttpContext.Current.Request.Cookies["wms"]; if (httpCookie == null) { httpCookie = new HttpCookie("wms"); httpCookie.Values[strName] = FPUtils.UrlEncode(strValue); } else { httpCookie.Values[strName] = FPUtils.UrlEncode(strValue); if (HttpContext.Current.Request.Cookies["wms"]["expires"] != null) { int num = FPUtils.StrToInt(HttpContext.Current.Request.Cookies["wms"]["expires"].ToString(), 0); if (num > 0) { httpCookie.Expires = DateTime.Now.AddMinutes((double)FPUtils.StrToInt(HttpContext.Current.Request.Cookies["wms"]["expires"].ToString(), 0)); } } } string text = SysConfigs.GetConfig().cookiedomain.Trim(); if (text != string.Empty && HttpContext.Current.Request.Url.Host.IndexOf(text.TrimStart(new char[] { '.' })) > -1 && WMSUtils.IsValidDomain(HttpContext.Current.Request.Url.Host)) { httpCookie.Domain = text; } HttpContext.Current.Response.AppendCookie(httpCookie); }
// Token: 0x06000284 RID: 644 RVA: 0x000096C0 File Offset: 0x000078C0 public static SysConfig GetConfig() { if (SysConfigs.m_configinfo == null) { SysConfigs.ResetConfig(); } return(SysConfigs.m_configinfo); }
// Token: 0x06000041 RID: 65 RVA: 0x00004160 File Offset: 0x00002360 public static void ClearUserCookie(string cookieName) { HttpCookie httpCookie = new HttpCookie(cookieName); httpCookie.Values.Clear(); httpCookie.Expires = DateTime.Now.AddYears(-1); string text = SysConfigs.GetConfig().cookiedomain.Trim(); if (text != string.Empty && HttpContext.Current.Request.Url.Host.IndexOf(text.TrimStart(new char[] { '.' })) > -1 && WMSUtils.IsValidDomain(HttpContext.Current.Request.Url.Host)) { httpCookie.Domain = text; } HttpContext.Current.Response.AppendCookie(httpCookie); }
// Token: 0x0600002B RID: 43 RVA: 0x000032B0 File Offset: 0x000014B0 private void ReUrl_BeginRequest(object sender, EventArgs e) { this.webpath = WebConfig.WebPath; this.sysconfig = SysConfigs.GetConfig(); HttpContext context = ((HttpApplication)sender).Context; string text = context.Request.Path.ToLower(); if (text.StartsWith(this.webpath)) { if (Path.GetExtension(text).ToLower() == ".aspx") { text = (text.StartsWith("/") ? text : ("/" + text)); string text2 = text.Substring(this.webpath.Length); if (text.Substring(this.webpath.Length).IndexOf("/") == -1) { text2 = ((WebConfig.SitePath == "") ? "" : (WebConfig.SitePath + "/")) + text2; } else if (!Directory.Exists(FPUtils.GetMapPath(this.webpath + text2.Substring(0, text2.IndexOf("/"))))) { text2 = ((WebConfig.SitePath == "") ? "" : (WebConfig.SitePath + "/")) + text2; } if (text2.StartsWith("sites/")) { text2 = text2.Substring(6, text2.Length - 6); } string viewpath = "sites/" + text2; if (this.sysconfig.browsecreatesite == 1) { string sitepath = ""; if (text2.IndexOf("/") >= 0) { sitepath = text2.Substring(0, text2.IndexOf("/")); } SiteConfig siteInfo = SiteConfigs.GetSiteInfo(sitepath); if (siteInfo.autocreate == 1) { this.includedata = FPViews.GetViewInclude(); this.CreateTemplate(siteInfo, viewpath, text2); context.Response.ClearContent(); } } context.RewritePath(this.webpath + text2, string.Empty, context.Request.QueryString.ToString()); } } }
// Token: 0x06000283 RID: 643 RVA: 0x00009610 File Offset: 0x00007810 public static void ResetConfig() { SysConfigs.filename = FPUtils.GetMapPath(WebConfig.WebPath + "config/sys.config"); if (!File.Exists(SysConfigs.filename)) { if (!Directory.Exists(Path.GetDirectoryName(SysConfigs.filename))) { Directory.CreateDirectory(Path.GetDirectoryName(SysConfigs.filename)); } SysConfigs.m_configinfo = new SysConfig(); if (SysConfigs.m_configinfo.passwordkey == "") { SysConfigs.m_configinfo.passwordkey = WMSUtils.CreateAuthStr(10); } SysConfigs.SaveConfig(SysConfigs.m_configinfo); } SysConfigs.m_configinfo = FPSerializer.Load <SysConfig>(SysConfigs.filename); }
// Token: 0x06000289 RID: 649 RVA: 0x00009750 File Offset: 0x00007950 public static int InsertLog(int uid, string name, string title, string description, bool status) { int result = 0; SysConfig config = SysConfigs.GetConfig(); if (config.allowlog == 1) { result = DbHelper.ExecuteInsert <SysLogInfo>(new SysLogInfo { uid = uid, name = name, title = title, description = description, ip = FPRequest.GetIP(), postdatetime = DbUtils.GetDateTime(), status = (status ? 1 : 0) }); } return(result); }
// Token: 0x0600003D RID: 61 RVA: 0x00003F4C File Offset: 0x0000214C public static void WriteUserCookie(UserInfo userinfo, int expires, string passwordkey) { if (userinfo != null && userinfo.id > 0) { HttpCookie httpCookie = new HttpCookie("wms"); httpCookie.Values["userid"] = userinfo.id.ToString(); httpCookie.Values["password"] = FPUtils.UrlEncode(DES.Encode(userinfo.password, passwordkey)); httpCookie.Values["expires"] = expires.ToString(); if (expires > 0) { httpCookie.Expires = DateTime.Now.AddMinutes((double)expires); } string text = SysConfigs.GetConfig().cookiedomain.Trim(); if (text != string.Empty && HttpContext.Current.Request.Url.Host.IndexOf(text.TrimStart(new char[] { '.' })) > -1 && WMSUtils.IsValidDomain(HttpContext.Current.Request.Url.Host)) { httpCookie.Domain = text; } HttpContext.Current.Response.AppendCookie(httpCookie); } }
// Token: 0x06000282 RID: 642 RVA: 0x00009600 File Offset: 0x00007800 static SysConfigs() { SysConfigs.ResetConfig(); }
// Token: 0x06000037 RID: 55 RVA: 0x00003C7C File Offset: 0x00001E7C private bool IsWaterMark(string _fileExt) { return(SysConfigs.GetConfig().allowwatermark > 0 && FPUtils.InArray(_fileExt.ToLower(), "bmp,jpg,png")); }