Example #1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName=="OutOnline")
            {
                FrameWorkPermission.CheckPermissionVoid(PopedomType.Delete);
                //FrameWorkPermission.UserOnlineList.RemoveUserName(e.CommandArgument.ToString().ToLower());
                BusinessFacade.InterfaceOnlineRemove(e.CommandArgument.ToString().ToLower());
                MessageBox MBx = new MessageBox();
                MBx.M_Type = 2;
                MBx.M_Title = "ǿ���û��˳�!";
                MBx.M_IconType = Icon_Type.Error;
                MBx.M_Body = string.Format("ǿ���û�({0})�˳��ɹ���",e.CommandArgument.ToString());
                MBx.M_ButtonList.Add(new sys_NavigationUrl("����", Common.GetHomeBaseUrl("default.aspx"), "", UrlType.Href, true));
                EventMessage.MessageBox(MBx);

            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string CMD =(string) Common.sink("CMD", MethodType.Get, 255, 0, DataType.Str);
            if (!Page.IsPostBack)
            {
                MessageBox MBx = new MessageBox();
                ArrayList lst = new ArrayList();
                if (CMD == "AppError")
                {
                    List<sys_NavigationUrl> ListUrl = new List<sys_NavigationUrl>();
                    ListUrl.Add(new sys_NavigationUrl("确定", "default.aspx", "", UrlType.Href, true));

                    MBx.M_Body = "抱歉,处理您的请求时发生了错误。错误信息已被记录,我们将追踪解决。";
                    MBx.M_Title = "系统错误";
                    MBx.M_IconType = Icon_Type.Error;
                    MBx.M_ButtonList = ListUrl;                    
                }
                else
                {
                    string CookiesKey = string.Format("{0}-MessageValue", Common.Get_CookiesName);
                    //if (Session[string.Format("{0}-MessageValue", Common.Get_CookiesName)] != null)

                    //if (FrameWorkCache.Instance()[CookiesKey]!=null)
                    //{
                        string MessageValue = Request.Cookies[CookiesKey].Value.ToString();
                        //Response.Write(MessageValue);
                        //Response.Write("<br>-------------------------<br>");
                        //Response.Write(Request.Cookies[CookiesKey+"1"].Value.ToString());
                        if (MessageValue != "")
                        {
                            MBx = EventMessage.Deserialize_MessageBox(EventMessage.Deserialize_MessageBox(MessageValue,true));
                        }
                        //MBx = (MessageBox)Session[string.Format("{0}-MessageValue", Common.Get_CookiesName)];
                        //MBx = (MessageBox)FrameWorkCache.Instance()[CookiesKey];

                    //}
                }
                ReturnScript = MBx.M_ReturnScript;
                Header.Title = MBx.M_Title;
                lst.Add(MBx);
                MessageDispBox.DataSource = lst;
                MessageDispBox.DataBind();
            }
        }
