Added new sharepoint service item
This commit is contained in:
parent
2e1f2dfaa4
commit
8a868a4ea8
42 changed files with 1354 additions and 93 deletions
|
@ -963,7 +963,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
||||
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, org.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
||||
stats.CreatedSharePointSiteCollections = sharePointStats.TotalRowCount;
|
||||
|
@ -1044,11 +1044,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
||||
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, o.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
||||
stats.CreatedSharePointSiteCollections += sharePointStats.TotalRowCount;
|
||||
}
|
||||
}
|
||||
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedCRM))
|
||||
{
|
||||
|
@ -1112,7 +1112,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
stats.AllocatedDomains = cntx.Quotas[Quotas.ORGANIZATION_DOMAINS].QuotaAllocatedValue;
|
||||
stats.AllocatedGroups = cntx.Quotas[Quotas.ORGANIZATION_SECURITYGROUPS].QuotaAllocatedValue;
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
stats.AllocatedSharePointSiteCollections = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_SITES].QuotaAllocatedValue;
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
|
|||
|
||||
private static int GetHostedSharePointServiceId(int packageId)
|
||||
{
|
||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedSharePoint);
|
||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ using WebsitePanel.Providers.HostedSolution;
|
|||
using WebsitePanel.Providers.OS;
|
||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||
using WebsitePanel.Providers.Web;
|
||||
using System.Net.Mail;
|
||||
using System.Collections;
|
||||
|
||||
namespace WebsitePanel.EnterpriseServer
|
||||
{
|
||||
|
@ -308,6 +310,91 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return ObjectUtils.CreateListFromDataSet<ServiceInfo>(DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, ResourceGroups.RDS));
|
||||
}
|
||||
|
||||
public static string GetRdsSetupLetter(int itemId, int? accountId)
|
||||
{
|
||||
return GetRdsSetupLetterInternal(itemId, accountId);
|
||||
}
|
||||
|
||||
public static int SendRdsSetupLetter(int itemId, int? accountId, string to, string cc)
|
||||
{
|
||||
return SendRdsSetupLetterInternal(itemId, accountId, to, cc);
|
||||
}
|
||||
|
||||
private static string GetRdsSetupLetterInternal(int itemId, int? accountId)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
UserInfo user = PackageController.GetPackageOwner(org.PackageId);
|
||||
UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.RDS_SETUP_LETTER);
|
||||
string settingName = user.HtmlMail ? "HtmlBody" : "TextBody";
|
||||
string body = settings[settingName];
|
||||
|
||||
if (String.IsNullOrEmpty(body))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string result = EvaluateMailboxTemplate(body, org, accountId, itemId);
|
||||
|
||||
return user.HtmlMail ? result : result.Replace("\n", "<br/>");
|
||||
}
|
||||
|
||||
private static int SendRdsSetupLetterInternal(int itemId, int? accountId, string to, string cc)
|
||||
{
|
||||
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo);
|
||||
|
||||
if (accountCheck < 0)
|
||||
{
|
||||
return accountCheck;
|
||||
}
|
||||
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
UserInfo user = PackageController.GetPackageOwner(org.PackageId);
|
||||
UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.RDS_SETUP_LETTER);
|
||||
string from = settings["From"];
|
||||
|
||||
if (cc == null)
|
||||
{
|
||||
cc = settings["CC"];
|
||||
}
|
||||
|
||||
string subject = settings["Subject"];
|
||||
string body = user.HtmlMail ? settings["HtmlBody"] : settings["TextBody"];
|
||||
bool isHtml = user.HtmlMail;
|
||||
MailPriority priority = MailPriority.Normal;
|
||||
|
||||
if (!String.IsNullOrEmpty(settings["Priority"]))
|
||||
{
|
||||
priority = (MailPriority)Enum.Parse(typeof(MailPriority), settings["Priority"], true);
|
||||
}
|
||||
|
||||
if (String.IsNullOrEmpty(body))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (to == null)
|
||||
{
|
||||
to = user.Email;
|
||||
}
|
||||
|
||||
subject = EvaluateMailboxTemplate(subject, org, accountId, itemId);
|
||||
body = EvaluateMailboxTemplate(body, org, accountId, itemId);
|
||||
|
||||
return MailHelper.SendMessage(from, to, cc, subject, body, priority, isHtml);
|
||||
}
|
||||
|
||||
private static ResultObject InstallSessionHostsCertificateInternal(RdsServer rdsServer)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "INSTALL_CERTIFICATE");
|
||||
|
@ -1842,5 +1929,25 @@ namespace WebsitePanel.EnterpriseServer
|
|||
{
|
||||
return string.Format("{0}-{1}", organizationId, displayName.Replace(" ", "_"));
|
||||
}
|
||||
|
||||
private static string EvaluateMailboxTemplate(string template, Organization org, int? accountId, int itemId)
|
||||
{
|
||||
OrganizationUser user = null;
|
||||
|
||||
if (accountId.HasValue)
|
||||
{
|
||||
user = OrganizationController.GetAccount(itemId, accountId.Value);
|
||||
}
|
||||
|
||||
Hashtable items = new Hashtable();
|
||||
items["Organization"] = org;
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
items["account"] = user;
|
||||
}
|
||||
|
||||
return PackageController.EvaluateTemplate(template, items);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
SharePointSiteDiskSpace[] sharePointSiteDiskSpaces =
|
||||
HostedSharePointServerController.CalculateSharePointSitesDiskSpace(org.Id, out res);
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
|
|||
// Log operation.
|
||||
TaskManager.StartTask("HOSTEDSHAREPOINT", "GET_LANGUAGES");
|
||||
|
||||
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedSharePoint);
|
||||
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer);
|
||||
if (serviceId == 0)
|
||||
{
|
||||
return new int[] { };
|
||||
|
@ -236,7 +236,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
|
|||
}
|
||||
|
||||
// Check if stats resource is available
|
||||
int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.HostedSharePoint);
|
||||
int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.SharepointFoundationServer);
|
||||
if (serviceId == 0)
|
||||
{
|
||||
return BusinessErrorCodes.ERROR_SHAREPOINT_RESOURCE_UNAVAILABLE;
|
||||
|
@ -790,7 +790,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
|
|||
|
||||
private static int GetHostedSharePointServiceId(int packageId)
|
||||
{
|
||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedSharePoint);
|
||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer);
|
||||
}
|
||||
|
||||
private static List<SharePointSiteCollection> GetOrganizationSharePointSiteCollections(int orgId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue