コード例 #1
0
ファイル: ServerLog.aspx.cs プロジェクト: wooln/AK47Source
        public void DeleteAppType()
        {
            XmlElement root = _XmlRequest.DocumentElement;

            string strSort      = root.GetAttribute("orgSort");
            string strSql       = string.Empty;
            string strTableName = string.Empty;
            string strObjName   = string.Empty;
            string strLogType   = string.Empty;

            if (strSort.Length == 8)
            {
                strTableName = "APP_LOG_TYPE";
                strObjName   = "应用类型";
                strLogType   = "DEL_APP_TYPE";
            }
            else if (strSort.Length == 12)
            {
                strTableName = "APP_OPERATION_TYPE";
                strObjName   = "应用操作类型";
                strLogType   = "DEL_OP_TYPE";
            }
            strSql = "UPDATE " + strTableName + " SET VISIBLE = 'n' WHERE GUID = "
                     + TSqlBuilder.Instance.CheckQuotationMark(root.GetAttribute("Guid"), true);
            InnerCommon.ExecuteNonQuery(strSql);

            UserDataWrite.InsertUserLog("APP_LOG", strLogType, "从日志审计系统中删除" + strObjName + ":" + root.GetAttribute("DisplayName"),
                                        _XmlRequest.DocumentElement.InnerXml, true);
        }
コード例 #2
0
ファイル: ServerLog.aspx.cs プロジェクト: wooln/AK47Source
        private void InsertAppType()
        {
            XmlNode xNode = _XmlRequest.DocumentElement.SelectSingleNode(".//SET");
            XmlNode root  = null;

            string insertSql = string.Empty;
            string strSql    = string.Empty;

            if (_XmlRequest.DocumentElement.SelectSingleNode("APP_OPERATION_TYPE") != null)
            {
                root      = _XmlRequest.DocumentElement.SelectSingleNode("APP_OPERATION_TYPE");
                insertSql = "INSERT APP_OPERATION_TYPE ";

                string appGuid    = ((XmlElement)root).GetAttribute("appGuid");
                string strOrgSort = ((XmlElement)root).GetAttribute("strSort");
                string typeGuid   = Guid.NewGuid().ToString();

                InsertSqlClauseBuilder ic = new InsertSqlClauseBuilder();
                ic.AppendItem <string>("GUID", typeGuid);
                ic.AppendItem <string>("APP_GUID", appGuid);
                ic.AppendItem <string>("DISPLAYNAME", xNode.SelectSingleNode("DISPLAYNAME").InnerText);
                ic.AppendItem <string>("CODE_NAME", xNode.SelectSingleNode("CODE_NAME").InnerText);
                ic.AppendItem <string>("DISCRIPTION", xNode.SelectSingleNode("DESCRIPTION").InnerText);
                ic.AppendItem <string>("VISIBLE", "y");
                ic.AppendItem <string>("CLASS", LogReader.GetNewClassValue(appGuid, strOrgSort));

                strSql = insertSql + ic.ToSqlString(TSqlBuilder.Instance);
                UserDataWrite.InsertUserLog("APP_LOG", "", "", "", "ADD_OP_TYPE", "向日志审计系统添加新的操作类型:"
                                            + xNode.SelectSingleNode("DISPLAYNAME").InnerText, _XmlRequest.DocumentElement.InnerXml, true);
            }
            else
            {
                root      = _XmlRequest.DocumentElement.SelectSingleNode("APP_LOG_TYPE");
                insertSql = "INSERT APP_LOG_TYPE ";

                string appGuid = Guid.NewGuid().ToString();

                InsertSqlClauseBuilder ic = new InsertSqlClauseBuilder();
                ic.AppendItem <string>("GUID", appGuid);
                ic.AppendItem <string>("CODE_NAME", xNode.SelectSingleNode("CODE_NAME").InnerText);
                ic.AppendItem <string>("DISPLAYNAME", xNode.SelectSingleNode("DISPLAYNAME").InnerText);
                ic.AppendItem <string>("VISIBLE", "y");
                ic.AppendItem <string>("DISCRIPTION", xNode.SelectSingleNode("DESCRIPTION").InnerText);
                ic.AppendItem <string>("CLASS", LogReader.GetClassForApp());

                strSql = insertSql + ic.ToSqlString(TSqlBuilder.Instance);
                UserDataWrite.InsertUserLog("APP_LOG", "ADD_APP_TYPE", "向日志审计系统添加新的应用:"
                                            + xNode.SelectSingleNode("DISPLAYNAME").InnerText, _XmlRequest.DocumentElement.InnerXml, true);
            }

            InnerCommon.ExecuteNonQuery(strSql);
        }
コード例 #3
0
ファイル: Logon.aspx.cs プロジェクト: wooln/AK47Source
        protected void btnLogOn_Click(object sender, System.EventArgs e)
        {
            //			userName.Value = "luzhiqiang";
            //			userPassword.Value = "000000";
            try
            {
                ExceptionHelper.TrueThrow <ApplicationException>(string.IsNullOrEmpty(userName.Value), "对不起,登录名称不能为空");

                ILogOnUserInfo logonUserInfo = new LogOnUserInfo(userName.Value, userPwdType.SelectedItem.Value, userPassword.Value);

                Session["logonUserInfo"] = logonUserInfo;

                //记录系统登录日志(登录成功)
                SetUserPrincipal(logonUserInfo.UserLogOnName);

                FormsAuthentication.SetAuthCookie(logonUserInfo.UserLogOnName, false);

                GlobalInfo.InitHttpEnv(Request);
                GlobalInfo.InitLogOnUser(logonUserInfo);

                UserDataWrite.InsertUserLog(OGULogDefine.LOGON_APP,
                                            OGULogDefine.LOGON_TYPE_SUCCESS,
                                            "用户“" + logonUserInfo.OuUsers[0].UserDisplayName + "”成功登录!",
                                            logonUserInfo.UserLogOnName);

                SysDataWrite.InsertSysLog("jinshan", "y", "adfadsfasdfasdfasdf");

                string strRequestUrl = Request.QueryString["ReturnUrl"];

                if (strRequestUrl != null)
                {
                    FormsAuthentication.RedirectFromLoginPage(logonUserInfo.UserLogOnName, false);
                }
                else
                {
                    Response.Redirect("OGUAdmin.aspx", false);
                }
            }
            catch (System.Exception ex)
            {
                errorMsg.Visible = true;
                errorMsg.Text    = ex.Message.Replace("\n", "<br>");
            }
        }
コード例 #4
0
ファイル: ServerLog.aspx.cs プロジェクト: wooln/AK47Source
        public void UpdateAppType()
        {
            XmlElement root         = _XmlRequest.DocumentElement;
            string     strTableName = root.FirstChild.Name;

            string strGuid        = root.SelectSingleNode(".//GUID").InnerText;
            string strCodeName    = root.SelectSingleNode(".//CODE_NAME").InnerText;
            string strDisplayname = root.SelectSingleNode(".//DISPLAYNAME").InnerText;
            string strDescription = root.SelectSingleNode(".//DESCRIPTION").InnerText;

            string strSql = "UPDATE " + strTableName
                            + " SET CODE_NAME = " + TSqlBuilder.Instance.CheckQuotationMark(strCodeName, true)
                            + ", DISPLAYNAME = " + TSqlBuilder.Instance.CheckQuotationMark(strDisplayname, true)
                            + ", DISCRIPTION = " + TSqlBuilder.Instance.CheckQuotationMark(strDescription, true)
                            + " WHERE GUID = '" + strGuid + "'";

            InnerCommon.ExecuteNonQuery(strSql);
            UserDataWrite.InsertUserLog("APP_LOG", strTableName == "APP_LOG_TYPE" ? "MODIFY_APP_TYPE" : "MODIFY_OP_TYPE",
                                        "从日志审计系统中修改" + (strTableName == "APP_LOG_TYPE" ? "应用" : "操作类型") + "[" + strDisplayname + "]", _XmlRequest.DocumentElement.InnerXml, true);
        }
コード例 #5
0
 public void InsertUserLog(string userLogonName, string appName, string hostIP, string hostName, string url, string goalID, string goalName, string goalDisplayName, string opType, string explain, string originalData, bool bOpSucceed)
 {
     UserDataWrite.InsertUserLog(userLogonName, appName, hostIP, hostName, url, goalID, goalName, goalDisplayName, opType, explain, originalData, bOpSucceed);
 }