示例#1
0
        // Token: 0x0600002D RID: 45 RVA: 0x00004C98 File Offset: 0x00002E98
        protected override void View()
        {
            this.sysconfiginfo = SysConfigs.GetConfig();
            this.sitelist      = SiteBll.GetSiteList();
            Configuration configuration = WebConfigurationManager.OpenWebConfiguration("~");

            if (configuration.AppSettings.Settings["sitepath"] != null)
            {
                this.mainsite = configuration.AppSettings.Settings["sitepath"].Value;
            }
            CustomErrorsSection customErrorsSection = (CustomErrorsSection)configuration.GetSection("system.web/customErrors");

            if (customErrorsSection.Mode == CustomErrorsMode.Off)
            {
                this.customerror = 1;
            }
            this.adminsiteconfig = SiteConfigs.LoadConfig(FPUtils.GetMapPath(this.webpath + this.sysconfiginfo.adminpath + "/site.config"));
            if (this.ispost)
            {
                if (!this.isperm)
                {
                    this.ShowErr("对不起,您没有限权进行修改配置。");
                    return;
                }
                this.sysconfiginfo = FPRequest.GetModel <SysConfig>(this.sysconfiginfo);
                if (this.sysconfiginfo.admintitle == "")
                {
                    this.sysconfiginfo.admintitle = this.adminsiteconfig.sitetitle;
                }
                this.sysconfiginfo.passwordkey = WMSUtils.CreateAuthStr(10);
                WMSCookie.WriteCookie("password", DES.Encode(this.user.password, this.sysconfiginfo.passwordkey));
                SysConfigs.SaveConfig(this.sysconfiginfo);
                SysConfigs.ResetConfig();
                if (FPRequest.GetInt("customerror") != this.customerror)
                {
                    this.customerror = FPRequest.GetInt("customerror");
                    if (this.customerror == 1)
                    {
                        customErrorsSection.Mode = CustomErrorsMode.Off;
                    }
                    else
                    {
                        customErrorsSection.Mode = CustomErrorsMode.RemoteOnly;
                    }
                }
                if (configuration.AppSettings.Settings["sitepath"] != null)
                {
                    configuration.AppSettings.Settings["sitepath"].Value = FPRequest.GetString("mainsite");
                }
                else
                {
                    configuration.AppSettings.Settings.Add("sitepath", FPRequest.GetString("mainsite"));
                }
                configuration.Save(ConfigurationSaveMode.Modified);
                WebConfig.ReSet();
                base.AddMsg("更新配置成功!");
            }
            base.SaveRightURL();
        }
示例#2
0
 // Token: 0x060002CA RID: 714 RVA: 0x0000A578 File Offset: 0x00008778
 protected override void View()
 {
     if (this.userid == 0)
     {
         this.ShowErrMsg("对不起,您尚未登录或超时。");
     }
     else if (this.mobile == "")
     {
         this.ShowErrMsg("手机号码不能为空。");
     }
     else if (this.user.ismobile == 1 && this.user.mobile == this.mobile)
     {
         this.ShowErrMsg("您已绑定了该手机号码。");
     }
     else
     {
         if (this.type == "")
         {
             this.type = "sms_cert";
         }
         MsgTempInfo msgTemplate = MsgTempBll.GetMsgTemplate(this.type);
         if (msgTemplate.id == 0)
         {
             this.ShowErrMsg("短信模板不存在。");
         }
         else
         {
             string text = WMSUtils.CreateAuthStr(4, true);
             msgTemplate.content = msgTemplate.content.Replace("【验证码】", text);
             string text2 = SMS.Send(this.mobile, msgTemplate.content);
             if (text2 == "")
             {
                 this.Session["FP_SMSVERIFY"] = string.Concat(new object[]
                 {
                     this.mobile,
                     "|",
                     text,
                     "|",
                     DbUtils.GetDateTime()
                 });
                 Hashtable hashtable = new Hashtable();
                 hashtable["error"]   = 0;
                 hashtable["message"] = "";
                 base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
                 base.Response.Write(JsonMapper.ToJson(hashtable));
                 base.Response.End();
             }
             else
             {
                 this.ShowErrMsg(text2);
             }
         }
     }
 }
