a819d2722a
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.
25 lines
672 B
C#
25 lines
672 B
C#
using Disco.Models.Repository;
|
|
using Disco.Services.Interop.ActiveDirectory;
|
|
using System;
|
|
|
|
namespace Disco.Services
|
|
{
|
|
public static class UserExtensions
|
|
{
|
|
public static bool IsInPrimaryDomain(this User u)
|
|
{
|
|
return u.Domain.Equals(ActiveDirectory.Context.PrimaryDomain.NetBiosName, StringComparison.OrdinalIgnoreCase);
|
|
}
|
|
|
|
public static string ToStringFriendly(this User u)
|
|
{
|
|
return string.Format("{0} ({1})", u.DisplayName, u.FriendlyId());
|
|
}
|
|
|
|
public static string FriendlyId(this User u)
|
|
{
|
|
return ActiveDirectory.FriendlyAccountId(u.UserId);
|
|
}
|
|
}
|
|
}
|