summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-12-25 13:38:24 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-12-25 13:38:24 -0800
commitd17045299da4a44dc41c6c1d5354771d5626c53d (patch)
tree88c9350ae894595e6982617abfe70d928594df0d /src
parent8e048aa059ef211c09c907feeb6b9f3b2bc9fb05 (diff)
downloadDotNetOpenAuth-d17045299da4a44dc41c6c1d5354771d5626c53d.zip
DotNetOpenAuth-d17045299da4a44dc41c6c1d5354771d5626c53d.tar.gz
DotNetOpenAuth-d17045299da4a44dc41c6c1d5354771d5626c53d.tar.bz2
Added a couple more switches for reporting control.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/Configuration/DotNetOpenAuth.xsd2
-rw-r--r--src/DotNetOpenAuth/Configuration/ReportingElement.cs30
-rw-r--r--src/DotNetOpenAuth/Reporting.cs6
3 files changed, 36 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth/Configuration/DotNetOpenAuth.xsd b/src/DotNetOpenAuth/Configuration/DotNetOpenAuth.xsd
index f27e50e..63ad100 100644
--- a/src/DotNetOpenAuth/Configuration/DotNetOpenAuth.xsd
+++ b/src/DotNetOpenAuth/Configuration/DotNetOpenAuth.xsd
@@ -320,6 +320,8 @@
<xs:attribute name="minimumFlushInterval" type="xs:string" />
<xs:attribute name="includeFeatureUsage" type="xs:boolean" default="true" />
<xs:attribute name="includeEventStatistics" type="xs:boolean" default="true" />
+ <xs:attribute name="includeLocalRequestUris" type="xs:boolean" default="true" />
+ <xs:attribute name="includeCultures" type="xs:boolean" default="true" />
</xs:complexType>
</xs:element>
</xs:choice>
diff --git a/src/DotNetOpenAuth/Configuration/ReportingElement.cs b/src/DotNetOpenAuth/Configuration/ReportingElement.cs
index 27a6880..ab1437f 100644
--- a/src/DotNetOpenAuth/Configuration/ReportingElement.cs
+++ b/src/DotNetOpenAuth/Configuration/ReportingElement.cs
@@ -41,6 +41,16 @@ namespace DotNetOpenAuth.Configuration {
private const string IncludeEventStatisticsAttributeName = "includeEventStatistics";
/// <summary>
+ /// The name of the @includeLocalRequestUris attribute.
+ /// </summary>
+ private const string IncludeLocalRequestUrisAttributeName = "includeLocalRequestUris";
+
+ /// <summary>
+ /// The name of the @includeCultures attribute.
+ /// </summary>
+ private const string IncludeCulturesAttributeName = "includeCultures";
+
+ /// <summary>
/// The default value for the @minimumFlushInterval attribute.
/// </summary>
#if DEBUG
@@ -105,5 +115,25 @@ namespace DotNetOpenAuth.Configuration {
get { return (bool)this[IncludeEventStatisticsAttributeName]; }
set { this[IncludeEventStatisticsAttributeName] = value; }
}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to include a few URLs to pages on the hosting
+ /// web site that host DotNetOpenAuth components.
+ /// </summary>
+ [ConfigurationProperty(IncludeLocalRequestUrisAttributeName, DefaultValue = true)]
+ internal bool IncludeLocalRequestUris {
+ get { return (bool)this[IncludeLocalRequestUrisAttributeName]; }
+ set { this[IncludeLocalRequestUrisAttributeName] = value; }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to include the cultures requested by the user agent
+ /// on pages that host DotNetOpenAuth components.
+ /// </summary>
+ [ConfigurationProperty(IncludeCulturesAttributeName, DefaultValue = true)]
+ internal bool IncludeCultures {
+ get { return (bool)this[IncludeCulturesAttributeName]; }
+ set { this[IncludeCulturesAttributeName] = value; }
+ }
}
}
diff --git a/src/DotNetOpenAuth/Reporting.cs b/src/DotNetOpenAuth/Reporting.cs
index 212fe22..5477d8c 100644
--- a/src/DotNetOpenAuth/Reporting.cs
+++ b/src/DotNetOpenAuth/Reporting.cs
@@ -247,9 +247,11 @@ namespace DotNetOpenAuth {
Contract.Requires<ArgumentNullException>(request != null);
if (Enabled) {
- observedCultures.Add(Thread.CurrentThread.CurrentCulture.Name);
+ if (Configuration.IncludeCultures) {
+ observedCultures.Add(Thread.CurrentThread.CurrentCulture.Name);
+ }
- if (!observedRequests.IsFull) {
+ if (Configuration.IncludeLocalRequestUris && !observedRequests.IsFull) {
var requestBuilder = new UriBuilder(request.UrlBeforeRewriting);
requestBuilder.Query = null;
requestBuilder.Fragment = null;