Example #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            MessageBox MBx = new MessageBox();
            MBx.M_Type = 2;
            MBx.M_Title = "��½�����";
            MBx.M_IconType = Icon_Type.Error;
            MBx.M_Body = "��֤����Ч����ȷ�����������֤����Ч��";

            //string UserKey = sLoginName + Common.GetIPAddress().Replace(".", "");

            if (FrameWorkLogin.GetLoginUserError(UserKey) > 2 && (Session["CheckCode"] == null || sCode_op != Session["CheckCode"].ToString()))
            {
                MBx.M_WriteToDB = false;
                MBx.M_ButtonList.Add(new sys_NavigationUrl("����", "login.aspx", "�����ť����������֤�룡", UrlType.Href, true));
            }

            else if (!FrameWorkLogin.CheckDisableLoginUser(UserKey))
            {
                MBx.M_Body = string.Format("���û�:{0},IP:{1}��½�����������ϵͳ����,�Ѿ���ֹ��½.����ϵ����Ա��", sLoginName, Common.GetIPAddress());
                MBx.M_ButtonList.Add(new sys_NavigationUrl("����", "login.aspx", "�����ť���أ�", UrlType.Href, true));

            }
            else if (new FrameWorkLogin().CheckLogin(sLoginName, sLoginPass))
            {
                MBx.M_IconType = Icon_Type.OK;
                MBx.M_Title = "��½�ɹ���";
                MBx.M_Body = string.Format("��ӭ��{0}���ɹ����롣����IPΪ��{1}��", sLoginName, Common.GetIPAddress());
                MBx.M_WriteToDB = false;
                MBx.M_ButtonList.Add(new sys_NavigationUrl("ȷ��", "default.aspx", "�����ť��½��", UrlType.Href, true));
                FrameWorkLogin.MoveErrorLoginUser(UserKey);
                //д������־
                EventMessage.EventWriteDB(2, MBx.M_Body, UserData.Get_sys_UserTable(sLoginName).UserID);
            }
            else
            {
                MBx.M_Body = string.Format("�û���/����({0}/{1})����", sLoginName, sLoginPass);
                MBx.M_ButtonList.Add(new sys_NavigationUrl("����", "login.aspx", "�����ť�������룡", UrlType.Href, true));
            }
            Session["CheckCode"] = Common.RndNum(4);
            EventMessage.MessageBox(MBx);
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string CMD =(string) Common.sink("CMD", MethodType.Get, 255, 0, DataType.Str);
            if (!Page.IsPostBack)
            {
                MessageBox MBx = new MessageBox();
                ArrayList lst = new ArrayList();
                if (CMD == "AppError")
                {
                    List<sys_NavigationUrl> ListUrl = new List<sys_NavigationUrl>();
                    ListUrl.Add(new sys_NavigationUrl("ȷ��", "default.aspx", "", UrlType.Href, true));

                    MBx.M_Body = "��Ǹ��������������ʱ�����˴��󡣴�����Ϣ�ѱ���¼�����ǽ�׷�ٽ����";
                    MBx.M_Title = "ϵͳ����";
                    MBx.M_IconType = Icon_Type.Error;
                    MBx.M_ButtonList = ListUrl;
                }
                else
                {
                    string CookiesKey = string.Format("{0}-MessageValue", Common.Get_CookiesName);
                    if (Session[string.Format("{0}-MessageValue", Common.Get_CookiesName)] != null)
                    {
                        //string MessageValue = Request.Cookies[CookiesKey].Value.ToString();

                        //if (MessageValue != "")
                        //{
                        //    MBx = EventMessage.Deserialize_MessageBox(EventMessage.Deserialize_MessageBox(MessageValue));
                        //}
                        MBx = (MessageBox)Session[string.Format("{0}-MessageValue", Common.Get_CookiesName)];

                    }
                }
                ReturnScript = MBx.M_ReturnScript;
                Header.Title = MBx.M_Title;
                lst.Add(MBx);
                MessageDispBox.DataSource = lst;
                MessageDispBox.DataBind();
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //��������û�
                FrameWorkOnline.Instance().ClearOnlineUserTimeOut();
            }

            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                Response.Redirect("default.aspx");
            }
            FrameName = FrameSystemInfo.GetSystemInfoTable.S_Name;
            FrameNameVer = FrameSystemInfo.GetSystemInfoTable.S_Version;

            //Button1.Attributes.Add("Onclick", "javascript:return checkForm(ctl00);");
            string CMD = (string)Common.sink("CMD", MethodType.Get, 255, 0, DataType.Str);
            if (CMD == "OutOnline")
            {
                string U_LoginName = (string)Common.sink("U_LoginName", MethodType.Get, 20, 1, DataType.Str);
                string U_Password = (string)Common.sink("U_Password", MethodType.Get, 50, 1, DataType.Str);
                string OPCode = (string)Common.sink("OPCode", MethodType.Get, 4, 4, DataType.Str);

                MessageBox MBx = new MessageBox();
                MBx.M_Type = 2;
                MBx.M_Title = "ǿ�����ߣ�";
                MBx.M_IconType = Icon_Type.Error;
                MBx.M_Body = "ǿ������ʧ��.��֤����Ч����ȷ�����������֤����Ч��";

                if (Session["CheckCode"] == null || OPCode.ToLower() != Session["CheckCode"].ToString())
                {
                    MBx.M_ButtonList.Add(new sys_NavigationUrl("����", "login.aspx", "�����ť����������֤�룡", UrlType.Href, true));
                }
                else
                {
                    QueryParam qp = new QueryParam();
                    qp.Where = string.Format(" Where U_StatUs=0 and  U_LoginName='{0}' and U_Password='******'", Common.inSQL(U_LoginName), Common.inSQL(Common.md5(U_Password,32)));
                    int iInt = 0;
                    ArrayList lst = BusinessFacade.sys_UserList(qp, out iInt);
                    if (iInt > 0)
                    {
                        //FrameWorkPermission.UserOnlineList.RemoveUserName(U_LoginName.ToLower());
                        string sessionid = (string)Common.sink("SessionID", MethodType.Get, 24, 0, DataType.Str);
                        FrameWorkOnline.Instance().OnlineRemove(sessionid);
                        MBx.M_IconType = Icon_Type.OK;
                        MBx.M_Body = string.Format("ǿ���ʺ�{0}���߳ɹ���", U_LoginName);
                        //д��ǿ���ʺ�������־
                        EventMessage.EventWriteDB(2, MBx.M_Body, ((sys_UserTable)lst[0]).UserID);
                        LoginUser(U_LoginName, U_Password, OPCode, UserKey);
                        //MBx.M_ButtonList.Add(new sys_NavigationUrl("����", "login.aspx", "", UrlType.Href, true));
                        //�����û�Ϊ��½״̬

                    }
                    else
                    {
                        MBx.M_Body = "ǿ������ʧ��.�û���/������Ч��";
                        MBx.M_ButtonList.Add(new sys_NavigationUrl("����", "login.aspx", "", UrlType.Href, true));
                    }

                }
                Session["CheckCode"] = Common.RndNum(4);
                EventMessage.MessageBox(MBx);

            }

            if (!DispCode)
            {
                Logincode_op.Src = "images/Logon/Logon_7no.gif";
                inputcode_op.Visible = false;
            }
        }
