mergecommit
This commit is contained in:
commit
aed1199470
81 changed files with 2467 additions and 1113 deletions
|
@ -58,7 +58,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
public const string UserPrincipalName = "UserPrincipalName";
|
||||
public const string GroupType = "GroupType";
|
||||
public const string Name = "Name";
|
||||
public const string ExternalEmail = "mail";
|
||||
public const string ExternalEmail = "mail";
|
||||
public const string CustomAttribute2 = "extensionAttribute2";
|
||||
public const string DistinguishedName = "distinguishedName";
|
||||
|
||||
|
|
|
@ -44,21 +44,31 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
return de;
|
||||
}
|
||||
|
||||
public static string[] GetUsersGroup(string group)
|
||||
public static string[] GetGroupObjects(string group, string objectType)
|
||||
{
|
||||
List<string> rets = new List<string>();
|
||||
return GetGroupObjects(group, objectType, null);
|
||||
}
|
||||
|
||||
public static string[] GetGroupObjects(string group, string objectType, DirectoryEntry entry)
|
||||
{
|
||||
List<string> rets = new List<string>();
|
||||
|
||||
DirectorySearcher deSearch = new DirectorySearcher
|
||||
{
|
||||
Filter =
|
||||
"(&(objectClass=user))"
|
||||
"(&(objectClass=" + objectType + "))"
|
||||
};
|
||||
|
||||
SearchResultCollection srcUsers = deSearch.FindAll();
|
||||
|
||||
foreach (SearchResult srcUser in srcUsers)
|
||||
if (entry != null)
|
||||
{
|
||||
DirectoryEntry de = srcUser.GetDirectoryEntry();
|
||||
deSearch.SearchRoot = entry;
|
||||
}
|
||||
|
||||
SearchResultCollection srcObjects = deSearch.FindAll();
|
||||
|
||||
foreach (SearchResult srcObject in srcObjects)
|
||||
{
|
||||
DirectoryEntry de = srcObject.GetDirectoryEntry();
|
||||
PropertyValueCollection props = de.Properties["memberOf"];
|
||||
|
||||
foreach (string str in props)
|
||||
|
@ -371,20 +381,20 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
newGroupObject.CommitChanges();
|
||||
}
|
||||
|
||||
public static void AddUserToGroup(string userPath, string groupPath)
|
||||
public static void AddObjectToGroup(string objectPath, string groupPath)
|
||||
{
|
||||
DirectoryEntry user = new DirectoryEntry(userPath);
|
||||
DirectoryEntry obj = new DirectoryEntry(objectPath);
|
||||
DirectoryEntry group = new DirectoryEntry(groupPath);
|
||||
|
||||
group.Invoke("Add", user.Path);
|
||||
group.Invoke("Add", obj.Path);
|
||||
}
|
||||
|
||||
public static void RemoveUserFromGroup(string userPath, string groupPath)
|
||||
public static void RemoveObjectFromGroup(string obejctPath, string groupPath)
|
||||
{
|
||||
DirectoryEntry user = new DirectoryEntry(userPath);
|
||||
DirectoryEntry obj = new DirectoryEntry(obejctPath);
|
||||
DirectoryEntry group = new DirectoryEntry(groupPath);
|
||||
|
||||
group.Invoke("Remove", user.Path);
|
||||
group.Invoke("Remove", obj.Path);
|
||||
}
|
||||
|
||||
public static bool AdObjectExists(string path)
|
||||
|
|
|
@ -50,9 +50,9 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes);
|
||||
|
||||
void AddUserToSecurityGroup(string organizationId, string loginName, string groupName);
|
||||
void AddObjectToSecurityGroup(string organizationId, string accountName, string groupName);
|
||||
|
||||
void DeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName);
|
||||
void DeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName);
|
||||
|
||||
void SetUserGeneralSettings(string organizationId, string accountName, string displayName, string password,
|
||||
bool hideFromAddressBook, bool disabled, bool locked, string firstName, string initials,
|
||||
|
@ -66,7 +66,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
void SetUserPassword(string organizationId, string accountName, string password);
|
||||
|
||||
void SetUserPrincipalName(string organizationId, string accountName, string userPrincipalName);
|
||||
|
||||
|
||||
bool OrganizationExists(string organizationId);
|
||||
|
||||
void DeleteOrganizationDomain(string organizationDistinguishedName, string domain);
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
set;
|
||||
}
|
||||
|
||||
public OrganizationUser[] MembersAccounts
|
||||
public ExchangeAccount[] MembersAccounts
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue