Merge of latest revision

This commit is contained in:
VoosW 2012-11-01 11:03:10 +01:00
commit 2eea4614ce
33 changed files with 592 additions and 54 deletions

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
// Runtime Version:4.0.30319.18010
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View file

@ -6416,3 +6416,11 @@ exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @PackageID int, @Fil
RETURN
GO
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [ParameterID] = 'LYNC_REPORT')
BEGIN
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'LYNC_REPORT', N'Boolean', N'true', 5)
END
GO

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
// Runtime Version:4.0.30319.18010
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.

View file

@ -1,7 +1,7 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.17929
' Runtime Version:4.0.30319.18010
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.

View file

@ -431,7 +431,12 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
}
public static LyncUsersPagedResult GetLyncUsers(int itemId, string sortColumn, string sortDirection, int startRow, int count)
public static LyncUsersPagedResult GetLyncUsers(int itemId)
{
return GetLyncUsersPaged(itemId, string.Empty, string.Empty, 0, int.MaxValue);
}
public static LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int count)
{
LyncUsersPagedResult res = TaskManager.StartResultTask<LyncUsersPagedResult>("LYNC", "GET_LYNC_USERS");

View file

@ -517,7 +517,7 @@ namespace WebsitePanel.EnterpriseServer
try
{
LyncUsersPagedResult res = LyncController.GetLyncUsers(itemId, string.Empty, string.Empty, 0, int.MaxValue);
LyncUsersPagedResult res = LyncController.GetLyncUsers(itemId);
if (res.IsSuccess)
{

View file

@ -125,6 +125,20 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
item.TotalCRMUsers = crmOrganizationStatistics.Count;
}
if (report.LyncReport != null)
{
List<LyncUserStatistics> lyncOrganizationStatistics =
report.LyncReport.Items.FindAll(
delegate(LyncUserStatistics stats) { return stats.OrganizationID == org.OrganizationId; });
foreach (LyncUserStatistics current in lyncOrganizationStatistics)
{
if (current.EnterpriseVoice) item.TotalLyncEVUsers++;
}
item.TotalLyncUsers = lyncOrganizationStatistics.Count;
}
report.OrganizationReport.Items.Add(item);
}
@ -309,6 +323,19 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
TaskManager.WriteError(ex);
}
}
if (report.LyncReport != null)
{
try
{
PopulateLyncReportItems(org, report, topReseller);
}
catch (Exception ex)
{
TaskManager.WriteError(ex);
}
}
}
private static int GetExchangeServiceID(int packageId)
@ -316,6 +343,10 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
return PackageController.GetPackageServiceId(packageId, ResourceGroups.Exchange);
}
private static int GetLyncServiceID(int packageId)
{
return PackageController.GetPackageServiceId(packageId, ResourceGroups.Lync);
}
private static void PopulateSharePointItem(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller)
@ -422,6 +453,12 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
{
PopulateBaseItem(stats, org, topReseller);
stats.MailboxType = mailbox.AccountType;
if (mailbox.AccountType == ExchangeAccountType.Mailbox)
{
ExchangeAccount a = ExchangeServerController.GetAccount(mailbox.ItemId, mailbox.AccountId);
stats.MailboxPlan = a.MailboxPlan;
}
stats.BlackberryEnabled = BlackBerryController.CheckBlackBerryUserExists(mailbox.AccountId);
report.ExchangeReport.Items.Add(stats);
@ -436,6 +473,74 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
}
private static void PopulateLyncReportItems(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller)
{
//Check if lync organization
if (string.IsNullOrEmpty(org.LyncTenantId))
return;
LyncUser[] lyncUsers = null;
try
{
LyncUsersPagedResult res = LyncController.GetLyncUsers(org.Id);
if (res.IsSuccess) lyncUsers = res.Value.PageUsers;
}
catch (Exception ex)
{
throw new ApplicationException(
string.Format("Could not get lync users for current organization {0}", org.Id), ex);
}
if (lyncUsers == null)
return;
foreach (LyncUser lyncUser in lyncUsers)
{
try
{
LyncUserStatistics stats = new LyncUserStatistics();
try
{
stats.SipAddress = lyncUser.PrimaryEmailAddress;
if (string.IsNullOrEmpty(lyncUser.LineUri)) stats.PhoneNumber = string.Empty; else stats.PhoneNumber = lyncUser.LineUri;
LyncUserPlan plan = LyncController.GetLyncUserPlan(org.Id, lyncUser.LyncUserPlanId);
stats.Conferencing = plan.Conferencing;
stats.EnterpriseVoice = plan.EnterpriseVoice;
stats.Federation = plan.Federation;
stats.InstantMessaing = plan.IM;
stats.MobileAccess = plan.Mobility;
stats.LyncUserPlan = plan.LyncUserPlanName;
}
catch (Exception ex)
{
TaskManager.WriteError(ex, "Could not get lync statistics. AccountName: {0}",
lyncUser.DisplayName);
}
if (stats != null)
{
PopulateBaseItem(stats, org, topReseller);
report.LyncReport.Items.Add(stats);
}
}
catch (Exception ex)
{
TaskManager.WriteError(ex);
}
}
}
private static void PopulateSpaceData(int packageId, EnterpriseSolutionStatisticsReport report, string topReseller)
{
List<Organization> organizations;
@ -490,7 +595,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
}
private static void GetUsersData(EnterpriseSolutionStatisticsReport report, int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport, string topReseller)
private static void GetUsersData(EnterpriseSolutionStatisticsReport report, int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport, bool generateLyncReport, string topReseller)
{
List<UserInfo> users;
try
@ -514,6 +619,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
GetUsersData(report, user.UserId, generateExchangeReport, generateSharePointReport,
generateCRMReport,
generateOrganizationReport,
generateLyncReport,
string.IsNullOrEmpty(topReseller) ? user.Username : topReseller);
}
}
@ -524,7 +630,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
}
}
public static EnterpriseSolutionStatisticsReport GetEnterpriseSolutionStatisticsReport(int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport)
public static EnterpriseSolutionStatisticsReport GetEnterpriseSolutionStatisticsReport(int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport, bool generateLyncReport)
{
EnterpriseSolutionStatisticsReport report = new EnterpriseSolutionStatisticsReport();
@ -534,17 +640,20 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
if (generateSharePointReport || generateOrganizationReport)
report.SharePointReport = new SharePointStatisticsReport();
if (generateLyncReport || generateOrganizationReport)
report.LyncReport = new LyncStatisticsReport();
if (generateCRMReport || generateOrganizationReport)
report.CRMReport = new CRMStatisticsReport();
if (generateOrganizationReport)
report.OrganizationReport = new OrganizationStatisticsReport();
try
{
GetUsersData(report, userId, generateExchangeReport, generateSharePointReport, generateCRMReport,
generateOrganizationReport, null);
generateOrganizationReport, generateLyncReport, null);
}
catch(Exception ex)
{

View file

@ -42,6 +42,7 @@ namespace WebsitePanel.EnterpriseServer
private static readonly string EXCHANGE_REPORT = "EXCHANGE_REPORT";
private static readonly string ORGANIZATION_REPORT = "ORGANIZATION_REPORT";
private static readonly string SHAREPOINT_REPORT = "SHAREPOINT_REPORT";
private static readonly string LYNC_REPORT = "LYNC_REPORT";
private static readonly string CRM_REPORT = "CRM_REPORT";
private static readonly string EMAIL = "EMAIL";
@ -52,6 +53,7 @@ namespace WebsitePanel.EnterpriseServer
{
bool isExchange = Utils.ParseBool(TaskManager.TaskParameters[EXCHANGE_REPORT], false);
bool isSharePoint = Utils.ParseBool(TaskManager.TaskParameters[SHAREPOINT_REPORT], false);
bool isLync = Utils.ParseBool(TaskManager.TaskParameters[LYNC_REPORT], false);
bool isCRM = Utils.ParseBool(TaskManager.TaskParameters[CRM_REPORT], false);
bool isOrganization = Utils.ParseBool(TaskManager.TaskParameters[ORGANIZATION_REPORT], false);
@ -61,13 +63,14 @@ namespace WebsitePanel.EnterpriseServer
UserInfo user = PackageController.GetPackageOwner(TaskManager.PackageId);
EnterpriseSolutionStatisticsReport report =
ReportController.GetEnterpriseSolutionStatisticsReport(user.UserId, isExchange, isSharePoint, isCRM,
isOrganization);
isOrganization, isLync);
SendMessage(user, email, isExchange && report.ExchangeReport != null ? report.ExchangeReport.ToCSV() : string.Empty,
isSharePoint && report.SharePointReport != null ? report.SharePointReport.ToCSV() : string.Empty,
isCRM && report.CRMReport != null ? report.CRMReport.ToCSV() : string.Empty,
isOrganization && report.OrganizationReport != null ? report.OrganizationReport.ToCSV() : string.Empty);
isOrganization && report.OrganizationReport != null ? report.OrganizationReport.ToCSV() : string.Empty,
isLync && report.LyncReport != null ? report.LyncReport.ToCSV() : string.Empty);
}
catch(Exception ex)
{
@ -90,11 +93,12 @@ namespace WebsitePanel.EnterpriseServer
}
}
private void SendMessage(UserInfo user,string email, string exchange_csv, string sharepoint_csv, string crm_csv, string organization_csv)
private void SendMessage(UserInfo user,string email, string exchange_csv, string sharepoint_csv, string crm_csv, string organization_csv, string lync_csv)
{
List<Attachment> attacments = new List<Attachment>();
PrepareAttament("exchange.csv", exchange_csv, attacments);
PrepareAttament("sharepoint.csv", sharepoint_csv, attacments);
PrepareAttament("lync.csv", lync_csv, attacments);
PrepareAttament("crm.csv", crm_csv, attacments);
PrepareAttament("organization.csv", organization_csv, attacments);

View file

@ -29,6 +29,7 @@
using System;
using System.IO;
using System.Data;
using System.Linq;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Text;
@ -1213,6 +1214,17 @@ namespace WebsitePanel.EnterpriseServer
DNSServer dns = new DNSServer();
ServiceProviderProxy.Init(dns, zone.ServiceId);
DnsRecord[] domainRecords = dns.GetZoneRecords(zone.Name);
var duplicateRecords = (from zoneRecord in domainRecords
from resRecord in resourceRecords
where zoneRecord.RecordName == resRecord.RecordName
where zoneRecord.RecordType == resRecord.RecordType
select zoneRecord).ToArray();
if (duplicateRecords != null && duplicateRecords.Count() > 0)
{
dns.DeleteZoneRecords(zone.Name, duplicateRecords);
}
// add new resource records
dns.AddZoneRecords(zone.Name, resourceRecords.ToArray());
}
@ -2478,7 +2490,7 @@ namespace WebsitePanel.EnterpriseServer
WebServer server = GetWebServer(item.ServiceId);
StringDictionary webSettings = ServerController.GetServiceSettings(item.ServiceId);
if (webSettings["WmSvc.NETBIOS"] != null)
if (!String.IsNullOrEmpty(webSettings["WmSvc.NETBIOS"]))
{
accountName = webSettings["WmSvc.NETBIOS"].ToString() + "\\" + accountName;
}
@ -3246,7 +3258,7 @@ namespace WebsitePanel.EnterpriseServer
WebServer server = GetWebServer(item.ServiceId);
StringDictionary webSettings = ServerController.GetServiceSettings(item.ServiceId);
if (webSettings["WmSvc.NETBIOS"] != null)
if (!String.IsNullOrEmpty(webSettings["WmSvc.NETBIOS"]))
{
accountName = webSettings["WmSvc.NETBIOS"].ToString() + "\\" + accountName;
}
@ -3716,6 +3728,7 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and
DomainInfo newDomain = new DomainInfo();
newDomain.DomainName = b.Host.ToLower();
newDomain.PackageId = domain.PackageId;
newDomain.IsDomainPointer = true;
int newDomainID = ServerController.AddDomain(newDomain, domain.IsInstantAlias, false);
if (newDomainID > 0)
@ -3726,7 +3739,6 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and
newDomain.WebSiteId = siteId;
newDomain.ZoneItemId = domain.ZoneItemId;
newDomain.DomainItemId = domain.DomainId;
newDomain.IsDomainPointer = true;
ServerController.UpdateDomain(newDomain);
}
}
@ -3760,19 +3772,21 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and
private static int FindDomainForHeader(string header, List<DomainInfo> domains)
{
int domainId = 0;
while (header.IndexOf(".") != -1)
int counter = 0;
while ((header.IndexOf(".") != -1) & (counter < 2))
{
header = header.Substring(header.IndexOf(".") + 1);
foreach (DomainInfo d in domains)
{
if ((header == d.DomainName.ToLower()) && (!d.IsDomainPointer))
{
domainId = d.DomainId;
break;
return d.DomainId;
}
}
header = header.Substring(header.IndexOf(".") + 1);
counter++;
}
return domainId;

View file

@ -434,7 +434,7 @@
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<UseIIS>False</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>9002</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>

View file

@ -59,7 +59,7 @@ namespace WebsitePanel.EnterpriseServer
[WebMethod]
public LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows)
{
return LyncController.GetLyncUsers(itemId, sortColumn, sortDirection, startRow, maximumRows);
return LyncController.GetLyncUsersPaged(itemId, sortColumn, sortDirection, startRow, maximumRows);
}
[WebMethod]

