feature: online activation
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
@model Disco.Web.Areas.API.Models.Activation.BeginModel
|
||||
@{
|
||||
Authorization.Require(Claims.DiscoAdminAccount);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "System", MVC.Config.SystemConfig.Index(), "Activate");
|
||||
}
|
||||
|
||||
<div style="min-height: 300px;">
|
||||
<div class="form" style="width: 500px;">
|
||||
<h2><i class="fa fa-lg fa-cog fa-spin"></i> Redirecting to Disco ICT Online Services</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form id="activateRedirect" action="@Model.RedirectUrl" method="post">
|
||||
<input type="hidden" name="ActivationId" value="@Model.ActivationId" />
|
||||
<input type="hidden" name="ChallengeResponse" value="@Model.ChallengeResponse" />
|
||||
<input type="hidden" name="ChallengeResponseIv" value="@Model.ChallengeResponseIv" />
|
||||
</form>
|
||||
<script>
|
||||
$('#activateRedirect').trigger('submit');
|
||||
</script>
|
||||
@@ -0,0 +1,140 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.API.Views.Activation
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/API/Views/Activation/Begin.cshtml")]
|
||||
public partial class Begin : Disco.Services.Web.WebViewPage<Disco.Web.Areas.API.Models.Activation.BeginModel>
|
||||
{
|
||||
public Begin()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\API\Views\Activation\Begin.cshtml"
|
||||
|
||||
Authorization.Require(Claims.DiscoAdminAccount);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "System", MVC.Config.SystemConfig.Index(), "Activate");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n\r\n<div");
|
||||
|
||||
WriteLiteral(" style=\"min-height: 300px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 500px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-lg fa-cog fa-spin\"");
|
||||
|
||||
WriteLiteral("></i> Redirecting to Disco ICT Online Services</h2>\r\n </div>\r\n</div>\r\n\r\n<form");
|
||||
|
||||
WriteLiteral(" id=\"activateRedirect\"");
|
||||
|
||||
WriteAttribute("action", Tuple.Create(" action=\"", 489), Tuple.Create("\"", 516)
|
||||
|
||||
#line 14 "..\..\Areas\API\Views\Activation\Begin.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 498), Tuple.Create<System.Object, System.Int32>(Model.RedirectUrl
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 498), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" method=\"post\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"ActivationId\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 578), Tuple.Create("\"", 605)
|
||||
|
||||
#line 15 "..\..\Areas\API\Views\Activation\Begin.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 586), Tuple.Create<System.Object, System.Int32>(Model.ActivationId
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 586), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"ChallengeResponse\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 660), Tuple.Create("\"", 692)
|
||||
|
||||
#line 16 "..\..\Areas\API\Views\Activation\Begin.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 668), Tuple.Create<System.Object, System.Int32>(Model.ChallengeResponse
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 668), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"ChallengeResponseIv\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 749), Tuple.Create("\"", 783)
|
||||
|
||||
#line 17 "..\..\Areas\API\Views\Activation\Begin.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 757), Tuple.Create<System.Object, System.Int32>(Model.ChallengeResponseIv
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 757), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n</form>\r\n<script>\r\n $(\'#activateRedirect\').trigger(\'submit\');\r\n</script>\r" +
|
||||
"\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,17 @@
|
||||
@model Disco.Web.Areas.API.Models.Activation.CallbackModel
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
</head>
|
||||
<body data-deploymentid="@Model.DeploymentId" data-correlationid="@Model.CorrelationId" data-userid="@Model.UserId">
|
||||
<script>
|
||||
const deploymentId = document.body.dataset.deploymentid;
|
||||
const correlationId = document.body.dataset.correlationid;
|
||||
const userId = document.body.dataset.userid;
|
||||
window.parent.activateCallbackResponse(deploymentId, correlationId, userId);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,107 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.API.Views.Activation
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/API/Views/Activation/_ActivateCallback.cshtml")]
|
||||
public partial class _ActivateCallback : Disco.Services.Web.WebViewPage<Disco.Web.Areas.API.Models.Activation.CallbackModel>
|
||||
{
|
||||
public _ActivateCallback()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\API\Views\Activation\_ActivateCallback.cshtml"
|
||||
|
||||
Layout = null;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<!DOCTYPE html>\r\n<html");
|
||||
|
||||
WriteLiteral(" lang=\"en\"");
|
||||
|
||||
WriteLiteral(">\r\n<head>\r\n</head>\r\n<body");
|
||||
|
||||
WriteLiteral(" data-deploymentid=\"");
|
||||
|
||||
|
||||
#line 9 "..\..\Areas\API\Views\Activation\_ActivateCallback.cshtml"
|
||||
Write(Model.DeploymentId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-correlationid=\"");
|
||||
|
||||
|
||||
#line 9 "..\..\Areas\API\Views\Activation\_ActivateCallback.cshtml"
|
||||
Write(Model.CorrelationId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-userid=\"");
|
||||
|
||||
|
||||
#line 9 "..\..\Areas\API\Views\Activation\_ActivateCallback.cshtml"
|
||||
Write(Model.UserId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<script>
|
||||
const deploymentId = document.body.dataset.deploymentid;
|
||||
const correlationId = document.body.dataset.correlationid;
|
||||
const userId = document.body.dataset.userid;
|
||||
window.parent.activateCallbackResponse(deploymentId, correlationId, userId);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
Reference in New Issue
Block a user