示例#3
0
 // Token: 0x06000317 RID: 791 RVA: 0x0000CF90 File Offset: 0x0000B190
 protected override void View()
 {
     if (this.ispost)
     {
         string @string = FPRequest.GetString("email");
         if (@string == "")
         {
             this.ShowErr("请输入邮箱。");
         }
         else
         {
             SqlParam sqlParam = DbHelper.MakeAndWhere("email", @string);
             UserInfo userInfo = DbHelper.ExecuteModel <UserInfo>(new SqlParam[]
             {
                 sqlParam
             });
             if (userInfo.id == 0)
             {
                 this.ShowErr("输入的邮件地址不存在。");
             }
             else
             {
                 string     text      = WMSUtils.CreateAuthStr(20);
                 SqlParam[] sqlparams = new SqlParam[]
                 {
                     DbHelper.MakeSet("authflag", 2),
                     DbHelper.MakeSet("authstr", text),
                     DbHelper.MakeSet("authtime", DbUtils.GetDateTime()),
                     DbHelper.MakeAndWhere("email", @string)
                 };
                 DbHelper.ExecuteUpdate <UserInfo>(sqlparams);
                 string newValue = string.Concat(new string[]
                 {
                     "<pre style=\"width:100%;word-wrap:break-word\"><a href=\"http://",
                     this.domain,
                     this.rawpath,
                     "getpass.aspx?authstr=",
                     text,
                     "\"  target=\"_blank\">http://",
                     this.domain,
                     this.rawpath,
                     "getpass.aspx?authstr=",
                     text,
                     "</a></pre>"
                 });
                 MsgTempInfo msgTemplate = MsgTempBll.GetMsgTemplate("email_resetpassword");
                 msgTemplate.content = msgTemplate.content.Replace("【用户名】", userInfo.username).Replace("【邮箱帐号】", @string).Replace("【激活链接】", newValue);
                 Email.Send(@string, msgTemplate.name, msgTemplate.content);
                 base.AddMsg("密码重置邮件已发送到您的邮箱");
             }
         }
     }
 }
示例#4
0
 // Token: 0x06000016 RID: 22 RVA: 0x000031C4 File Offset: 0x000013C4
 protected override void View()
 {
     if (this.ispost)
     {
         string @string = FPRequest.GetString("cache");
         foreach (string a in @string.Split(new char[]
         {
             ','
         }))
         {
             if (a == "sysconfig")
             {
                 this.sysconfig.passwordkey = WMSUtils.CreateAuthStr(10);
                 SysConfigs.SaveConfig(this.sysconfig);
                 WMSCookie.WriteCookie("password", DES.Encode(this.user.password, this.sysconfig.passwordkey));
                 SysConfigs.ResetConfig();
             }
             if (a == "syssort")
             {
                 CacheBll.RemoveSortCache();
             }
             if (a == "attachtype")
             {
                 FPCache.Remove("FP_ATTACHTYPE", "image,flash,media,file");
             }
             if (a == "siteconfig")
             {
                 List <SiteConfig> siteList = SiteBll.GetSiteList();
                 foreach (SiteConfig siteConfig in siteList)
                 {
                     FPCache.Remove("FP_SITECONFIG_" + siteConfig.sitepath);
                 }
             }
         }
         base.Response.Redirect("cachemanage.aspx");
     }
     base.SaveRightURL();
 }
示例#5
0
 // Token: 0x06000306 RID: 774 RVA: 0x0000C054 File Offset: 0x0000A254
 protected override void View()
 {
     this.regconfig = RegConfigs.GetRegConfig();
     if (this.ispost)
     {
         UserInfo userInfo = UserBll.GetUserInfo(this.userid);
         if (userInfo.isemail == 1)
         {
             this.ShowErr("您的邮箱已通过了验证。");
         }
         else
         {
             string @string = FPRequest.GetString("email");
             if (@string == "")
             {
                 this.ShowErr("您还没有设定邮箱。");
             }
             else if (!FPUtils.IsEmail(@string))
             {
                 this.ShowErr("Email格式不正确");
             }
             else if (DbHelper.ExecuteCount <UserInfo>(string.Format("[email]='{0}' AND [id]<>{1}", @string, this.userid)) > 0)
             {
                 this.ShowErr("邮箱: \"" + @string + "\" 已经被其他用户使用");
             }
             else
             {
                 string emailHostName = this.GetEmailHostName(@string);
                 if (this.regconfig.accessemail.Trim() != "")
                 {
                     if (!FPUtils.InArray(emailHostName, this.regconfig.accessemail, "|"))
                     {
                         this.ShowErr("本站点只允许使用以下域名的Email地址:" + this.regconfig.accessemail);
                         return;
                     }
                 }
                 else if (this.regconfig.censoremail.Trim() != "")
                 {
                     if (FPUtils.InArray(@string, this.regconfig.censoremail, "|"))
                     {
                         this.ShowErr("本站点不允许使用以下域名的Email地址: " + this.regconfig.censoremail);
                         return;
                     }
                 }
                 userInfo.authstr = WMSUtils.CreateAuthStr(20);
                 SqlParam[] sqlparams = new SqlParam[]
                 {
                     DbHelper.MakeSet("isemail", 0),
                     DbHelper.MakeSet("email", @string),
                     DbHelper.MakeSet("authflag", 1),
                     DbHelper.MakeSet("authstr", userInfo.authstr),
                     DbHelper.MakeSet("authtime", DbUtils.GetDateTime()),
                     DbHelper.MakeAndWhere("id", this.userid)
                 };
                 DbHelper.ExecuteUpdate <UserInfo>(sqlparams);
                 string newValue = string.Concat(new string[]
                 {
                     "<pre style=\"width:100%;word-wrap:break-word\"><a href=\"http://",
                     this.domain,
                     this.rawpath,
                     "activationuser.aspx?authstr=",
                     userInfo.authstr,
                     "\"  target=\"_blank\">http://",
                     this.domain,
                     this.rawpath,
                     "activationuser.aspx?authstr=",
                     userInfo.authstr,
                     "</a></pre>"
                 });
                 MsgTempInfo msgTemplate = MsgTempBll.GetMsgTemplate("email_register");
                 msgTemplate.content = msgTemplate.content.Replace("【用户名】", userInfo.username).Replace("【邮箱帐号】", @string).Replace("【激活链接】", newValue);
                 Email.Send(@string, msgTemplate.name, msgTemplate.content);
                 base.ResetUser();
                 base.AddMsg("您的注册邮箱[" + @string + "]将收到一封认证邮件,请登录您的邮箱查收,并点击邮件中的链接完成激活。");
             }
         }
     }
 }
