public string SendUserReport(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, Caps caps) { httpResponse.StatusCode = (int)System.Net.HttpStatusCode.OK; httpResponse.ContentType = "text/html"; OSDMap response = new OSDMap(); OSDMap map = (OSDMap)OSDParser.DeserializeLLSDXml(request); AbuseReportData abuse_report = AbuseReportDataFromOSD(map); abuse_report.SenderID = caps.AgentID; abuse_report.SenderName = m_UserManager.GetUserName(caps.AgentID); abuse_report.AbuseRegionID = m_Scene.RegionInfo.RegionID; abuse_report.AbuseRegionName = m_Scene.RegionInfo.RegionName; abuse_report.AbuserName = m_UserManager.GetUserName(abuse_report.AbuserID); if (m_Connector.ReportAbuse(abuse_report)) { m_log.InfoFormat("[AbuseReports] {0} has reported {1}", abuse_report.SenderName, abuse_report.AbuserName); response.Add("state", "complete"); } else { response.Add("state", "failed"); } return(OSDParser.SerializeLLSDXmlString(response));; }
public bool ReportAbuse(AbuseReportData report) { if (!m_Enabled) { return(false); } return(m_service.ReportAbuse(report)); }
public bool ReportAbuse(AbuseReportData report) { if (!m_Enabled) { return(false); } return(m_remoteConnector.ReportAbuse(report)); }
byte[] report(Dictionary <string, object> request) { if (!request.ContainsKey("reporter") || !request.ContainsKey("abuser")) { return(FailureResult()); } AbuseReportData report = new AbuseReportData(); if (!UUID.TryParse(request["reporter"].ToString(), out report.SenderID)) { return(FailureResult()); } if (request.ContainsKey("reporter-name")) { report.SenderName = request["reporter-name"].ToString(); } if (!UUID.TryParse(request["abuser"].ToString(), out report.AbuserID)) { return(FailureResult()); } if (request.ContainsKey("abuser-name")) { report.AbuserName = request["abuser-name"].ToString(); } if (!UUID.TryParse(request["region-id"].ToString(), out report.AbuseRegionID)) { return(FailureResult()); } if (request.ContainsKey("region-name")) { report.AbuseRegionName = request["region-name"].ToString(); } report.Time = Util.UnixTimeSinceEpoch(); if (request.ContainsKey("summary")) { report.Summary = request["summary"].ToString(); } if (request.ContainsKey("details")) { report.Details = request["details"].ToString(); } if (request.ContainsKey("version")) { report.Version = request["version"].ToString(); } if (request.ContainsKey("object-id")) { if (!UUID.TryParse(request["object-id"].ToString(), out report.ObjectID)) { return(FailureResult()); } } else { report.ObjectID = UUID.Zero; } if (request.ContainsKey("position")) { report.Position = request["position"].ToString(); } if (request.ContainsKey("category")) { report.Category = request["category"].ToString(); } if (request.ContainsKey("check-flags")) { if (!Int32.TryParse(request["check-flags"].ToString(), out report.CheckFlags)) { return(FailureResult()); } } else { report.CheckFlags = 0; } if (request.ContainsKey("image-data")) { report.ImageData = Convert.FromBase64String(request["image-data"].ToString()); } else { report.ImageData = new byte[0]; } m_log.InfoFormat("[ABUSE REPORTS] {0} has reported {1}", report.SenderName, report.AbuserName); return(m_service.ReportAbuse(report) ? SuccessResult() : FailureResult()); }