View file

@ -34,6 +34,6 @@
public SharePointStatisticsReport SharePointReport { get; set; }
public CRMStatisticsReport CRMReport { get; set; }
public OrganizationStatisticsReport OrganizationReport { get; set; }
public LyncStatisticsReport LyncReport { get; set; }
}
}

View file

@ -50,5 +50,6 @@ namespace WebsitePanel.Providers.HostedSolution
public bool Enabled { get; set; }
public ExchangeAccountType MailboxType { get; set; }
public bool BlackberryEnabled { get; set; }
public string MailboxPlan { get; set; }
}
}

View file

@ -67,6 +67,7 @@ namespace WebsitePanel.Providers.HostedSolution
sb.AppendFormat("{0},", ToCsvString(item.Enabled, "Enabled", "Disabled"));
sb.AppendFormat("{0},", ToCsvString(item.MailboxType));
sb.AppendFormat("{0}", ToCsvString(item.BlackberryEnabled));
sb.AppendFormat("{0}", ToCsvString(item.MailboxPlan));
mainBuilder.Append(sb.ToString());
}
return mainBuilder.ToString();
@ -74,7 +75,7 @@ namespace WebsitePanel.Providers.HostedSolution
private void AddCSVHeader(StringBuilder sb)
{
sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Mailbox Display Name,Account Created,Primary E-mail Address,MAPI,OWA,ActiveSync,POP 3,IMAP,Mailbox Size (Mb),Max Mailbox Size (Mb),Last Logon,Enabled,Mailbox Type, BlackBerry");
sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Organization Created,Organization ID,Mailbox Display Name,Account Created,Primary E-mail Address,MAPI,OWA,ActiveSync,POP 3,IMAP,Mailbox Size (Mb),Max Mailbox Size (Mb),Last Logon,Enabled,Mailbox Type, BlackBerry, Mailbox Plan");
}
}
}