示例#6
0
 // Token: 0x06000309 RID: 777 RVA: 0x0000C404 File Offset: 0x0000A604
 protected override void View()
 {
     if (this.ispost)
     {
         string   @string  = FPRequest.GetString("password");
         UserInfo userInfo = UserBll.CheckPassword(this.userid, @string);
         if (userInfo.id > 0)
         {
             string string2 = FPRequest.GetString("email");
             if (string2 == "")
             {
                 this.ShowErr("请输入新邮箱。");
             }
             else if (string2 == this.user.email)
             {
                 this.ShowErr("输入的新邮箱跟原来的一样,无需更改。");
             }
             else if (!FPUtils.IsEmail(string2))
             {
                 this.ShowErr("Email格式不正确");
             }
             else if (DbHelper.ExecuteCount <UserInfo>("[email]='" + string2 + "'") > 0)
             {
                 this.ShowErr("邮箱: \"" + string2 + "\" 已经被其他用户使用。");
             }
             else
             {
                 userInfo.authstr = WMSUtils.CreateAuthStr(20);
                 userInfo.email   = string2;
                 SqlParam[] sqlparams = new SqlParam[]
                 {
                     DbHelper.MakeSet("isemail", 0),
                     DbHelper.MakeSet("email", userInfo.email),
                     DbHelper.MakeSet("authflag", 1),
                     DbHelper.MakeSet("authstr", userInfo.authstr),
                     DbHelper.MakeSet("authtime", DbUtils.GetDateTime()),
                     DbHelper.MakeAndWhere("id", this.userid)
                 };
                 DbHelper.ExecuteUpdate <UserInfo>(sqlparams);
                 string newValue = string.Concat(new string[]
                 {
                     "<pre style=\"width:100%;word-wrap:break-word\"><a href=\"http://",
                     this.domain,
                     this.rawpath,
                     "activationuser.aspx?authstr=",
                     userInfo.authstr,
                     "\"  target=\"_blank\">http://",
                     this.domain,
                     this.rawpath,
                     "activationuser.aspx?authstr=",
                     userInfo.authstr,
                     "</a></pre>"
                 });
                 MsgTempInfo msgTemplate = MsgTempBll.GetMsgTemplate("email_register");
                 msgTemplate.content = msgTemplate.content.Replace("【用户名】", userInfo.username).Replace("【邮箱帐号】", userInfo.email).Replace("【激活链接】", newValue);
                 Email.Send(userInfo.email, msgTemplate.name, msgTemplate.content);
                 base.ResetUser();
                 base.AddMsg("您的注册邮箱[" + userInfo.email + "]将收到一封认证邮件,请登录您的邮箱查收,并点击邮件中的链接完成激活。");
             }
         }
         else
         {
             this.ShowErr("对不起,用户密码不正确。");
         }
     }
 }
示例#7
0
 // Token: 0x060000A2 RID: 162 RVA: 0x0000D74C File Offset: 0x0000B94C
 protected override void View()
 {
     this.smsconfig = SMSConfigs.GetSMSConfig();
     if (this.ispost)
     {
         if (this.action == "save")
         {
             this.smsconfig = FPRequest.GetModel <SMSConfig>(this.smsconfig);
             SMSConfigs.SaveConfig(this.smsconfig);
             SMS.ReSetConfig();
             base.AddMsg("保存配置成功!");
         }
         else if (this.action == "send")
         {
             this.phone = FPRequest.GetString("phone");
             if (this.phone == "")
             {
                 this.ShowErr("请输入接收测试短信的手机号码!");
                 return;
             }
             string content = string.Format("您的验证码是:{0}。请不要把验证码泄露给其他人。如非本人操作,可不用理会!", WMSUtils.CreateAuthStr(4, true));
             string text    = SMS.Send(this.phone, content);
             if (!(text == ""))
             {
                 this.ShowErr(text);
                 return;
             }
             base.AddMsg("发布测试短信成功,请检查手机是否收到。");
         }
     }
     base.SaveRightURL();
 }
