public AbuseReportsHandler(string url, IAbuseReports service, IRegistryCore reg, string SessionID) : base("POST", url) { m_AbuseReportsService = service; m_registry = reg; m_SessionID = SessionID; }
public void Start(IConfigSource config, IRegistryCore registry) { IConfig handlerConfig = config.Configs["Handlers"]; if (handlerConfig.GetString("AbuseReportsInHandler", "") != Name) return; m_registry = registry; m_AbuseReportsService = registry.RequestModuleInterface<IAbuseReports>(); m_registry.RequestModuleInterface<IGridRegistrationService>().RegisterModule(this); }
public void Start(IConfigSource config, IRegistryCore registry) { IConfig handlerConfig = config.Configs["Handlers"]; if (handlerConfig.GetString("AbuseReportsInHandler", "") != Name) { return; } m_registry = registry; m_AbuseReportsService = registry.RequestModuleInterface <IAbuseReports>(); m_registry.RequestModuleInterface <IGridRegistrationService>().RegisterModule(this); }
byte[] AbuseReportSaveNotes(OSDMap map) { OSDMap resp = new OSDMap(); IAbuseReports ar = m_registry.RequestModuleInterface <IAbuseReports>(); AbuseReport tar = ar.GetAbuseReport(map["Number"].AsInteger(), map["WebPassword"].AsString()); tar.Notes = map["Notes"].ToString(); ar.UpdateAbuseReport(tar, map["WebPassword"].AsString()); resp["Finished"] = OSD.FromBoolean(true); string xmlString = OSDParser.SerializeJsonString(resp); UTF8Encoding encoding = new UTF8Encoding(); return(encoding.GetBytes(xmlString)); }
byte[] GetAbuseReports(OSDMap map) { OSDMap resp = new OSDMap(); IAbuseReports ar = m_registry.RequestModuleInterface <IAbuseReports>(); List <AbuseReport> lar = ar.GetAbuseReports(map["start"].AsInteger(), map["count"].AsInteger(), map["filter"].AsString()); OSDArray returnvalue = new OSDArray(); foreach (AbuseReport tar in lar) { returnvalue.Add(tar.ToOSD()); } resp["abusereports"] = returnvalue; string xmlString = OSDParser.SerializeJsonString(resp); UTF8Encoding encoding = new UTF8Encoding(); return(encoding.GetBytes(xmlString)); }
/// <summary> /// This deals with saving the report into the database. /// </summary> /// <param name="client"></param> /// <param name="regionName"></param> /// <param name="abuserID"></param> /// <param name="catagory"></param> /// <param name="checkflags"></param> /// <param name="details"></param> /// <param name="objectID"></param> /// <param name="position"></param> /// <param name="reportType"></param> /// <param name="screenshotID"></param> /// <param name="summery"></param> /// <param name="reporter"></param> void UserReport(IClientAPI client, string regionName, UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 position, byte reportType, UUID screenshotID, string summery, UUID reporter) { AbuseReport report = new AbuseReport { ObjectUUID = objectID, ObjectPosition = position.ToString(), Active = true, Checked = false, Notes = "", AssignedTo = "No One", ScreenshotID = screenshotID }; if (objectID != UUID.Zero) { ISceneChildEntity Object = client.Scene.GetSceneObjectPart(objectID); report.ObjectName = Object.Name; } else { report.ObjectName = ""; } string[] detailssplit = details.Split('\n'); string AbuseDetails = detailssplit[detailssplit.Length - 1]; report.AbuseDetails = AbuseDetails; report.ReporterName = client.Name; string[] findRegion = summery.Split('|'); report.RegionName = findRegion[1]; string[] findLocation = summery.Split('('); string[] findLocationend = findLocation[1].Split(')'); report.AbuseLocation = findLocationend[0]; string[] findCategory = summery.Split('['); string[] findCategoryend = findCategory[1].Split(']'); report.Category = findCategoryend[0]; string[] findAbuserName = summery.Split('{'); string[] findAbuserNameend = findAbuserName[1].Split('}'); report.AbuserName = findAbuserNameend[0]; string[] findSummary = summery.Split('\"'); string abuseSummary = findSummary[1]; if (findSummary.Length != 0) { abuseSummary = findSummary[1]; } report.AbuseSummary = abuseSummary; report.Number = (-1); EstateSettings ES = client.Scene.RegionInfo.EstateSettings; //If the abuse email is set up and the email module is available, send the email if (ES.AbuseEmailToEstateOwner && ES.AbuseEmail != "") { IEmailModule Email = m_Scene.RequestModuleInterface <IEmailModule>(); if (Email != null) { string msg = "This abuse report was submitted by " + report.ReporterName + " against " + report.AbuserName + " at " + report.AbuseLocation + " in your region " + report.RegionName + ". Summary: " + report.AbuseSummary + ". Details: " + report.AbuseDetails + "."; Email.SendEmail( UUID.Zero, ES.AbuseEmail, "Abuse Report", msg, client.Scene ); } } //Tell the DB about it IAbuseReports conn = m_Scene.RequestModuleInterface <IAbuseReports>(); if (conn != null) { conn.AddAbuseReport(report); } }
public AbuseReportsHandler(IAbuseReports service) : base("POST", "/abusereport") { m_AbuseReportsService = service; }
public void PostInitialize(IConfigSource config, IRegistryCore registry) { m_AbuseReportsService = registry.RequestModuleInterface <IAbuseReports>(); }
public void PostInitialize(IConfigSource config, IRegistryCore registry) { m_AbuseReportsService = registry.RequestModuleInterface<IAbuseReports>(); }