This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Net.Mail; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
using Atlassian.Jira; | |
using JiraInterface.Models; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult Create() | |
{ | |
return View(); | |
} | |
[HttpPost] | |
public ActionResult Create(Issue issue) | |
{ | |
try | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PM> Install-Package Twitter.Bootstrap.MVC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web; | |
using System.Web.Optimization; | |
namespace JiraInterface | |
{ | |
public class BundleConfig | |
{ | |
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725 | |
public static void RegisterBundles(BundleCollection bundles) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Scripts.Render("~/bundles/jquery") | |
@Scripts.Render("~/bundles/bootstrapper") | |
@RenderSection("scripts", required: false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<JiraCredentials> | |
<Url>JIRA_URL</Url> | |
<User>USERNAME</User> | |
<Password>PASSWORD</Password> | |
<MailFrom>MAILFROM_ADDRESS</MailFrom> | |
<MailTo>MAILTO_ADDRESS</MailTo> | |
</JiraCredentials> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Security; | |
using Umbraco.Core; | |
namespace UmbracoMVCDemo.BackEnd.Helpers | |
{ | |
public class UmbracoAuthorizeAttribute : AuthorizeAttribute | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override bool AuthorizeCore(HttpContextBase httpContext) | |
{ | |
if (httpContext == null) | |
{ | |
throw new ArgumentNullException("httpContext"); | |
} | |
try | |
{ | |
failedAuthentication = !umbraco.BasePages.BasePage.ValidateUserContextID(umbraco.BasePages.BasePage.umbracoUserContextID); | |
return !failedAuthentication; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void OnAuthorization(AuthorizationContext filterContext) | |
{ | |
base.OnAuthorization(filterContext); | |
if(failedAuthentication) | |
FormsAuthentication.RedirectToLoginPage(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UmbracoMVCDemo.BackEnd.Controllers | |
{ | |
[PluginController("Demo")] | |
[UmbracoAuthorize] | |
public class DemoAdminSurfaceController : SurfaceController | |
{ | |
public DemoAdminSurfaceController() | |
{ | |