Example #6
0
        /// <summary>
        /// ���е�½����
        /// </summary>
        /// <param name="sLoginName">�û���</param>
        /// <param name="sLoginPass">����</param>
        /// <param name="sCode_op">��֤��</param>
        /// <param name="UserKey">�û�key</param>
        private void LoginUser(string sLoginName, string sLoginPass, string sCode_op, string UserKey)
        {
            MessageBox MBx = new MessageBox();
            MBx.M_Type = 2;
            MBx.M_Title = "��½�����";
            MBx.M_IconType = Icon_Type.Error;
            MBx.M_Body = "��֤����Ч����ȷ�����������֤����Ч��";

            if (DispCode && (Session["CheckCode"] == null || sCode_op != Session["CheckCode"].ToString()))
            {
                MBx.M_WriteToDB = false;
                MBx.M_ButtonList.Add(new sys_NavigationUrl("����", "login.aspx", "�����ť����������֤�룡", UrlType.Href, true));
            }
            else if (!FrameWorkLogin.CheckDisableLoginUser(UserKey))
            {
                MBx.M_Body = string.Format("��ǰIP:{0}��½�������({1})����ϵͳ����,�Ѿ���ֹ��½.����ϵ����Ա��", Common.GetIPAddress(), FrameSystemInfo.GetSystemInfoTable.S_SystemConfigData.C_LoginErrorMaxNum);
                MBx.M_ButtonList.Add(new sys_NavigationUrl("����", "login.aspx", "�����ť���أ�", UrlType.Href, true));

            }
            else if (new FrameWorkLogin().CheckLogin(sLoginName, sLoginPass, UserKey))
            {
                MBx.M_IconType = Icon_Type.OK;
                MBx.M_Title = "��½�ɹ���";
                MBx.M_Body = string.Format("��ӭ��{0}���ɹ����롣����IPΪ��{1}��", sLoginName, Common.GetIPAddress());
                MBx.M_WriteToDB = false;
                MBx.M_ButtonList.Add(new sys_NavigationUrl("ȷ��", "default.aspx", "�����ť��½��", UrlType.Href, true));
                FrameWorkLogin.MoveErrorLoginUser(UserKey);
                //д������־
                EventMessage.EventWriteDB(2, MBx.M_Body, UserData.Get_sys_UserTable(sLoginName).UserID);
            }
            else
            {
                MBx.M_Body = string.Format("�û���/����({0}/{1})����", sLoginName, sLoginPass);
                MBx.M_ButtonList.Add(new sys_NavigationUrl("����", "login.aspx", "�����ť�������룡", UrlType.Href, true));
            }
            Session["CheckCode"] = Common.RndNum(4);
            EventMessage.MessageBox(MBx);
        }
Example #7
0
        /// <summary>
        /// 进行登陆操作
        /// </summary>
        /// <param name="sLoginName">用户名</param>
        /// <param name="sLoginPass">密码</param>
        /// <param name="sCode_op">验证码</param>
        /// <param name="UserKey">用户key</param>
        private void LoginUser(string sLoginName, string sLoginPass, string sCode_op, string UserKey)
        {
            MessageBox MBx = new MessageBox();
            MBx.M_Type = 2;
            MBx.M_Title = "登陆出错!";
            MBx.M_IconType = Icon_Type.Error;
            MBx.M_Body = "验证码无效,请确认您输入的验证码有效!";

            if (DispCode && (Session["CheckCode"] == null || sCode_op != Session["CheckCode"].ToString()))
            {
                MBx.M_WriteToDB = false;
                MBx.M_ButtonList.Add(new sys_NavigationUrl("返回", "login.aspx", "点击按钮重新输入验证码!", UrlType.Href, true));
            }
            else if (!FrameWorkLogin.CheckDisableLoginUser(UserKey))
            {
                MBx.M_Body = string.Format("当前IP:{0}登陆出错次数({1})超过系统允许,已经禁止登陆.请联系管理员!", Common.GetIPAddress(), FrameSystemInfo.GetSystemInfoTable.S_SystemConfigData.C_LoginErrorMaxNum);
                MBx.M_ButtonList.Add(new sys_NavigationUrl("返回", "login.aspx", "点击按钮返回!", UrlType.Href, true));

            }
            else if (new FrameWorkLogin().CheckLogin(sLoginName, sLoginPass, UserKey))
            {
                MBx.M_IconType = Icon_Type.OK;
                MBx.M_Title = "登陆成功!";
                MBx.M_Body = string.Format("欢迎您{0},成功登入。您的IP为:{1}!", sLoginName, Common.GetIPAddress());
                MBx.M_WriteToDB = false;
                MBx.M_ButtonList.Add(new sys_NavigationUrl("确定", "default.aspx", "点击按钮登陆!", UrlType.Href, true));
                FrameWorkLogin.MoveErrorLoginUser(UserKey);
                //写登入日志
                EventMessage.EventWriteDB(2, MBx.M_Body, UserData.Get_sys_UserTable(sLoginName).UserID);
            }
            else
            {
                MBx.M_Body = string.Format("用户名/密码({0}/{1})错误!", sLoginName, sLoginPass);
                MBx.M_ButtonList.Add(new sys_NavigationUrl("返回", "login.aspx", "点击按钮重新输入!", UrlType.Href, true));
            }
            Session["CheckCode"] = Common.RndNum(4);
            EventMessage.MessageBox(MBx);
        }