View file

@ -0,0 +1,72 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.HostedSolution
{
public class LyncOrganizationStatistics
{
private int allocatedLyncUsers;
private int createdLyncUsers;
private int allocatedLyncEVUsers;
private int createdLyncEVUsers;
public int AllocatedLyncUsers
{
get { return this.allocatedLyncUsers; }
set { this.allocatedLyncUsers = value; }
}
public int CreatedLyncUsers
{
get { return this.createdLyncUsers; }
set { this.createdLyncUsers = value; }
}
public int AllocatedLyncEVUsers
{
get { return this.allocatedLyncEVUsers; }
set { this.allocatedLyncEVUsers = value; }
}
public int CreatedLyncEVUsers
{
get { return this.createdLyncEVUsers; }
set { this.createdLyncEVUsers = value; }
}
}
}

View file

@ -0,0 +1,78 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System.Text;
namespace WebsitePanel.Providers.HostedSolution
{
public class LyncStatisticsReport : BaseReport<LyncUserStatistics>
{
public override string ToCSV()
{
StringBuilder mainBuilder = new StringBuilder();
StringBuilder sb = null;
AddCSVHeader(mainBuilder);
foreach (LyncUserStatistics item in Items)
{
sb = new StringBuilder();
sb.Append("\n");
sb.AppendFormat("{0},", ToCsvString(item.TopResellerName));
sb.AppendFormat("{0},", ToCsvString(item.ResellerName));
sb.AppendFormat("{0},", ToCsvString(item.CustomerName));
sb.AppendFormat("{0},", ToCsvString(item.CustomerCreated));
sb.AppendFormat("{0},", ToCsvString(item.HostingSpace));
sb.AppendFormat("{0},", ToCsvString(item.HostingSpaceCreated));
sb.AppendFormat("{0},", ToCsvString(item.OrganizationName));
sb.AppendFormat("{0},", ToCsvString(item.OrganizationCreated));
sb.AppendFormat("{0},", ToCsvString(item.OrganizationID));
sb.AppendFormat("{0},", ToCsvString(item.DisplayName));
sb.AppendFormat("{0},", ToCsvString(item.AccountCreated));
sb.AppendFormat("{0},", ToCsvString(item.SipAddress));
sb.AppendFormat("{0},", ToCsvString(item.PhoneNumber));
sb.AppendFormat("{0},", ToCsvString(item.Conferencing));
sb.AppendFormat("{0},", ToCsvString(item.EnterpriseVoice));
sb.AppendFormat("{0},", ToCsvString(item.Federation));
sb.AppendFormat("{0},", ToCsvString(item.InstantMessaing));
sb.AppendFormat("{0},", ToCsvString(item.MobileAccess));
sb.AppendFormat("{0},", ToCsvString(item.LyncUserPlan));
mainBuilder.Append(sb.ToString());
}
return mainBuilder.ToString();
}
private static void AddCSVHeader(StringBuilder sb)
{
sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Organization Created,Organization ID,Display Name,Account Created,SipAddress,PhoneNumber,Conferencing,EnterpriseVoice,Federation,InstantMessaging,MobileAccess");
}
}
}

View file

@ -0,0 +1,49 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.HostedSolution
{
public class LyncUserStatistics : BaseStatistics
{
public string DisplayName { get; set; }
public DateTime AccountCreated { get; set; }
public string SipAddress { get; set; }
public bool InstantMessaing{ get; set; }
public bool MobileAccess { get; set; }
public bool Federation { get; set; }
public bool Conferencing { get; set; }
public bool EnterpriseVoice { get; set; }
public string EVPolicy { get; set; }
public string PhoneNumber { get; set; }
public string LyncUserPlan { get; set; }
}
}

View file

@ -57,6 +57,8 @@ namespace WebsitePanel.Providers.HostedSolution
sb.AppendFormat("{0},", ToCsvString(item.TotalSharePointSiteCollections));
sb.AppendFormat("{0},", ToCsvString(item.TotalSharePointSiteCollectionsSize / 1024.0 / 1024.0));
sb.AppendFormat("{0}", ToCsvString(item.TotalCRMUsers));
sb.AppendFormat("{0}", ToCsvString(item.TotalLyncUsers));
sb.AppendFormat("{0}", ToCsvString(item.TotalLyncEVUsers));
mainBuilder.Append(sb.ToString());
}
@ -65,7 +67,7 @@ namespace WebsitePanel.Providers.HostedSolution
private static void AddCSVHeader(StringBuilder sb)
{
sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Total mailboxes,Total mailboxes size(Mb),Total Public Folders size(Mb),Total SharePoint site collections,Total SharePoint site collections size(Mb),Total CRM users");
sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Total mailboxes,Total mailboxes size(Mb),Total Public Folders size(Mb),Total SharePoint site collections,Total SharePoint site collections size(Mb),Total CRM users,Total Lync users,Total Lync EV users");
}
}
}