示例#8
0
 // Token: 0x0600031F RID: 799 RVA: 0x0000D54C File Offset: 0x0000B74C
 protected override void View()
 {
     if (this.reurl == "")
     {
         this.reurl = "login.aspx";
     }
     this.regconfig = RegConfigs.GetRegConfig();
     if (this.ispost)
     {
         if (this.userid > 0)
         {
             this.ShowErr("对不起,系统不允许重复注册用户。");
         }
         else if (this.regconfig.regstatus != 1)
         {
             this.ShowErr("对不起,系统目前暂不允许新用户注册。");
         }
         else
         {
             if (this.regconfig.regctrl > 0)
             {
                 SqlParam sqlParam = DbHelper.MakeAndWhere("regip", FPRequest.GetIP());
                 UserInfo userInfo = DbHelper.ExecuteModel <UserInfo>(new SqlParam[]
                 {
                     sqlParam
                 });
                 if (userInfo.id > 0)
                 {
                     int num = this.StrDateDiffHours(userInfo.joindatetime, this.regconfig.regctrl);
                     if (num < 0)
                     {
                         this.ShowErr("抱歉,系统设置了IP注册间隔限制,您必须在 " + (num * -1).ToString() + " 小时后才可以重新注册");
                         return;
                     }
                 }
             }
             if (this.regconfig.ipregctrl.Trim() != "")
             {
                 string[] iparray = FPUtils.SplitString(this.regconfig.ipregctrl, "|");
                 if (FPUtils.InIPArray(FPRequest.GetIP(), iparray))
                 {
                     this.ShowErr("抱歉,系统设置了IP注册限制,您所在的IP段不允许注册。");
                     return;
                 }
             }
             string @string = FPRequest.GetString("username");
             string string2 = FPRequest.GetString("password");
             string text    = FPRequest.GetString("email").Trim().ToLower();
             string string3 = FPRequest.GetString("realname");
             string string4 = FPRequest.GetString("idcard");
             string text2   = FPRequest.GetString("mobile").Trim();
             if (@string.Equals(""))
             {
                 this.ShowErr("用户名不能为空。");
             }
             else if (@string.Length < 3)
             {
                 this.ShowErr("对不起,用户名不能小于3个字符");
             }
             else if (@string.Length > 20)
             {
                 this.ShowErr("对不起,用户名不能大于20个字符");
             }
             else if (!FPUtils.IsSafeSqlString(@string))
             {
                 this.ShowErr("对不起,您使用的用户名有敏感字符");
             }
             else if (this.InRestrictArray(@string, this.regconfig.restrict))
             {
                 this.ShowErr("对不起,该用户名:" + @string + " 不允许使用");
             }
             else if (UserBll.CheckUserName(@string))
             {
                 this.ShowErr("该用户名已经存在,请使用别的用户名。");
             }
             else if (string2.Equals(""))
             {
                 this.ShowErr("密码不能为空");
             }
             else if (string2 != FPRequest.GetString("repeat"))
             {
                 this.ShowErr("对不起,两次输入密码不相同");
             }
             else if (this.regconfig.email == 1 && text == "")
             {
                 this.ShowErr("Email不能为空");
             }
             else if (text.Trim() != "" && !FPUtils.IsEmail(text))
             {
                 this.ShowErr("Email格式不正确");
             }
             else
             {
                 if (text.Trim() != "")
                 {
                     if (DbHelper.ExecuteCount <UserInfo>("[email]='" + text + "'") > 0)
                     {
                         this.ShowErr("邮箱: \"" + text + "\" 已经被其他用户使用");
                         return;
                     }
                 }
                 string emailHostName = this.GetEmailHostName(text);
                 if (text.Trim() != "" && this.regconfig.accessemail.Trim() != "")
                 {
                     if (!FPUtils.InArray(emailHostName, this.regconfig.accessemail, "|"))
                     {
                         this.ShowErr("本站点只允许使用以下域名的Email地址注册:" + this.regconfig.accessemail);
                         return;
                     }
                 }
                 else if (text.Trim() != "" && this.regconfig.censoremail.Trim() != "")
                 {
                     if (FPUtils.InArray(text, this.regconfig.censoremail, "|"))
                     {
                         this.ShowErr("本站点不允许使用以下域名的Email地址注册: " + this.regconfig.censoremail);
                         return;
                     }
                 }
                 if (this.regconfig.realname == 1)
                 {
                     if (string3.Equals(""))
                     {
                         this.ShowErr("真实姓名不能为空");
                         return;
                     }
                 }
                 if (this.InRestrictArray(string3, this.regconfig.restrict))
                 {
                     this.ShowErr("对不起,该姓名:[" + string3 + "]不允许使用");
                 }
                 else
                 {
                     if (this.regconfig.mobile == 1)
                     {
                         if (text2.Equals(""))
                         {
                             this.ShowErr("手机号码不能为空");
                             return;
                         }
                     }
                     if (text2.Trim().Length > 20)
                     {
                         this.ShowErr("手机号码不能大于20个字符");
                     }
                     else if (text2.Trim() != "" && !Regex.IsMatch(text2.Trim(), "^[\\d|-]+$"))
                     {
                         this.ShowErr("手机号码中含有非法字符");
                     }
                     else
                     {
                         if (this.regconfig.rules == 1)
                         {
                             if (FPRequest.GetInt("rules", 0) != 1)
                             {
                                 this.ShowErr("对不起,您没有选择同意网站许可协议");
                                 return;
                             }
                         }
                         if (this.isseccode)
                         {
                             if (FPRequest.GetString("verify").Equals(""))
                             {
                                 this.ShowErr("验证码不能为空");
                                 return;
                             }
                             if (!this.isvalid)
                             {
                                 this.ShowErr("验证码错误");
                                 return;
                             }
                         }
                         this.iuser              = FPRequest.GetModel <UserInfo>();
                         this.iuser.password     = FPUtils.MD5(this.iuser.password);
                         this.iuser.credits      = this.regconfig.credit;
                         this.iuser.regip        = FPRequest.GetIP();
                         this.iuser.joindatetime = DbUtils.GetDateTime();
                         if (this.regconfig.regverify == 1)
                         {
                             this.iuser.authstr  = "";
                             this.iuser.authflag = 1;
                             this.iuser.roleid   = 3;
                         }
                         else if (this.regconfig.regverify == 2)
                         {
                             this.iuser.authstr  = WMSUtils.CreateAuthStr(20);
                             this.iuser.authflag = 1;
                             this.iuser.roleid   = 3;
                             string newValue = string.Concat(new string[]
                             {
                                 "<pre style=\"width:100%;word-wrap:break-word\"><a href=\"http://",
                                 this.domain,
                                 this.rawpath,
                                 "activationuser.aspx?authstr=",
                                 this.iuser.authstr,
                                 "\"  target=\"_blank\">http://",
                                 this.domain,
                                 this.rawpath,
                                 "activationuser.aspx?authstr=",
                                 this.iuser.authstr,
                                 "</a></pre>"
                             });
                             MsgTempInfo msgTemplate = MsgTempBll.GetMsgTemplate("email_register");
                             msgTemplate.content = msgTemplate.content.Replace("【用户名】", this.iuser.username).Replace("【邮箱帐号】", this.iuser.email).Replace("【激活链接】", newValue);
                             Email.Send(text, msgTemplate.name, msgTemplate.content);
                         }
                         else
                         {
                             this.iuser.authstr  = "";
                             this.iuser.authflag = 0;
                             this.iuser.roleid   = 5;
                         }
                         this.iuser.id = DbHelper.ExecuteInsert <UserInfo>(this.iuser);
                         if (this.iuser.id > 0)
                         {
                             if (this.regconfig.credit > 0 && this.iuser.credits > 0)
                             {
                                 UserBll.Credit_AddLog(this.iuser.id, "用户注册", 0, this.iuser.credits);
                             }
                             if (this.regconfig.regverify == 1)
                             {
                                 base.AddMsg("注册成功, 但需要等待管理员审核后您的帐户才能生效。");
                             }
                             else if (this.regconfig.regverify == 2)
                             {
                                 base.AddMsg("您的注册邮箱[" + this.iuser.email + "]将收到一封认证邮件,请登录您的邮箱查收,并点击邮件中的链接完成激活。激活成功后,可以使用站内所有功能,再次感谢您的加入。");
                             }
                             else
                             {
                                 base.AddMsg("注册成功, 请点击下面链接返回登录。");
                             }
                         }
                         else
                         {
                             this.ShowErr("注册失败,请检查输入是否正确。");
                         }
                     }
                 }
             }
         }
     }
 }