Exemplo n.º 1
0
        /// <summary>
        /// 处理认证成功事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void app_Auth(object sender, EventArgs e)
        {
            //CheckDisableIp();
            //进行在线更新检测
            if (checkUpdateData == null)
            {
                checkUpdateData = new CheckUpdate();
                //检测更新版本
                if (checkUpdateData.CheckOk == false && FrameSystemInfo.GetSystemInfoTable.S_SystemConfigData.C_CheckUpdate)
                {
                    //checkUpdateData.SendDataWeb();
                    DelegateCheckUpdate dc = new DelegateCheckUpdate(checkUpdateData.SendDataWeb);
                    dc.Invoke();
                }
            }
            //判断是否在manager目录里
            if (Common.GetCharInStringCount("/manager/", Common.GetScriptUrl.ToLower()) > 0)
            {
                //判断文件名是否为aspx
                if (Common.GetScriptNameExt.ToLower() == "aspx")
                {
                    //判断
                    if (Common.Get_UserID != 0)
                    {
                        //判断在线用户

                        //if (UserOnlineList.CheckMemberOnline(UserData.GetUserDate.U_LoginName.ToLower(), Common.Get_UserID))
                        //{
                        //    UserOnlineList.Access(Common.Get_UserID, Common.GetScriptUrl);
                        //}
                        //string abc = Common.GetSessionID;

                        if (FrameWorkOnline.Instance().CheckUserInOnline(UserData.GetUserDate.U_LoginName, Common.GetSessionID))
                        {
                            FrameWorkOnline.Instance().OnlineAccess(UserData.GetUserDate.U_LoginName);
                        }
                        else
                        {
                            if (Common.OnlineMinute != 0)
                            {
                                FrameWorkLogin.UserOut();
                                MessageBox MBx = new MessageBox();
                                MBx.M_Type     = 2;
                                MBx.M_Title    = "没有登陆!";
                                MBx.M_IconType = Icon_Type.Error;
                                MBx.M_Body     = "您与系统的连接已经超时,请重新登陆!";
                                MBx.M_ButtonList.Add(new sys_NavigationUrl("返回", "~/Manager/default.aspx", "", UrlType.Href, true));
                                EventMessage.MessageBox(MBx);
                            }
                        }

                        //检测权限
                        if (!Check_Permission)
                        {
                            MessageBox MBx = new MessageBox();
                            MBx.M_Type     = 2;
                            MBx.M_Title    = "权限出错";
                            MBx.M_IconType = Icon_Type.Error;
                            MBx.M_Body     = "无权访问当前页面!";
                            MBx.M_ButtonList.Add(new sys_NavigationUrl("返回", "history.back();", "", UrlType.JavaScript, true));
                            EventMessage.MessageBox(MBx);
                        }

                        //更新当前用户最后访问记录
                        if (Common.GetDBType == "Oracle")
                        {
                            BusinessFacade.Update_Table_Fileds("sys_User", string.Format("U_LastIP='{0}',U_LastDateTime=to_date('{1}','yyyy-mm-dd HH24:MI:SS')", Common.GetIPAddress(), DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss")), string.Format("UserID={0}", Common.Get_UserID));
                        }
                        else
                        {
                            BusinessFacade.Update_Table_Fileds("sys_User", string.Format("U_LastIP='{0}',U_LastDateTime='{1}'", Common.GetIPAddress(), DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss")), string.Format("UserID={0}", Common.Get_UserID));
                        }

                        //写访问日志
                        if (FrameSystemInfo.GetSystemInfoTable.S_SystemConfigData.C_RequestLog)
                        {
                            EventMessage.EventWriteDB(3, "访问网页");
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 处理认证成功事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void app_Auth(object sender, EventArgs e)
        {
            //CheckDisableIp();
            //进行在线更新检测
            if (checkUpdateData == null)
            {
                checkUpdateData = new CheckUpdate();
                //检测更新版本
                if (checkUpdateData.CheckOk == false && FrameSystemInfo.GetSystemInfoTable.S_SystemConfigData.C_CheckUpdate)
                {
                    //checkUpdateData.SendDataWeb();
                    DelegateCheckUpdate dc = new DelegateCheckUpdate(checkUpdateData.SendDataWeb);
                    dc.Invoke();
                }
            }
            //判断是否在manager目录里
            if (Common.GetCharInStringCount("/manager/", Common.GetScriptUrl.ToLower()) > 0)
            {
                //判断文件名是否为aspx
                if (Common.GetScriptNameExt.ToLower() == "aspx")
                {
                    //判断
                    if (Common.Get_UserID != 0)
                    {
                        //判断在线用户

                        //if (UserOnlineList.CheckMemberOnline(UserData.GetUserDate.U_LoginName.ToLower(), Common.Get_UserID))
                        //{
                        //    UserOnlineList.Access(Common.Get_UserID, Common.GetScriptUrl);
                        //}
                        //string abc = Common.GetSessionID;

                        if (FrameWorkOnline.Instance().CheckUserInOnline(UserData.GetUserDate.U_LoginName,Common.GetSessionID))
                        {
                            FrameWorkOnline.Instance().OnlineAccess(UserData.GetUserDate.U_LoginName);
                        }
                        else
                        {
                            if (Common.OnlineMinute != 0)
                            {
                                FrameWorkLogin.UserOut();
                                MessageBox MBx = new MessageBox();
                                MBx.M_Type = 2;
                                MBx.M_Title = "没有登陆!";
                                MBx.M_IconType = Icon_Type.Error;
                                MBx.M_Body = "您与系统的连接已经超时,请重新登陆!";
                                MBx.M_ButtonList.Add(new sys_NavigationUrl("返回", "~/Manager/default.aspx", "", UrlType.Href, true));
                                EventMessage.MessageBox(MBx);
                            }
                        }

                        //检测权限
                        if (!Check_Permission)
                        {
                            MessageBox MBx = new MessageBox();
                            MBx.M_Type = 2;
                            MBx.M_Title = "权限出错";
                            MBx.M_IconType = Icon_Type.Error;
                            MBx.M_Body = "无权访问当前页面!";
                            MBx.M_ButtonList.Add(new sys_NavigationUrl("返回", "history.back();", "", UrlType.JavaScript, true));
                            EventMessage.MessageBox(MBx);
                        }

                        //更新当前用户最后访问记录
                        if (Common.GetDBType == "Oracle")
                            BusinessFacade.Update_Table_Fileds("sys_User", string.Format("U_LastIP='{0}',U_LastDateTime=to_date('{1}','yyyy-mm-dd HH24:MI:SS')", Common.GetIPAddress(), DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss")), string.Format("UserID={0}", Common.Get_UserID));
                        else
                            BusinessFacade.Update_Table_Fileds("sys_User", string.Format("U_LastIP='{0}',U_LastDateTime='{1}'", Common.GetIPAddress(), DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss")), string.Format("UserID={0}", Common.Get_UserID));

                        //写访问日志
                        if (FrameSystemInfo.GetSystemInfoTable.S_SystemConfigData.C_RequestLog)
                            EventMessage.EventWriteDB(3, "访问网页");
                    }
                }
            }
        }