View file

@ -66,5 +66,18 @@
set;
}
public int TotalLyncUsers
{
get;
set;
}
public int TotalLyncEVUsers
{
get;
set;
}
}
}

View file

@ -88,6 +88,9 @@
<Compile Include="HostedSolution\LyncConstants.cs" />
<Compile Include="HostedSolution\LyncErrorCodes.cs" />
<Compile Include="HostedSolution\LyncFederationDomain.cs" />
<Compile Include="HostedSolution\LyncOrganizationStatistics.cs" />
<Compile Include="HostedSolution\LyncUserStatistics.cs" />
<Compile Include="HostedSolution\LyncStatisticsReport.cs" />
<Compile Include="HostedSolution\LyncUser.cs" />
<Compile Include="HostedSolution\LyncUserPlan.cs" />
<Compile Include="HostedSolution\LyncUserPlanType.cs" />

View file

@ -147,6 +147,14 @@
</tr>
</table>
<table>
<tr>
<td class="FormLabel150">
<asp:CheckBox ID="chkSendInstructions" runat="server" meta:resourcekey="chkSendInstructions" Text="Send Setup Instructions" Checked="true" />
</td>
<td><wsp:EmailControl id="sendInstructionEmail" runat="server" RequiredEnabled="true" ValidationGroup="CreateMailbox"></wsp:EmailControl></td>
</tr>
</table>
<div class="FormFooterClean">

