merge commit
This commit is contained in:
commit
e00be20ab0
46 changed files with 5521 additions and 825 deletions
|
@ -61,6 +61,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
public const string ExternalEmail = "mail";
|
||||
public const string CustomAttribute2 = "extensionAttribute2";
|
||||
public const string DistinguishedName = "distinguishedName";
|
||||
public const string ManagedBy = "ManagedBy";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,35 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
return de;
|
||||
}
|
||||
|
||||
public static string[] GetUsersGroup(string group)
|
||||
{
|
||||
List<string> rets = new List<string>();
|
||||
|
||||
DirectorySearcher deSearch = new DirectorySearcher
|
||||
{
|
||||
Filter =
|
||||
("(&(objectClass=user))")
|
||||
};
|
||||
|
||||
SearchResultCollection srcUsers = deSearch.FindAll();
|
||||
|
||||
foreach (SearchResult srcUser in srcUsers)
|
||||
{
|
||||
DirectoryEntry de = srcUser.GetDirectoryEntry();
|
||||
PropertyValueCollection props = de.Properties["memberOf"];
|
||||
|
||||
foreach (string str in props)
|
||||
{
|
||||
if (str.IndexOf(group) != -1)
|
||||
{
|
||||
rets.Add(de.Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rets.ToArray();
|
||||
}
|
||||
|
||||
public static bool IsUserInGroup(string samAccountName, string group)
|
||||
{
|
||||
bool res = false;
|
||||
|
@ -328,6 +357,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
newGroupObject.Properties[ADAttributes.SAMAccountName].Add(group);
|
||||
|
||||
newGroupObject.Properties[ADAttributes.GroupType].Add(-2147483640);
|
||||
|
||||
newGroupObject.CommitChanges();
|
||||
}
|
||||
|
||||
|
@ -339,6 +369,14 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
group.Invoke("Add", user.Path);
|
||||
}
|
||||
|
||||
public static void RemoveUserFromGroup(string userPath, string groupPath)
|
||||
{
|
||||
DirectoryEntry user = new DirectoryEntry(userPath);
|
||||
DirectoryEntry group = new DirectoryEntry(groupPath);
|
||||
|
||||
group.Invoke("Remove", user.Path);
|
||||
}
|
||||
|
||||
public static bool AdObjectExists(string path)
|
||||
{
|
||||
return DirectoryEntry.Exists(path);
|
||||
|
|
|
@ -37,7 +37,9 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
PublicFolder = 4,
|
||||
Room = 5,
|
||||
Equipment = 6,
|
||||
User = 7
|
||||
User = 7,
|
||||
SecurityGroup = 8,
|
||||
DefaultSecurityGroup = 9
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,6 +42,16 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
OrganizationUser GetUserGeneralSettings(string loginName, string organizationId);
|
||||
|
||||
int CreateSecurityGroup(string organizationId, string groupName, string managedBy);
|
||||
|
||||
OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId);
|
||||
|
||||
void DeleteSecurityGroup(string groupName, string organizationId);
|
||||
|
||||
void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string managedBy, string[] memberAccounts, string notes);
|
||||
|
||||
void AddUserToSecurityGroup(string organizationId, string loginName, string groupName);
|
||||
|
||||
void SetUserGeneralSettings(string organizationId, string accountName, string displayName, string password,
|
||||
bool hideFromAddressBook, bool disabled, bool locked, string firstName, string initials,
|
||||
string lastName,
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WebsitePanel.Providers.HostedSolution
|
||||
{
|
||||
public class OrganizationSecurityGroup
|
||||
{
|
||||
public string DisplayName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string AccountName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public OrganizationUser[] MembersAccounts
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public OrganizationUser ManagerAccount
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string Notes
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string SAMAccountName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool IsDefault
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -103,6 +103,7 @@
|
|||
<Compile Include="HostedSolution\LyncUserPlanType.cs" />
|
||||
<Compile Include="HostedSolution\LyncUsersPaged.cs" />
|
||||
<Compile Include="HostedSolution\LyncVoicePolicyType.cs" />
|
||||
<Compile Include="HostedSolution\OrganizationSecurityGroup.cs" />
|
||||
<Compile Include="HostedSolution\TransactionAction.cs" />
|
||||
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
|
||||
<Compile Include="ResultObjects\HeliconApe.cs" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue