feature: online activation
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Interop.DiscoServices;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web.Areas.Config.Models.SystemConfig;
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
@@ -9,8 +12,27 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
[DiscoAuthorize(Claims.Config.System.Show), HttpGet]
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
var m = Models.SystemConfig.IndexModel.FromConfiguration(Database.DiscoConfiguration);
|
||||
var m = IndexModel.FromConfiguration(Database.DiscoConfiguration);
|
||||
return View(m);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.DiscoAdminAccount), HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult Activate()
|
||||
{
|
||||
if (Database.DiscoConfiguration.IsActivated)
|
||||
return RedirectToAction(MVC.Config.SystemConfig.Index());
|
||||
|
||||
var service = new ActivationService(Database);
|
||||
|
||||
var model = new ActivateModel()
|
||||
{
|
||||
CallbackUrl = service.GetCallbackUrl(),
|
||||
DeploymentId = Guid.Parse(Database.DiscoConfiguration.DeploymentId),
|
||||
CorrelationId = Guid.NewGuid(),
|
||||
UserId = CurrentUser.UserId,
|
||||
};
|
||||
|
||||
return View(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user