Example #8
0
 /// <summary>
 /// 检测ip地址是否在禁止列表中
 /// </summary>
 private void CheckDisableIp()
 {
     //判断文件名是否为aspx
     if (Common.GetScriptNameExt.ToLower() == "aspx")
     {
         //判断是否在manager/messages.aspx文件
         if (Common.GetCharInStringCount("/manager/messages.aspx", Common.GetScriptUrl.ToLower()) <= 0)
         {
             if (FrameSystemInfo.GetSystemInfoTable.S_SystemConfigData.C_DisableIpList.Contains(Common.GetIPAddress()))
             {
                 MessageBox MBx = new MessageBox();
                 MBx.M_Type = 2;
                 MBx.M_Title = "IP地址禁止!";
                 MBx.M_IconType = Icon_Type.Error;
                 MBx.M_Body = string.Format("您的IP:({0})已经被管理禁止访问本系统!,请联系管理员开通访问权限.", Common.GetIPAddress());
                 MBx.M_ButtonList.Add(new sys_NavigationUrl("关闭", "window.close();", "", UrlType.JavaScript, true));
                 EventMessage.MessageBox(MBx);
             }
         }
     }
 }
Example #9
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, "访问网页");
                    }
                }
            }
        }
Example #10
0
 /// <summary>
 /// 序列化MessageBox类
 /// </summary>
 /// <param name="MBx">MessageBox类</param>
 /// <returns>字符数组</returns>
 public static byte[] Serializable_MessageBox(MessageBox MBx)
 {
     IFormatter formatter = new BinaryFormatter();
     MemoryStream ms = new MemoryStream();
     byte[] b;
     formatter.Serialize(ms, MBx);
     ms.Position = 0;
     b = new byte[ms.Length];
     ms.Read(b, 0, b.Length);
     ms.Close();
     return b;
 }
Example #11
0
 /// <summary>
 /// 信息提示
 /// </summary>
 /// <param name="MBx">信息提示类</param>
 public static void MessageBox(MessageBox MBx)
 {
     if (MBx.M_WriteToDB)
     {
         EventWriteDB(MBx.M_Type, MBx.M_Body);
     }
     if (MBx.M_ButtonList.Count > 0)
     {
         System.Web.HttpContext.Current.Response.Cookies[string.Format("{0}-MessageValue",Common.Get_CookiesName)].Value = Serializable_MessageBox(Serializable_MessageBox(MBx),true);
         //System.Web.HttpContext.Current.Response.Cookies[string.Format("{0}-MessageValue1", Common.Get_CookiesName)].Value = Serializable_MessageBox(Serializable_MessageBox(MBx), false);
         //System.Web.HttpContext.Current.Session[string.Format("{0}-MessageValue", Common.Get_CookiesName)] = MBx;
         //FrameWorkCache.Instance().Insert(string.Format("{0}-MessageValue", Common.Get_CookiesName), MBx);
         System.Web.HttpContext.Current.Response.Redirect(string.Format("~/Manager/Messages.aspx?OPID={0}",Common.RndNum(5)));
     }
 }
Example #12
0
 /// <summary>
 ///  信息提示
 /// </summary>
 /// <param name="M_Type">类型1:操作日志2:安全日志</param>
 /// <param name="M_Title">标题</param>
 /// <param name="M_Body">内容</param>
 /// <param name="M_IconType">icon类型</param>
 /// <param name="M_WriteToDB">是否写入db</param>
 /// <param name="M_ButtonList">按钮类型</param>
 /// <param name="M_ReturnScript">执行Script脚本字符串(需加<script></script>)</param>
 public static void MessageBox(int M_Type, string M_Title, string M_Body, Icon_Type M_IconType, bool M_WriteToDB, List<sys_NavigationUrl> M_ButtonList, string M_ReturnScript)
 {
     MessageBox mbx = new MessageBox();
     mbx.M_Body = M_Body;
     mbx.M_ButtonList = M_ButtonList;
     mbx.M_IconType = M_IconType;
     mbx.M_Title = M_Title;
     mbx.M_Type = M_Type;
     mbx.M_WriteToDB = M_WriteToDB;
     mbx.M_ReturnScript = M_ReturnScript;
     MessageBox(mbx);
 }