-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApiLogView.ascx.cs
More file actions
38 lines (35 loc) · 1.1 KB
/
Copy pathApiLogView.ascx.cs
File metadata and controls
38 lines (35 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using DotNetNuke.Abstractions;
using DotNetNuke.Services.Exceptions;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace tjc.Modules.jacs
{
/// <summary>
/// Admin page for searching the api_log table. Requires an admin user —
/// non-admins are redirected to the module's main view.
/// </summary>
public partial class ApiLogView : JACSModuleBase
{
private readonly INavigationManager _navigationManager;
public ApiLogView()
{
_navigationManager = DependencyProvider.GetRequiredService<INavigationManager>();
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
navbar.ModuleContext = this;
navbar.ActiveLink = "lnkApiLog";
if (UserId <= 0 || !UserInfo.IsAdmin)
{
Response.Redirect(_navigationManager.NavigateURL(), true);
}
}
catch (Exception exc)
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
}
}