Feature #49: Active Directory Managed Groups

Document Template Attachments, Device Batches, Device Profiles and User
Flags can be associated with an Active Directory group. This AD group is
then automatically synchronized with relevant User/Machine accounts.
Contains various other UI tweaks and configuration enhancements.
This commit is contained in:
Gary Sharp
2014-06-16 22:21:31 +10:00
parent ebf78dd08d
commit a819d2722a
119 changed files with 8349 additions and 2373 deletions
+5 -2
View File
@@ -147,11 +147,14 @@ namespace Disco.Web
if (string.IsNullOrWhiteSpace(userId))
return match.Value;
if (string.IsNullOrWhiteSpace(domainId))
userId = string.Concat(ActiveDirectory.Context.PrimaryDomain.NetBiosName, @"\", userId);
userId = ActiveDirectory.ParseDomainAccountId(userId);
else
userId = string.Concat(domainId, userId);
return string.Format("<a href=\"{2}\" title=\"User {1}\">{0}</a>", match.Value, userId, urlHelper.Action(MVC.User.Show(userId)));
if (!ActiveDirectory.IsValidDomainAccountId(userId))
return match.Value;
return string.Format("<a href=\"{2}\" title=\"User {1}\">{0}</a>", match.Value, ActiveDirectory.FriendlyAccountId(userId), urlHelper.Action(MVC.User.Show(userId)));
}
catch (Exception)
{
+6 -7
View File
@@ -12,18 +12,16 @@ namespace Disco.Web.Controllers
{
internal static void T4MVCAddUserIdRouteValues(T4MVC_System_Web_Mvc_ActionResult callInfo, string UserId)
{
var splitId = UserExtensions.SplitUserId(UserId);
var slashIndex = UserId.IndexOf('\\');
if (splitId.Item1 == null)
if (slashIndex < 0)
throw new ArgumentException("The User Id is not in the correct format ({Domain}\\{Id})", "id");
string userDomain;
if (splitId.Item1.Equals(ActiveDirectory.Context.PrimaryDomain.NetBiosName, StringComparison.OrdinalIgnoreCase))
string userDomain = UserId.Substring(0, slashIndex);
if (userDomain.Equals(ActiveDirectory.Context.PrimaryDomain.NetBiosName, StringComparison.OrdinalIgnoreCase))
userDomain = null; // Url doesn't contain Domain if it is the default.
else
userDomain = splitId.Item1;
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", splitId.Item2);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", UserId.Substring(slashIndex + 1));
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Domain", userDomain);
}
@@ -54,6 +52,7 @@ namespace Disco.Web.Areas.API.Controllers
return callInfo;
}
[NonAction]
public virtual ActionResult Attachments(string id)
{