merge
This commit is contained in:
commit
bc0ea107d1
43 changed files with 3533 additions and 2612 deletions
|
@ -216,4 +216,7 @@
|
|||
<data name="DomainLookup.TooltipHeader" xml:space="preserve">
|
||||
<value>Current Real DNS Values</value>
|
||||
</data>
|
||||
<data name="DomainLookup.TooltipHeader.Registrar" xml:space="preserve">
|
||||
<value>Registrar:</value>
|
||||
</data>
|
||||
</root>
|
|
@ -38,12 +38,16 @@
|
|||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gvDomainsExpirationDate">
|
||||
<ItemStyle Width="15%"></ItemStyle>
|
||||
<ItemStyle Width="11%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<%# GetDomainExpirationDate(Eval("ExpirationDate"), Eval("LastUpdateDate"))%>
|
||||
|
||||
<div style="display:inline-block" runat="server" Visible='<%# ShowDomainDnsInfo(Eval("ExpirationDate"), Eval("LastUpdateDate"), !(bool)Eval("IsSubDomain") && !(bool)Eval("IsInstantAlias") && !(bool)Eval("IsDomainPointer")) %>'>
|
||||
<img style="border-width: 0px;" src="App_Themes/Default/Images/information_icon_small.gif" title="<%# GetDomainDnsRecords((int)Eval("DomainId")) %>">
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemStyle Width="5%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<div style="display:inline-block" runat="server" Visible='<%# ShowDomainDnsInfo(Eval("ExpirationDate"), Eval("LastUpdateDate"), !(bool)Eval("IsSubDomain") && !(bool)Eval("IsInstantAlias") && !(bool)Eval("IsDomainPointer")) && !string.IsNullOrEmpty(GetDomainDnsRecords((int)Eval("DomainId"))) %>'>
|
||||
<img style="border-width: 0px;" src="App_Themes/Default/Images/information_icon_small.gif" title="<%# GetDomainTooltip((int)Eval("DomainId"), Eval("RegistrarName") != DBNull.Value ? (string)Eval("RegistrarName"):string.Empty) %>">
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
|
|
@ -45,16 +45,20 @@ namespace WebsitePanel.Portal
|
|||
{
|
||||
public partial class Domains : WebsitePanelModuleBase
|
||||
{
|
||||
public Dictionary<int, string> dnsRecords;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
dnsRecords = new Dictionary<int, string>();
|
||||
|
||||
gvDomains.PageSize = UsersHelper.GetDisplayItemsPerPage();
|
||||
|
||||
// visibility
|
||||
chkRecursive.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User);
|
||||
gvDomains.Columns[3].Visible = gvDomains.Columns[3].Visible =
|
||||
gvDomains.Columns[4].Visible = gvDomains.Columns[5].Visible =
|
||||
(PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked;
|
||||
gvDomains.Columns[5].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
|
||||
gvDomains.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
|
||||
gvDomains.Columns[6].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
|
||||
gvDomains.Columns[7].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
@ -154,11 +158,18 @@ namespace WebsitePanel.Portal
|
|||
|
||||
public string GetDomainDnsRecords(int domainId)
|
||||
{
|
||||
if(dnsRecords.ContainsKey(domainId))
|
||||
{
|
||||
return dnsRecords[domainId];
|
||||
}
|
||||
|
||||
var records = ES.Services.Servers.GetDomainDnsRecords(domainId);
|
||||
|
||||
if (!records.Any())
|
||||
{
|
||||
return "No Dns Records";
|
||||
dnsRecords.Add(domainId, string.Empty);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var header = GetLocalizedString("DomainLookup.TooltipHeader");
|
||||
|
@ -169,7 +180,25 @@ namespace WebsitePanel.Portal
|
|||
tooltipLines.Add(" ");
|
||||
tooltipLines.AddRange( records.Select(x=>string.Format("{0}: {1}", x.RecordType, x.Value)));
|
||||
|
||||
return string.Join("\r\n", tooltipLines);
|
||||
dnsRecords.Add(domainId, string.Join("\r\n", tooltipLines));
|
||||
|
||||
return dnsRecords[domainId];
|
||||
}
|
||||
|
||||
public string GetDomainTooltip(int domainId, string registrar)
|
||||
{
|
||||
var dnsString = GetDomainDnsRecords(domainId);
|
||||
|
||||
var tooltipLines = new List<string>();
|
||||
|
||||
if (!string.IsNullOrEmpty(registrar))
|
||||
{
|
||||
var header = GetLocalizedString("DomainLookup.TooltipHeader.Registrar");
|
||||
tooltipLines.Add(header + " " + registrar);
|
||||
tooltipLines.Add("\r\n");
|
||||
}
|
||||
|
||||
return string.Join("\r\n", tooltipLines) + dnsString;
|
||||
}
|
||||
|
||||
protected void odsDomainsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
|
||||
|
|
|
@ -0,0 +1,183 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="locTitle.Text" xml:space="preserve">
|
||||
<value>Domain Dependencies</value>
|
||||
</data>
|
||||
<data name="Text.PageName" xml:space="preserve">
|
||||
<value>Domain Dependencies</value>
|
||||
</data>
|
||||
<data name="gvObjectsDisplayName.Header" xml:space="preserve">
|
||||
<value>Display Name</value>
|
||||
</data>
|
||||
<data name="TopComments.Text" xml:space="preserve">
|
||||
<value>Objects listed Below are dependent on this domain and must be removed prior to domain</value>
|
||||
</data>
|
||||
<data name="Contact.Text" xml:space="preserve">
|
||||
<value>Contact</value>
|
||||
</data>
|
||||
<data name="DefaultSecurityGroup.Text" xml:space="preserve">
|
||||
<value>Security group</value>
|
||||
</data>
|
||||
<data name="DistributionList.Text" xml:space="preserve">
|
||||
<value>Distribution list</value>
|
||||
</data>
|
||||
<data name="Equipment.Text" xml:space="preserve">
|
||||
<value>Equipment</value>
|
||||
</data>
|
||||
<data name="ExchangeAccountEmailAddresses.Text" xml:space="preserve">
|
||||
<value>Email address</value>
|
||||
</data>
|
||||
<data name="gvObjectsDelete.Header" xml:space="preserve">
|
||||
<value>Delete</value>
|
||||
</data>
|
||||
<data name="gvObjectsObjectType.Header" xml:space="preserve">
|
||||
<value>Object Type</value>
|
||||
</data>
|
||||
<data name="gvObjectsView.Header" xml:space="preserve">
|
||||
<value>View</value>
|
||||
</data>
|
||||
<data name="lnkDelete.Text" xml:space="preserve">
|
||||
<value>Delete</value>
|
||||
</data>
|
||||
<data name="lnkView.Text" xml:space="preserve">
|
||||
<value>View</value>
|
||||
</data>
|
||||
<data name="Mailbox.Text" xml:space="preserve">
|
||||
<value>Mailbox</value>
|
||||
</data>
|
||||
<data name="PublicFolder.Text" xml:space="preserve">
|
||||
<value>Public folder</value>
|
||||
</data>
|
||||
<data name="Room.Text" xml:space="preserve">
|
||||
<value>Room</value>
|
||||
</data>
|
||||
<data name="SecurityGroup.Text" xml:space="preserve">
|
||||
<value>Security group</value>
|
||||
</data>
|
||||
<data name="SharedMailbox.Text" xml:space="preserve">
|
||||
<value>Shared mailbox</value>
|
||||
</data>
|
||||
<data name="User.Text" xml:space="preserve">
|
||||
<value>Organization user</value>
|
||||
</data>
|
||||
<data name="LyncUsers.Text" xml:space="preserve">
|
||||
<value>Lync User</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,81 @@
|
|||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExchangeCheckDomainName.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.ExchangeCheckDomainName" %>
|
||||
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||
|
||||
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
|
||||
|
||||
<div id="ExchangeContainer">
|
||||
<div class="Module">
|
||||
<div class="Left">
|
||||
</div>
|
||||
<div class="Content">
|
||||
<div class="Center">
|
||||
<div class="Title">
|
||||
<asp:Image ID="Image1" SkinID="ExchangeDomainName48" runat="server" />
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Domain Names"></asp:Localize>
|
||||
-
|
||||
<asp:Literal ID="litDomainName" runat="server"></asp:Literal>
|
||||
</div>
|
||||
|
||||
<asp:Literal ID="TopComments" runat="server" meta:resourcekey="TopComments"></asp:Literal>
|
||||
|
||||
<div class="FormBody">
|
||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||
<br />
|
||||
|
||||
<asp:GridView ID="gvObjects" runat="server" AutoGenerateColumns="False" EnableViewState="true"
|
||||
Width="100%" CssSelectorClass="NormalGridView" OnRowCommand="gvObjects_RowCommand">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="gvObjectsDisplayName">
|
||||
<ItemStyle Width="40%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:Image ID="img1" runat="server" ImageUrl='<%# GetObjectImage(Eval("ObjectName").ToString(),(int)Eval("ObjectType")) %>' ImageAlign="AbsMiddle" />
|
||||
<asp:hyperlink id="lnk1" runat="server"
|
||||
NavigateUrl='<%# GetEditUrl(Eval("ObjectName").ToString(),(int)Eval("ObjectType"),Eval("ObjectID").ToString(),Eval("OwnerID").ToString()) %>'>
|
||||
<%# Eval("DisplayName") %>
|
||||
</asp:hyperlink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gvObjectsObjectType">
|
||||
<ItemStyle Width="40%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<%# GetObjectType(Eval("ObjectName").ToString(),(int)Eval("ObjectType")) %>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="gvObjectsView">
|
||||
<ItemStyle Width="10%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:hyperlink id="lnk2" runat="server"
|
||||
NavigateUrl='<%# GetEditUrl(Eval("ObjectName").ToString(),(int)Eval("ObjectType"),Eval("ObjectID").ToString(),Eval("OwnerID").ToString()) %>'>
|
||||
<asp:Literal id="lnkView" runat="server" Text="View" meta:resourcekey="lnkView" />
|
||||
</asp:hyperlink>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="gvObjectsDelete">
|
||||
<ItemStyle Width="10%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton id="lnkDelete" runat="server" Text="Delete" meta:resourcekey="lnkDelete"
|
||||
OnClientClick="if(!confirm('Are you sure you want to delete ?')) return false; else ShowProgressDialog('Deleting ...');"
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("OwnerID").ToString() + "," + Eval("ObjectType").ToString() + "," + Eval("DisplayName") %>'
|
||||
Visible='<%# AllowDelete(Eval("ObjectName").ToString(), (int)Eval("ObjectType")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
<br />
|
||||
<asp:Button id="btnBack" runat="server" Text="Back" CssClass="Button1" meta:resourcekey="btnBack"
|
||||
OnClick="btnBack_Click" ></asp:Button>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,282 @@
|
|||
// Copyright (c) 2014, 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.Web.UI.WebControls;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
|
||||
namespace WebsitePanel.Portal.ExchangeServer
|
||||
{
|
||||
public partial class ExchangeCheckDomainName : WebsitePanelModuleBase
|
||||
{
|
||||
private static string EXCHANGEACCOUNTEMAILADDRESSES = "ExchangeAccountEmailAddresses";
|
||||
private static string EXCHANGEACCOUNTS = "ExchangeAccounts";
|
||||
private static string LYNCUSERS = "LyncUsers";
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
// save return URL
|
||||
if (Request.UrlReferrer!=null)
|
||||
ViewState["ReturnUrl"] = Request.UrlReferrer.ToString();
|
||||
|
||||
// domain name
|
||||
DomainInfo domain = ES.Services.Servers.GetDomain(PanelRequest.DomainID);
|
||||
litDomainName.Text = domain.DomainName;
|
||||
|
||||
Bind();
|
||||
}
|
||||
}
|
||||
|
||||
public string GetObjectType(string objectName, int objectType)
|
||||
{
|
||||
if (objectName == EXCHANGEACCOUNTS)
|
||||
{
|
||||
ExchangeAccountType accountType = (ExchangeAccountType)objectType;
|
||||
objectName = accountType.ToString();
|
||||
}
|
||||
|
||||
string res = GetLocalizedString(objectName+".Text");
|
||||
|
||||
if (string.IsNullOrEmpty(res))
|
||||
res = objectName;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public bool AllowDelete(string objectName, int objectType)
|
||||
{
|
||||
if (objectName == EXCHANGEACCOUNTEMAILADDRESSES)
|
||||
{
|
||||
ExchangeAccountType accountType = (ExchangeAccountType)objectType;
|
||||
switch (accountType)
|
||||
{
|
||||
case ExchangeAccountType.Room:
|
||||
case ExchangeAccountType.Equipment:
|
||||
case ExchangeAccountType.SharedMailbox:
|
||||
case ExchangeAccountType.Mailbox:
|
||||
case ExchangeAccountType.DistributionList:
|
||||
case ExchangeAccountType.PublicFolder:
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public string GetObjectImage(string objectName, int objectType)
|
||||
{
|
||||
string imgName = "blank16.gif";
|
||||
|
||||
if (objectName == EXCHANGEACCOUNTS)
|
||||
{
|
||||
ExchangeAccountType accountType = (ExchangeAccountType)objectType;
|
||||
|
||||
imgName = "mailbox_16.gif";
|
||||
switch(accountType)
|
||||
{
|
||||
case ExchangeAccountType.Contact:
|
||||
imgName = "contact_16.gif";
|
||||
break;
|
||||
case ExchangeAccountType.DistributionList:
|
||||
imgName = "dlist_16.gif";
|
||||
break;
|
||||
case ExchangeAccountType.Room:
|
||||
imgName = "room_16.gif";
|
||||
break;
|
||||
case ExchangeAccountType.Equipment:
|
||||
imgName = "equipment_16.gif";
|
||||
break;
|
||||
case ExchangeAccountType.SharedMailbox:
|
||||
imgName = "shared_16.gif";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else if (objectName == EXCHANGEACCOUNTEMAILADDRESSES)
|
||||
{
|
||||
imgName = "mailbox_16.gif";
|
||||
}
|
||||
|
||||
return GetThemedImage("Exchange/" + imgName);
|
||||
}
|
||||
|
||||
public string GetEditUrl(string objectName, int objectType, string objectId, string ownerId)
|
||||
{
|
||||
if (objectName == EXCHANGEACCOUNTS)
|
||||
{
|
||||
string key = "";
|
||||
|
||||
ExchangeAccountType accountType = (ExchangeAccountType)objectType;
|
||||
|
||||
switch (accountType)
|
||||
{
|
||||
case ExchangeAccountType.User:
|
||||
key = "edit_user";
|
||||
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), key,
|
||||
"AccountID=" + objectId,
|
||||
"ItemID=" + PanelRequest.ItemID, "context=user");
|
||||
|
||||
case ExchangeAccountType.Mailbox:
|
||||
case ExchangeAccountType.Room:
|
||||
case ExchangeAccountType.Equipment:
|
||||
case ExchangeAccountType.SharedMailbox:
|
||||
key = "mailbox_settings";
|
||||
break;
|
||||
case ExchangeAccountType.DistributionList:
|
||||
key = "dlist_settings";
|
||||
break;
|
||||
case ExchangeAccountType.PublicFolder:
|
||||
key = "public_folder_settings";
|
||||
break;
|
||||
case ExchangeAccountType.SecurityGroup:
|
||||
case ExchangeAccountType.DefaultSecurityGroup:
|
||||
key = "secur_group_settings";
|
||||
break;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(key))
|
||||
{
|
||||
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), key,
|
||||
"AccountID=" + objectId,
|
||||
"ItemID=" + PanelRequest.ItemID);
|
||||
}
|
||||
}
|
||||
|
||||
if (objectName == EXCHANGEACCOUNTEMAILADDRESSES)
|
||||
{
|
||||
string key = "";
|
||||
|
||||
ExchangeAccountType accountType = (ExchangeAccountType)objectType;
|
||||
|
||||
switch (accountType)
|
||||
{
|
||||
case ExchangeAccountType.Mailbox:
|
||||
case ExchangeAccountType.Room:
|
||||
case ExchangeAccountType.Equipment:
|
||||
case ExchangeAccountType.SharedMailbox:
|
||||
key = "mailbox_addresses";
|
||||
break;
|
||||
case ExchangeAccountType.DistributionList:
|
||||
key = "dlist_addresses";
|
||||
break;
|
||||
case ExchangeAccountType.PublicFolder:
|
||||
key = "public_folder_addresses";
|
||||
break;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(key))
|
||||
{
|
||||
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), key,
|
||||
"AccountID=" + ownerId,
|
||||
"ItemID=" + PanelRequest.ItemID);
|
||||
}
|
||||
}
|
||||
|
||||
if (objectName == LYNCUSERS)
|
||||
{
|
||||
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_lync_user",
|
||||
"AccountID=" + objectId,
|
||||
"ItemID=" + PanelRequest.ItemID);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
private void Bind()
|
||||
{
|
||||
DomainInfo domain = ES.Services.Servers.GetDomain(PanelRequest.DomainID);
|
||||
|
||||
gvObjects.DataSource =
|
||||
ES.Services.Organizations.GetOrganizationObjectsByDomain(PanelRequest.ItemID, domain.DomainName);
|
||||
gvObjects.DataBind();
|
||||
}
|
||||
|
||||
protected void btnBack_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ViewState["ReturnUrl"] != null)
|
||||
Response.Redirect((string)ViewState["ReturnUrl"]);
|
||||
}
|
||||
|
||||
protected void gvObjects_RowCommand(object sender, GridViewCommandEventArgs e)
|
||||
{
|
||||
if (e.CommandName == "DeleteItem")
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] arg = e.CommandArgument.ToString().Split(',');
|
||||
if (arg.Length != 3) return;
|
||||
|
||||
string[] emails = { arg[2] };
|
||||
|
||||
int accountID = 0;
|
||||
if (!int.TryParse(arg[0], out accountID))
|
||||
return;
|
||||
|
||||
int accountTypeID = 0;
|
||||
if (!int.TryParse(arg[1], out accountTypeID))
|
||||
return;
|
||||
|
||||
ExchangeAccountType accountType = (ExchangeAccountType)accountTypeID;
|
||||
|
||||
int result;
|
||||
|
||||
switch(accountType)
|
||||
{
|
||||
case ExchangeAccountType.Room:
|
||||
case ExchangeAccountType.Equipment:
|
||||
case ExchangeAccountType.SharedMailbox:
|
||||
case ExchangeAccountType.Mailbox:
|
||||
result = ES.Services.ExchangeServer.DeleteMailboxEmailAddresses(
|
||||
PanelRequest.ItemID, accountID, emails);
|
||||
break;
|
||||
case ExchangeAccountType.DistributionList:
|
||||
result = ES.Services.ExchangeServer.DeleteDistributionListEmailAddresses(
|
||||
PanelRequest.ItemID, accountID, emails);
|
||||
break;
|
||||
case ExchangeAccountType.PublicFolder:
|
||||
result = ES.Services.ExchangeServer.DeletePublicFolderEmailAddresses(
|
||||
PanelRequest.ItemID, accountID, emails);
|
||||
break;
|
||||
}
|
||||
|
||||
Bind();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WebsitePanel.Portal.ExchangeServer {
|
||||
|
||||
|
||||
public partial class ExchangeCheckDomainName {
|
||||
|
||||
/// <summary>
|
||||
/// asyncTasks control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
|
||||
|
||||
/// <summary>
|
||||
/// Image1 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.Image Image1;
|
||||
|
||||
/// <summary>
|
||||
/// locTitle 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.Localize locTitle;
|
||||
|
||||
/// <summary>
|
||||
/// litDomainName 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.Literal litDomainName;
|
||||
|
||||
/// <summary>
|
||||
/// TopComments 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.Literal TopComments;
|
||||
|
||||
/// <summary>
|
||||
/// messageBox control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
|
||||
|
||||
/// <summary>
|
||||
/// gvObjects 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.GridView gvObjects;
|
||||
|
||||
/// <summary>
|
||||
/// btnBack 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.Button btnBack;
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@
|
|||
<ItemStyle Width="50%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:hyperlink id="lnkEditZone" runat="server" EnableViewState="false"
|
||||
NavigateUrl='<%# GetDomainRecordsEditUrl(Eval("DomainID").ToString()) %>' Enabled='<%# !(bool)Eval("IsHost") %>'>
|
||||
NavigateUrl='<%# GetDomainRecordsEditUrl(Eval("DomainID").ToString()) %>' Enabled="true">
|
||||
<%# Eval("DomainName") %>
|
||||
</asp:hyperlink>
|
||||
</ItemTemplate>
|
||||
|
@ -59,8 +59,12 @@
|
|||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgDelDomain" runat="server" Text="Delete" SkinID="ExchangeDelete"
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("DomainId") %>' Visible='<%# !((bool)Eval("IsHost") || (bool)Eval("IsDefault")) %>'
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected domain?')"></asp:ImageButton>
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("DomainId") %>' Visible='<%# ((!(bool)Eval("IsDefault"))) && (!CheckDomainUsedByHostedOrganization(Eval("DomainID").ToString())) %>'
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected domain?')"
|
||||
/>
|
||||
<asp:LinkButton ID="lnkViewUsage" runat="server" Text="View Usage" Visible='<%# CheckDomainUsedByHostedOrganization(Eval("DomainID").ToString()) %>'
|
||||
CommandName="ViewUsage" CommandArgument='<%# Eval("DomainId") %>'
|
||||
/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
|
|
@ -65,6 +65,14 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
"ItemID=" + PanelRequest.ItemID);
|
||||
}
|
||||
|
||||
public bool CheckDomainUsedByHostedOrganization(string domainId)
|
||||
{
|
||||
int id;
|
||||
if (!int.TryParse(domainId, out id)) return false;
|
||||
|
||||
return ES.Services.Organizations.CheckDomainUsedByHostedOrganization(PanelRequest.ItemID, id);
|
||||
}
|
||||
|
||||
private void BindDomainNames()
|
||||
{
|
||||
OrganizationDomainName[] list = ES.Services.Organizations.GetOrganizationDomains(PanelRequest.ItemID);
|
||||
|
@ -103,7 +111,9 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
int result = ES.Services.Organizations.DeleteOrganizationDomain(PanelRequest.ItemID, domainId);
|
||||
if (result < 0)
|
||||
{
|
||||
messageBox.ShowErrorMessage("EXCHANGE_UNABLE_TO_DELETE_DOMAIN");
|
||||
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "check_domain",
|
||||
"SpaceID=" + PanelSecurity.PackageId, "DomainID=" + domainId));
|
||||
return;
|
||||
}
|
||||
|
||||
// rebind domains
|
||||
|
@ -147,6 +157,14 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
ShowErrorMessage("EXCHANGE_CHANGE_DOMAIN", ex);
|
||||
}
|
||||
}
|
||||
if (e.CommandName == "ViewUsage")
|
||||
{
|
||||
int domainId = Utils.ParseInt(e.CommandArgument.ToString(), 0);
|
||||
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "check_domain",
|
||||
"SpaceID=" + PanelSecurity.PackageId, "DomainID=" + domainId));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void btnSetDefaultDomain_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<ItemStyle Width="50%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:hyperlink id="lnkEditZone" runat="server" EnableViewState="false"
|
||||
NavigateUrl='<%# GetDomainRecordsEditUrl(Eval("DomainID").ToString()) %>' Enabled='<%# !(bool)Eval("IsHost") %>'>
|
||||
NavigateUrl='<%# GetDomainRecordsEditUrl(Eval("DomainID").ToString()) %>' Enabled="true">
|
||||
<%# Eval("DomainName") %>
|
||||
</asp:hyperlink>
|
||||
</ItemTemplate>
|
||||
|
@ -45,7 +45,7 @@
|
|||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgDelDomain" runat="server" Text="Delete" SkinID="ExchangeDelete"
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("DomainId") %>' Visible='<%# !((bool)Eval("IsHost") || (bool)Eval("IsDefault")) %>'
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("DomainId") %>' Visible='<%# !((bool)Eval("IsDefault")) %>'
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected domain?')"></asp:ImageButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
|
|
@ -103,7 +103,9 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
int result = ES.Services.Organizations.DeleteOrganizationDomain(PanelRequest.ItemID, domainId);
|
||||
if (result < 0)
|
||||
{
|
||||
messageBox.ShowErrorMessage("EXCHANGE_UNABLE_TO_DELETE_DOMAIN");
|
||||
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "check_domain",
|
||||
"SpaceID=" + PanelSecurity.PackageId, "DomainID=" + domainId));
|
||||
return;
|
||||
}
|
||||
|
||||
// rebind domains
|
||||
|
|
|
@ -67,8 +67,7 @@
|
|||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgRemove1" runat="server" Text="Remove" Visible='<%# Eval("RdsCollectionId") == null %>'
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to remove selected server?')"></asp:LinkButton>
|
||||
<asp:Label ID="lbRemove" Text="Remove" runat="server" Visible='<%# Eval("RdsCollectionId") != null %>'></asp:Label>
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to remove selected server?')"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
|
|
@ -41,6 +41,8 @@ namespace WebsitePanel.Portal.RDS
|
|||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
remoreApps.Module = Module;
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
||||
|
@ -48,8 +50,8 @@ namespace WebsitePanel.Portal.RDS
|
|||
|
||||
locCName.Text = collection.Name;
|
||||
|
||||
remoreApps.SetApps(collectionApps, Module);
|
||||
}
|
||||
remoreApps.SetApps(collectionApps);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -43,16 +43,16 @@
|
|||
<Columns>
|
||||
<asp:BoundField DataField="Name" HtmlEncode="true" SortExpression="Name" HeaderText="Server name">
|
||||
<HeaderStyle Wrap="false" />
|
||||
<ItemStyle Wrap="False" Width="35%"/>
|
||||
<ItemStyle Wrap="False" Width="25%"/>
|
||||
</asp:BoundField>
|
||||
<asp:BoundField DataField="Address" HeaderText="IP Address"><ItemStyle Width="20%"/></asp:BoundField>
|
||||
<asp:BoundField DataField="ItemName" HeaderText="Organization"><ItemStyle Width="35%"/></asp:BoundField>
|
||||
<asp:BoundField DataField="Address" HeaderText="IP Address"><ItemStyle Width="15%"/></asp:BoundField>
|
||||
<asp:BoundField DataField="ItemName" HeaderText="Organization"><ItemStyle Width="20%"/></asp:BoundField>
|
||||
<asp:BoundField DataField="Description" HeaderText="Comments"><ItemStyle Width="30%"/></asp:BoundField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lnkRemove" runat="server" Text="Remove" Visible='<%# Eval("ItemId") == null %>'
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected rds server?')"></asp:LinkButton>
|
||||
<asp:Label ID="lbRemove" Text="Remove" runat="server" Visible='<%# Eval("ItemId") != null %>'></asp:Label>
|
||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected rds server?')"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
<tr>
|
||||
<td class="FormLabel150"><asp:Localize ID="locServerComments" runat="server" meta:resourcekey="locServerComments" Text="Server Comments:"></asp:Localize></td>
|
||||
<td>
|
||||
<asp:TextBox ID="txtServerComments" runat="server" CssClass="NormalTextBox" Width="145px"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="valServerComments" runat="server" ErrorMessage="*" ControlToValidate="txtServerComments"></asp:RequiredFieldValidator>
|
||||
<asp:TextBox ID="txtServerComments" runat="server" CssClass="NormalTextBox" Width="145px"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -75,15 +75,6 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtServerComments;
|
||||
|
||||
/// <summary>
|
||||
/// valServerComments 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.RequiredFieldValidator valServerComments;
|
||||
|
||||
/// <summary>
|
||||
/// btnAdd control.
|
||||
/// </summary>
|
||||
|
|
|
@ -79,6 +79,15 @@ namespace WebsitePanel.Portal.ScheduleTaskControls.App_LocalResources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Pause between queries (ms):.
|
||||
/// </summary>
|
||||
internal static string lblPause {
|
||||
get {
|
||||
return ResourceManager.GetString("lblPause", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Server Name:.
|
||||
/// </summary>
|
||||
|
|
|
@ -123,6 +123,9 @@
|
|||
<data name="lblDnsServersHint" xml:space="preserve">
|
||||
<value>Please enter dns servers to check.</value>
|
||||
</data>
|
||||
<data name="lblPause" xml:space="preserve">
|
||||
<value>Pause between queries (ms):</value>
|
||||
</data>
|
||||
<data name="lblServerName" xml:space="preserve">
|
||||
<value>Server Name:</value>
|
||||
</data>
|
||||
|
|
|
@ -25,4 +25,12 @@
|
|||
<asp:TextBox ID="txtMailTo" runat="server" Width="95%" CssClass="NormalTextBox" MaxLength="1000"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead" nowrap>
|
||||
<asp:Label ID="lblPause" runat="server" meta:resourcekey="lblPause" Text="Pause between queries (ms):"></asp:Label>
|
||||
</td>
|
||||
<td class="Normal" width="100%">
|
||||
<asp:TextBox ID="txtPause" runat="server" Width="95%" CssClass="NormalTextBox" MaxLength="1000"></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls
|
|||
private static readonly string DnsServersParameter = "DNS_SERVERS";
|
||||
private static readonly string MailToParameter = "MAIL_TO";
|
||||
private static readonly string ServerNameParameter = "SERVER_NAME";
|
||||
private static readonly string PauseBetweenQueriesParameter = "PAUSE_BETWEEN_QUERIES";
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -30,6 +31,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls
|
|||
|
||||
this.SetParameter(this.txtDnsServers, DnsServersParameter);
|
||||
this.SetParameter(this.txtMailTo, MailToParameter);
|
||||
this.SetParameter(this.txtPause, PauseBetweenQueriesParameter);
|
||||
this.SetParameter(this.ddlServers, ServerNameParameter);
|
||||
|
||||
var servers = ES.Services.Servers.GetAllServers();
|
||||
|
@ -68,8 +70,9 @@ namespace WebsitePanel.Portal.ScheduleTaskControls
|
|||
ScheduleTaskParameterInfo dnsServers = this.GetParameter(this.txtDnsServers, DnsServersParameter);
|
||||
ScheduleTaskParameterInfo mailTo = this.GetParameter(this.txtMailTo, MailToParameter);
|
||||
ScheduleTaskParameterInfo serverName = this.GetParameter(this.ddlServers, ServerNameParameter);
|
||||
ScheduleTaskParameterInfo pause = this.GetParameter(this.txtPause, PauseBetweenQueriesParameter);
|
||||
|
||||
return new ScheduleTaskParameterInfo[3] { dnsServers, mailTo, serverName };
|
||||
return new ScheduleTaskParameterInfo[4] { dnsServers, mailTo, serverName, pause };
|
||||
}
|
||||
}
|
||||
}
|
|
@ -65,5 +65,23 @@ namespace WebsitePanel.Portal.ScheduleTaskControls {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtMailTo;
|
||||
|
||||
/// <summary>
|
||||
/// lblPause 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.Label lblPause;
|
||||
|
||||
/// <summary>
|
||||
/// txtPause 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.TextBox txtPause;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -185,104 +185,111 @@ namespace WebsitePanel.Portal
|
|||
|
||||
private void BindControls()
|
||||
{
|
||||
// hide database server parameters
|
||||
DeploymentParameterWellKnownTag hiddenTags =
|
||||
DeploymentParameterWellKnownTag.IisApp |
|
||||
DeploymentParameterWellKnownTag.Hidden |
|
||||
DeploymentParameterWellKnownTag.DBServer |
|
||||
DeploymentParameterWellKnownTag.DBAdminUserName |
|
||||
DeploymentParameterWellKnownTag.DBAdminPassword;
|
||||
|
||||
if ((WellKnownTags & hiddenTags) > 0)
|
||||
try
|
||||
{
|
||||
this.Visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// disable all editor controls
|
||||
BooleanControl.Visible = false;
|
||||
EnumControl.Visible = false;
|
||||
PasswordControl.Visible = false;
|
||||
TextControl.Visible = false;
|
||||
// hide database server parameters
|
||||
DeploymentParameterWellKnownTag hiddenTags =
|
||||
DeploymentParameterWellKnownTag.IisApp |
|
||||
DeploymentParameterWellKnownTag.Hidden |
|
||||
DeploymentParameterWellKnownTag.DBServer |
|
||||
DeploymentParameterWellKnownTag.DBAdminUserName |
|
||||
DeploymentParameterWellKnownTag.DBAdminPassword;
|
||||
|
||||
// enable specific control
|
||||
if ((ValidationKind & DeploymentParameterValidationKind.Boolean) == DeploymentParameterValidationKind.Boolean)
|
||||
{
|
||||
// Boolean value
|
||||
BooleanControl.Visible = true;
|
||||
bool val = false;
|
||||
Boolean.TryParse(DefaultValue, out val);
|
||||
boolValue.Checked = val;
|
||||
}
|
||||
else if ((ValidationKind & DeploymentParameterValidationKind.Enumeration) == DeploymentParameterValidationKind.Enumeration)
|
||||
{
|
||||
// Enumeration value
|
||||
EnumControl.Visible = true;
|
||||
|
||||
// fill dropdown
|
||||
enumValue.Items.Clear();
|
||||
string[] items = (ValidationString ?? "").Trim().Split(',');
|
||||
foreach (string item in items)
|
||||
enumValue.Items.Add(item.Trim());
|
||||
|
||||
// select default value
|
||||
enumValue.SelectedValue = DefaultValue;
|
||||
}
|
||||
else if ((WellKnownTags & DeploymentParameterWellKnownTag.Password) == DeploymentParameterWellKnownTag.Password)
|
||||
{
|
||||
// Password value
|
||||
PasswordControl.Visible = true;
|
||||
confirmPasswordControls.Visible = ((WellKnownTags & DeploymentParameterWellKnownTag.New) == DeploymentParameterWellKnownTag.New);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Text value
|
||||
TextControl.Visible = true;
|
||||
textValue.Text = DefaultValue;
|
||||
valPrefix.Text = ValuePrefix;
|
||||
valSuffix.Text = ValueSuffix;
|
||||
|
||||
if (
|
||||
(WellKnownTags & DeploymentParameterWellKnownTag.MySql) == DeploymentParameterWellKnownTag.MySql
|
||||
&&
|
||||
(WellKnownTags & DeploymentParameterWellKnownTag.DBUserName) == DeploymentParameterWellKnownTag.DBUserName
|
||||
)
|
||||
if ((WellKnownTags & hiddenTags) > 0)
|
||||
{
|
||||
MysqlUsernameLengthValidator.Enabled = true;
|
||||
this.Visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// disable all editor controls
|
||||
BooleanControl.Visible = false;
|
||||
EnumControl.Visible = false;
|
||||
PasswordControl.Visible = false;
|
||||
TextControl.Visible = false;
|
||||
|
||||
// enable specific control
|
||||
if ((ValidationKind & DeploymentParameterValidationKind.Boolean) == DeploymentParameterValidationKind.Boolean)
|
||||
{
|
||||
// Boolean value
|
||||
BooleanControl.Visible = true;
|
||||
bool val = false;
|
||||
Boolean.TryParse(DefaultValue, out val);
|
||||
boolValue.Checked = val;
|
||||
}
|
||||
else if ((ValidationKind & DeploymentParameterValidationKind.Enumeration) == DeploymentParameterValidationKind.Enumeration)
|
||||
{
|
||||
// Enumeration value
|
||||
EnumControl.Visible = true;
|
||||
|
||||
// fill dropdown
|
||||
enumValue.Items.Clear();
|
||||
string[] items = (ValidationString ?? "").Trim().Split(',');
|
||||
foreach (string item in items)
|
||||
enumValue.Items.Add(item.Trim());
|
||||
|
||||
// select default value
|
||||
enumValue.SelectedValue = DefaultValue;
|
||||
}
|
||||
else if ((WellKnownTags & DeploymentParameterWellKnownTag.Password) == DeploymentParameterWellKnownTag.Password)
|
||||
{
|
||||
// Password value
|
||||
PasswordControl.Visible = true;
|
||||
confirmPasswordControls.Visible = ((WellKnownTags & DeploymentParameterWellKnownTag.New) == DeploymentParameterWellKnownTag.New);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Text value
|
||||
TextControl.Visible = true;
|
||||
textValue.Text = DefaultValue == null ? "" : DefaultValue;
|
||||
valPrefix.Text = ValuePrefix == null ? "" : ValuePrefix;
|
||||
valSuffix.Text = ValueSuffix == null ? "" : ValueSuffix;
|
||||
|
||||
if (
|
||||
(ValuePrefix != null) && (ValueSuffix != null)
|
||||
&&
|
||||
((WellKnownTags & DeploymentParameterWellKnownTag.MySql) == DeploymentParameterWellKnownTag.MySql)
|
||||
&&
|
||||
((WellKnownTags & DeploymentParameterWellKnownTag.DBUserName) == DeploymentParameterWellKnownTag.DBUserName)
|
||||
)
|
||||
{
|
||||
MysqlUsernameLengthValidator.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// enforce validation for database parameters if they are allowed empty by app pack developers
|
||||
bool isDatabaseParameter = (WellKnownTags & (
|
||||
DeploymentParameterWellKnownTag.DBName |
|
||||
DeploymentParameterWellKnownTag.DBUserName |
|
||||
DeploymentParameterWellKnownTag.DBUserPassword)) > 0;
|
||||
|
||||
// enforce validation for database name and username
|
||||
if ((WellKnownTags & (DeploymentParameterWellKnownTag.DBName | DeploymentParameterWellKnownTag.DBUserName)) > 0
|
||||
&& String.IsNullOrEmpty(ValidationString))
|
||||
{
|
||||
validationKind |= DeploymentParameterValidationKind.RegularExpression;
|
||||
validationString = DatabaseIdentifierRegexp;
|
||||
}
|
||||
|
||||
// validation common for all editors
|
||||
requireTextValue.Enabled = requirePassword.Enabled = requireConfirmPassword.Enabled = requireEnumValue.Enabled =
|
||||
((ValidationKind & DeploymentParameterValidationKind.AllowEmpty) != DeploymentParameterValidationKind.AllowEmpty) || isDatabaseParameter;
|
||||
|
||||
requireTextValue.Text = requirePassword.Text = requireEnumValue.Text =
|
||||
String.Format(GetLocalizedString("RequiredValidator.Text"), FriendlyName);
|
||||
|
||||
regexpTextValue.Enabled = regexpPassword.Enabled = regexpEnumValue.Enabled =
|
||||
(ValidationKind & DeploymentParameterValidationKind.RegularExpression) == DeploymentParameterValidationKind.RegularExpression;
|
||||
|
||||
regexpTextValue.ValidationExpression = regexpPassword.ValidationExpression = regexpEnumValue.ValidationExpression =
|
||||
ValidationString ?? "";
|
||||
|
||||
regexpTextValue.Text = regexpPassword.Text = regexpEnumValue.Text =
|
||||
String.Format(GetLocalizedString("RegexpValidator.Text"), FriendlyName, ValidationString);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// enforce validation for database parameters if they are allowed empty by app pack developers
|
||||
bool isDatabaseParameter = (WellKnownTags & (
|
||||
DeploymentParameterWellKnownTag.DBName |
|
||||
DeploymentParameterWellKnownTag.DBUserName |
|
||||
DeploymentParameterWellKnownTag.DBUserPassword)) > 0;
|
||||
|
||||
// enforce validation for database name and username
|
||||
if ((WellKnownTags & (DeploymentParameterWellKnownTag.DBName | DeploymentParameterWellKnownTag.DBUserName)) > 0
|
||||
&& String.IsNullOrEmpty(ValidationString))
|
||||
{
|
||||
validationKind |= DeploymentParameterValidationKind.RegularExpression;
|
||||
validationString = DatabaseIdentifierRegexp;
|
||||
}
|
||||
|
||||
// validation common for all editors
|
||||
requireTextValue.Enabled = requirePassword.Enabled = requireConfirmPassword.Enabled = requireEnumValue.Enabled =
|
||||
((ValidationKind & DeploymentParameterValidationKind.AllowEmpty) != DeploymentParameterValidationKind.AllowEmpty) || isDatabaseParameter;
|
||||
|
||||
requireTextValue.Text = requirePassword.Text = requireEnumValue.Text =
|
||||
String.Format(GetLocalizedString("RequiredValidator.Text"), FriendlyName);
|
||||
|
||||
regexpTextValue.Enabled = regexpPassword.Enabled = regexpEnumValue.Enabled =
|
||||
(ValidationKind & DeploymentParameterValidationKind.RegularExpression) == DeploymentParameterValidationKind.RegularExpression;
|
||||
|
||||
regexpTextValue.ValidationExpression = regexpPassword.ValidationExpression = regexpEnumValue.ValidationExpression =
|
||||
ValidationString ?? "";
|
||||
|
||||
regexpTextValue.Text = regexpPassword.Text = regexpEnumValue.Text =
|
||||
String.Format(GetLocalizedString("RegexpValidator.Text"), FriendlyName, ValidationString);
|
||||
|
||||
catch { } // just skip
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -211,6 +211,13 @@
|
|||
<Compile Include="Code\ReportingServices\IResourceStorage.cs" />
|
||||
<Compile Include="Code\ReportingServices\ReportingServicesUtils.cs" />
|
||||
<Compile Include="Code\UserControls\Tab.cs" />
|
||||
<Compile Include="ExchangeServer\ExchangeCheckDomainName.ascx.cs">
|
||||
<DependentUpon>ExchangeCheckDomainName.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ExchangeServer\ExchangeCheckDomainName.ascx.designer.cs">
|
||||
<DependentUpon>ExchangeCheckDomainName.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProviderControls\Windows2012_Settings.ascx.cs">
|
||||
<DependentUpon>Windows2012_Settings.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
@ -4291,6 +4298,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ApplyEnableHardQuotaFeature.ascx" />
|
||||
<Content Include="ExchangeServer\ExchangeCheckDomainName.ascx" />
|
||||
<Content Include="ProviderControls\Windows2012_Settings.ascx" />
|
||||
<Content Include="RDSServersAddserver.ascx" />
|
||||
<Content Include="RDSServers.ascx" />
|
||||
|
@ -4315,6 +4323,9 @@
|
|||
<Content Include="RDS\App_LocalResources\RDSEditApplicationUsers.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="ExchangeServer\App_LocalResources\ExchangeCheckDomainName.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<EmbeddedResource Include="ScheduleTaskControls\App_LocalResources\DomainLookupView.ascx.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>DomainLookupView.ascx.Designer.cs</LastGenOutput>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue