69e6bb3f949dc30c2caf721eb9b6c71183b19aac
API/CodeSamples/RequireLogin.md
| ... | ... | @@ -0,0 +1,51 @@ |
| 1 | +#RequireLogin |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +Gets or sets whether users are required to go through the login page specified by the [[LoginUrl|/API/CodeSamples/LoginUrl]] setting before accessing the reporting application. A user will be considered logged in when the [[CurrentUserName|/API/CodeSamples/CurrentUserName]] setting has a value other than the default. |
|
| 8 | + |
|
| 9 | +**Default Value:** False |
|
| 10 | + |
|
| 11 | +##Global.asax (C♯) |
|
| 12 | + |
|
| 13 | +```csharp |
|
| 14 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 15 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 16 | +{ |
|
| 17 | + // Configure settings |
|
| 18 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 19 | + public static void InitializeReporting() { |
|
| 20 | + //Check to see if we've already initialized. |
|
| 21 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 22 | + return; |
|
| 23 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 24 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 25 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 26 | + AdHocSettings.RequireLogin = true //The relevant setting |
|
| 27 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 28 | + } |
|
| 29 | +} |
|
| 30 | +``` |
|
| 31 | + |
|
| 32 | +##Global.asax (VB.NET) |
|
| 33 | + |
|
| 34 | +```visualbasic |
|
| 35 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 36 | +Public Class CustomAdHocConfig |
|
| 37 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 38 | + |
|
| 39 | + Shared Sub InitializeReporting() |
|
| 40 | + 'Check to see if we've already initialized |
|
| 41 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 42 | + Return |
|
| 43 | + 'Initialize System |
|
| 44 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 45 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 46 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 47 | + AdHocSettings.RequireLogin = True 'The relevant setting |
|
| 48 | + HttpContext.Current.Session("ReportingInitialized") = True |
|
| 49 | + End Sub |
|
| 50 | +End Class |
|
| 51 | +``` |
|
| ... | ... | \ No newline at end of file |
RequireLogin.md
| ... | ... | @@ -1,51 +0,0 @@ |
| 1 | -#RequireLogin |
|
| 2 | - |
|
| 3 | -[[_TOC_]] |
|
| 4 | - |
|
| 5 | -##About |
|
| 6 | - |
|
| 7 | -Gets or sets whether users are required to go through the login page specified by the [[LoginUrl|/API/CodeSamples/LoginUrl]] setting before accessing the reporting application. A user will be considered logged in when the [[CurrentUserName|/API/CodeSamples/CurrentUserName]] setting has a value other than the default. |
|
| 8 | - |
|
| 9 | -**Default Value:** False |
|
| 10 | - |
|
| 11 | -##Global.asax (C♯) |
|
| 12 | - |
|
| 13 | -```csharp |
|
| 14 | -//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 15 | -public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 16 | -{ |
|
| 17 | - // Configure settings |
|
| 18 | - // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 19 | - public static void InitializeReporting() { |
|
| 20 | - //Check to see if we've already initialized. |
|
| 21 | - if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 22 | - return; |
|
| 23 | - AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 24 | - AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 25 | - Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 26 | - AdHocSettings.RequireLogin = true //The relevant setting |
|
| 27 | - HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 28 | - } |
|
| 29 | -} |
|
| 30 | -``` |
|
| 31 | - |
|
| 32 | -##Global.asax (VB.NET) |
|
| 33 | - |
|
| 34 | -```visualbasic |
|
| 35 | -'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 36 | -Public Class CustomAdHocConfig |
|
| 37 | - Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 38 | - |
|
| 39 | - Shared Sub InitializeReporting() |
|
| 40 | - 'Check to see if we've already initialized |
|
| 41 | - If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 42 | - Return |
|
| 43 | - 'Initialize System |
|
| 44 | - AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 45 | - AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 46 | - Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 47 | - AdHocSettings.RequireLogin = True 'The relevant setting |
|
| 48 | - HttpContext.Current.Session("ReportingInitialized") = True |
|
| 49 | - End Sub |
|
| 50 | -End Class |
|
| 51 | -``` |
|
| ... | ... | \ No newline at end of file |