View file

@ -65,13 +65,24 @@ namespace WebsitePanel.Portal.ExchangeServer
return;
}
PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId);
if (package != null)
string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false);
if (!string.IsNullOrEmpty(instructions))
{
//UserInfo user = ES.Services.Users.GetUserById(package.UserId);
//if (user != null)
//sendInstructionEmail.Text = user.Email;
chkSendInstructions.Checked = chkSendInstructions.Visible = sendInstructionEmail.Visible = true;
PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId);
if (package != null)
{
UserInfo user = ES.Services.Users.GetUserById(package.UserId);
if (user != null)
sendInstructionEmail.Text = user.Email;
}
}
else
{
chkSendInstructions.Checked = chkSendInstructions.Visible = sendInstructionEmail.Visible = false;
}
WebsitePanel.Providers.HostedSolution.ExchangeMailboxPlan[] plans = ES.Services.ExchangeServer.GetExchangeMailboxPlans(PanelRequest.ItemID);
@ -124,8 +135,8 @@ namespace WebsitePanel.Portal.ExchangeServer
name,
domain,
password.Password,
false,
"",
chkSendInstructions.Checked,
sendInstructionEmail.Text,
Convert.ToInt32(mailboxPlanSelector.MailboxPlanId),
subscriberNumber);

View file

@ -1,3 +1,31 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -327,6 +355,24 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelector;
/// <summary>
/// chkSendInstructions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkSendInstructions;
/// <summary>
/// sendInstructionEmail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.EmailControl sendInstructionEmail;
/// <summary>
/// btnCreate control.
/// </summary>

View file

@ -92,6 +92,15 @@
</table>
<table>
<tr>
<td class="FormLabel150">
<asp:CheckBox ID="chkSendInstructions" runat="server" meta:resourcekey="chkSendInstructions" Text="Send Setup Instructions" Checked="true" />
</td>
<td><wsp:EmailControl id="sendInstructionEmail" runat="server" RequiredEnabled="true" ValidationGroup="CreateMailbox"></wsp:EmailControl></td>
</tr>
</table>
<div class="FormFooterClean">
<asp:Button id="btnCreate" runat="server" Text="Create Mailbox"
CssClass="Button1" meta:resourcekey="btnCreate" ValidationGroup="CreateMailbox"

View file

