Fixed: Child account packages not suspending resulting in child services not
being suspended with the parent. Fixed: Child account peer users were not being suspended when the parent is suspended.
This commit is contained in:
parent
56ec2b3b20
commit
aef44beb22
1 changed files with 22 additions and 12 deletions
|
@ -678,6 +678,12 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
TaskManager.StartTask(taskId, "USER", "CHANGE_STATUS", user.Username);
|
TaskManager.StartTask(taskId, "USER", "CHANGE_STATUS", user.Username);
|
||||||
TaskManager.ItemId = user.UserId;
|
TaskManager.ItemId = user.UserId;
|
||||||
|
|
||||||
|
// update user packages
|
||||||
|
List<PackageInfo> packages = new List<PackageInfo>();
|
||||||
|
|
||||||
|
// Add the users package(s)
|
||||||
|
packages.AddRange(PackageController.GetPackages(userId));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -699,20 +705,24 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
List<UserInfo> children = GetUsers(userId, true);
|
List<UserInfo> children = GetUsers(userId, true);
|
||||||
foreach (UserInfo child in children)
|
foreach (UserInfo child in children)
|
||||||
{
|
{
|
||||||
result = ChangeUserStatusInternal(child.UserId, status);
|
// Add the child users packages
|
||||||
if (result < 0)
|
packages.AddRange(PackageController.GetPackages(child.UserId));
|
||||||
return result;
|
|
||||||
|
// change child user peers
|
||||||
|
List<UserInfo> childPeers = GetUserPeers(child.UserId);
|
||||||
|
foreach (UserInfo peer in childPeers)
|
||||||
|
{
|
||||||
|
result = ChangeUserStatusInternal(peer.UserId, status);
|
||||||
|
if (result < 0)
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// change child account
|
||||||
|
result = ChangeUserStatusInternal(child.UserId, status);
|
||||||
|
if (result < 0)
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// update user packages
|
|
||||||
List<PackageInfo> packages = new List<PackageInfo>();
|
|
||||||
|
|
||||||
// his packages
|
|
||||||
packages.AddRange(PackageController.GetMyPackages(userId));
|
|
||||||
|
|
||||||
// children packages
|
|
||||||
packages.AddRange(PackageController.GetPackages(userId));
|
|
||||||
|
|
||||||
PackageStatus packageStatus = PackageStatus.Active;
|
PackageStatus packageStatus = PackageStatus.Active;
|
||||||
switch (status)
|
switch (status)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue