Пример #1
0
        // Token: 0x060002ED RID: 749 RVA: 0x0000B648 File Offset: 0x00009848
        public static UserInfo GetOnlineUser(string passwordkey, int timeout, int uid)
        {
            UserInfo userInfo = new UserInfo();
            int      num      = FPUtils.StrToInt(WMSCookie.GetCookie("userid"), uid);
            string   text     = DES.Decode(WMSCookie.GetCookie("password"), passwordkey).Trim();

            if (text.Length == 0)
            {
                num = 0;
            }
            if (num > 0)
            {
                DateTime lastCookieTime = WMSCookie.GetLastCookieTime();
                DateTime t = DateTime.Now.AddMinutes((double)(timeout * -1));
                if (lastCookieTime >= t)
                {
                    UserInfo userInfo2 = UserBll.CheckPassword(num, text, false);
                    if (userInfo2.id > 0)
                    {
                        return(userInfo2);
                    }
                }
                WMSCookie.ClearUserCookie();
            }
            return(UserBll.CreateGuestUser());
        }
Пример #2
0
 // Token: 0x06000010 RID: 16 RVA: 0x00002374 File Offset: 0x00000574
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (this.sysconfig.adminpath != "")
     {
         this.adminpath = this.webpath + this.sysconfig.adminpath + "/";
     }
     if (this.Session["FP_OLUSERINFO"] != null)
     {
         if (!this.IsTimeOut())
         {
             this.user     = (this.Session["FP_OLUSERINFO"] as UserInfo);
             this.role     = (this.Session["FP_ROLEINFO"] as RoleInfo);
             this.permlist = (this.Session["FP_PERMISSION"] as List <Permission>);
         }
         else
         {
             this.user = UserBll.CreateGuestUser();
             this.Session["FP_OLUSERINFO"] = this.user;
             this.role = RoleBll.GetRoleInfo(this.user.roleid);
             this.Session["FP_ROLEINFO"] = this.role;
             this.permlist = new PermissionBll().GetPermissionList(this.role.permission);
             this.Session["FP_PERMISSION"] = this.permlist;
         }
     }
     else
     {
         this.user = UserBll.GetOnlineUser(this.sysconfig.passwordkey, this.sysconfig.onlinetimeout);
         this.Session["FP_OLUSERINFO"] = this.user;
         this.role = RoleBll.GetRoleInfo(this.user.roleid);
         this.Session["FP_ROLEINFO"] = this.role;
         this.permlist = new PermissionBll().GetPermissionList(this.role.permission);
         this.Session["FP_PERMISSION"] = this.permlist;
     }
     this.userid   = this.user.id;
     this.roleid   = this.user.roleid;
     this.departid = this.user.departid;
     this.username = this.user.username;
     if (this.role.desktopurl == "")
     {
         this.role.desktopurl = "main.aspx";
     }
     UserBll.UpdateOnlineState(this.userid, this.sysconfig.onlinetimeout, this.sysconfig.onlinefrequency);
     this.iscuserr   = FPUtils.InArray(this.cururl, this.sysconfig.customerrors);
     this.permission = this.GetPermission(this.cururl);
     if (this.roleid == 1 || this.permission.id > 0)
     {
         this.isperm = true;
     }
     if (this.roleid == 1 || this.role.isadmin == 1)
     {
         this.isadmin = true;
     }
     if (this.roleid != 1 && this.siteconfig.closed == 1 && this.pagename != "login.aspx" && this.pagename != "logout.aspx")
     {
         MessageBox.Show(this.siteconfig.closedreason);
     }
     if (this.roleid != 1 && this.siteconfig.ipaccess.Trim() != "" && this.pagename != "login.aspx" && this.pagename != "logout.aspx" && this.ip != "127.0.0.1")
     {
         string[] iparray = FPUtils.SplitString(this.siteconfig.ipaccess, "\n");
         if (!FPUtils.InIPArray(this.ip, iparray))
         {
             MessageBox.Show("抱歉,系统设置了IP访问限制,您所在的IP地址无权访问本站点。");
         }
     }
     if (this.roleid != 1 && this.siteconfig.ipdenyaccess.Trim() != "" && this.pagename != "login.aspx" && this.pagename != "logout.aspx" && this.ip != "127.0.0.1")
     {
         string[] iparray = FPUtils.SplitString(this.siteconfig.ipdenyaccess, "\n");
         if (FPUtils.InIPArray(this.ip, iparray))
         {
             MessageBox.Show("对不起,您所在的IP地址已被禁止访问本站点。");
         }
     }
     if (this.roleid != 1 && this.siteconfig.roles.Trim() != "" && this.pagename != "login.aspx" && this.pagename != "logout.aspx")
     {
         if (!FPUtils.InArray(this.roleid, this.siteconfig.roles))
         {
             MessageBox.Show("对不起,您没有权限访问该站点。");
         }
     }
     this.isseccode = FPUtils.InArray(this.cururl, this.sysconfig.verifypage.Replace("|", ","));
     if (this.isseccode)
     {
         this.isvalid = (string.Compare(this.Session["FP_VERIFY"].ToString().ToLower(), FPRequest.GetString("verify").ToLower(), true) != 0);
     }
     this.isvip = (this.user.vipdays > 0);
 }