initial commit
This commit is contained in:
43
App_Code/Controller/PageController.cs
Normal file
43
App_Code/Controller/PageController.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Library.Models;
|
||||
|
||||
namespace Library;
|
||||
|
||||
public class PageController : AbstractController
|
||||
{
|
||||
protected PageController( ILogger logger , IConfiguration configuration )
|
||||
: base( logger , configuration )
|
||||
{
|
||||
}
|
||||
|
||||
protected IActionResult View( BasePageModel page_model )
|
||||
{
|
||||
page_model.UserData = GetUserData( );
|
||||
return base.View( page_model );
|
||||
}
|
||||
|
||||
protected IActionResult View( string view_name , BasePageModel page_model)
|
||||
{
|
||||
page_model.UserData = GetUserData( );
|
||||
return base.View( view_name , page_model );
|
||||
}
|
||||
|
||||
protected override void OnInvalidLogin( )
|
||||
{
|
||||
throw new ErrorException( "Access denied." );
|
||||
}
|
||||
|
||||
protected override void OnInvalidAdminLogin( )
|
||||
{
|
||||
throw new ErrorException( "Access denied." );
|
||||
}
|
||||
|
||||
protected IActionResult RawText( string text )
|
||||
{
|
||||
return new ContentResult( )
|
||||
{
|
||||
ContentType = System.Net.Mime.MediaTypeNames.Text.Plain ,
|
||||
Content = text
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user