Add ConfigurationHandler (required by Disco plugin system)
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Services.Plugins;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.WebPages;
|
||||
|
||||
namespace Disco.Plugins.ADCompare.ConfigurationHandler
|
||||
{
|
||||
public class ADCompareConfigurationHandler : PluginConfigurationHandler
|
||||
{
|
||||
public override PluginConfigurationHandlerGetResponse Get(DiscoDataContext Database, Controller controller)
|
||||
{
|
||||
return Response<ConfigurationView>();
|
||||
}
|
||||
|
||||
public override bool Post(DiscoDataContext Database, FormCollection form, Controller controller)
|
||||
{
|
||||
// No configuration to save
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfigurationView : WebViewPage
|
||||
{
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral(@"
|
||||
<div style='padding: 15px;'>
|
||||
<h3>AD Compare Plugin</h3>
|
||||
<p>This plugin compares the <strong>Managed By</strong> field on Active Directory computer objects
|
||||
against the <strong>Assigned User</strong> in Disco ICT, and reports mismatches.</p>
|
||||
<hr />
|
||||
<h4>How It Works</h4>
|
||||
<ul>
|
||||
<li>Loads all active devices from Disco that have a domain computer account</li>
|
||||
<li>Looks up each computer in AD and reads the <code>managedBy</code> attribute</li>
|
||||
<li>Resolves the <code>managedBy</code> Distinguished Name to a <code>DOMAIN\username</code></li>
|
||||
<li>Compares against Disco's <code>AssignedUserId</code></li>
|
||||
<li>Reports mismatches: different users, missing assignments, or empty managedBy</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<p>No configuration is required.</p>
|
||||
<p>
|
||||
<a href='/Plugin/Disco.Plugins.ADCompare' class='btn btn-primary btn-lg'>
|
||||
<i class='fa fa-exchange'></i> Open Comparison Dashboard
|
||||
</a>
|
||||
</p>
|
||||
</div>");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user