@ -58,12 +58,21 @@ namespace WebsitePanel.Portal.HostedSolution
messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization");
}
PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId);
if (package != null)
string instructions = ES.Services.Organizations.GetOrganizationUserSummuryLetter(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false);
if (!string.IsNullOrEmpty(instructions))
{
//UserInfo user = ES.Services.Users.GetUserById(package.UserId);
//if (user != null)
//sendInstructionEmail.Text = user.Email;
chkSendInstructions.Checked = chkSendInstructions.Visible = sendInstructionEmail.Visible = true;
PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId);
if (package != null)
{
UserInfo user = ES.Services.Users.GetUserById(package.UserId);
if (user != null)
sendInstructionEmail.Text = user.Email;
}
}
else
{
chkSendInstructions.Checked = chkSendInstructions.Visible = sendInstructionEmail.Visible = false;
}
}
@ -96,8 +105,8 @@ namespace WebsitePanel.Portal.HostedSolution
email.DomainName.ToLower(),
password.Password,
txtSubscriberNumber.Text.Trim(),
false,
"");
chkSendInstructions.Checked,
sendInstructionEmail.Text);
if (accountId < 0)
{

View file

@ -1,3 +1,31 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -219,6 +247,24 @@ namespace WebsitePanel.Portal.HostedSolution {
/// </remarks>
protected global::WebsitePanel.Portal.PasswordControl password;
/// <summary>
/// chkSendInstructions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkSendInstructions;
/// <summary>
/// sendInstructionEmail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.EmailControl sendInstructionEmail;
/// <summary>
/// btnCreate control.
/// </summary>

View file

@ -50,7 +50,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
{
List<Tab> tabsList = new List<Tab>();
tabsList.Add(CreateTab("edit_user", "Tab.General"));
//tabsList.Add(CreateTab("organization_user_setup", "Tab.Setup"));
string instructions = ES.Services.Organizations.GetOrganizationUserSummuryLetter(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false);
if (!string.IsNullOrEmpty(instructions))
tabsList.Add(CreateTab("organization_user_setup", "Tab.Setup"));
// find selected menu item
int idx = 0;

View file

@ -44,6 +44,7 @@ namespace WebsitePanel.Portal.ProviderControls
public const int EXCHANGE2010_PROVIDER_ID = 32;
public const int EXCHANGE2010SP2_PROVIDER_ID = 90;
public string HubTransports
{
get
@ -101,7 +102,6 @@ namespace WebsitePanel.Portal.ProviderControls
locMailboxDatabase.Visible = false;
break;
default:
storageGroup.Visible = true;
txtStorageGroup.Text = settings["StorageGroup"];

View file

@ -112,10 +112,10 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="cbCRM.Text" xml:space="preserve">
<value>CRM Report</value>
@ -123,6 +123,9 @@
<data name="cbExchange.Text" xml:space="preserve">
<value>Exchange Report</value>
</data>
<data name="cbLync.Text" xml:space="preserve">
<value>Lync Report</value>
</data>
<data name="cbOrganization.Text" xml:space="preserve">
<value>Organization Report</value>
</data>

View file

@ -19,6 +19,11 @@
<asp:CheckBox runat="server" ID="cbSharePoint" meta:resourcekey="cbSharePoint" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:CheckBox runat="server" ID="cbLync" meta:resourcekey="cbLync" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:CheckBox runat="server" ID="cbCRM" meta:resourcekey="cbCRM" />

View file

@ -37,6 +37,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls
private static readonly string EXCHANGE_REPORT = "EXCHANGE_REPORT";
private static readonly string ORGANIZATION_REPORT = "ORGANIZATION_REPORT";
private static readonly string SHAREPOINT_REPORT = "SHAREPOINT_REPORT";
private static readonly string LYNC_REPORT = "LYNC_REPORT";
private static readonly string CRM_REPORT = "CRM_REPORT";
private static readonly string EMAIL = "EMAIL";
@ -51,6 +52,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls
base.SetParameters(parameters);
SetParameter(cbExchange, EXCHANGE_REPORT);
SetParameter(cbSharePoint, SHAREPOINT_REPORT);
SetParameter(cbLync, LYNC_REPORT);
SetParameter(cbCRM, CRM_REPORT);
SetParameter(cbOrganization, ORGANIZATION_REPORT);
SetParameter(txtMail, EMAIL);
@ -61,12 +63,13 @@ namespace WebsitePanel.Portal.ScheduleTaskControls
{
ScheduleTaskParameterInfo exchange = GetParameter(cbExchange, EXCHANGE_REPORT);
ScheduleTaskParameterInfo sharepoint = GetParameter(cbSharePoint, SHAREPOINT_REPORT);
ScheduleTaskParameterInfo lync = GetParameter(cbLync, LYNC_REPORT);
ScheduleTaskParameterInfo crm = GetParameter(cbCRM, CRM_REPORT);
ScheduleTaskParameterInfo organization = GetParameter(cbOrganization, ORGANIZATION_REPORT);
ScheduleTaskParameterInfo email = GetParameter(txtMail, EMAIL);
return new ScheduleTaskParameterInfo[5] { exchange, sharepoint, crm , organization, email};
return new ScheduleTaskParameterInfo[6] { exchange, sharepoint, lync, crm , organization, email};
}
}
}

View file

@ -1,7 +1,34 @@
//------------------------------------------------------------------------------
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -49,6 +76,15 @@ namespace WebsitePanel.Portal.ScheduleTaskControls {
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox cbSharePoint;
/// <summary>
/// cbLync control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox cbLync;
/// <summary>
/// cbCRM control.
/// </summary>