Domain Expiration Task Added

This commit is contained in:
vfedosevich 2014-12-08 04:15:23 -08:00
parent 133de4b747
commit bb0b92e565
20 changed files with 834 additions and 87 deletions

View file

@ -5596,4 +5596,7 @@
<data name="SchedulerTask.SCHEDULE_TASK_DOMAIN_LOOKUP" xml:space="preserve">
<value>Check MX and NS on DNS servers</value>
</data>
<data name="SchedulerTask.SCHEDULE_TASK_DOMAIN_EXPIRATION" xml:space="preserve">
<value>Check domain expiration date</value>
</data>
</root>

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="ModuleAction.AddDomain" xml:space="preserve">
<value>Add New Domain</value>
@ -198,4 +198,13 @@
<data name="gvDomainsType.Header" xml:space="preserve">
<value>Type</value>
</data>
<data name="DomainExpirationDate.Expired" xml:space="preserve">
<value>Expired</value>
</data>
<data name="DomainExpirationDate.Unknown" xml:space="preserve">
<value>Unknown</value>
</data>
<data name="gvDomainsExpirationDate.Header" xml:space="preserve">
<value>Expiration Date</value>
</data>
</root>

View file

@ -25,7 +25,7 @@
CssSelectorClass="NormalGridView" AllowPaging="True" OnRowCommand="gvDomains_RowCommand">
<Columns>
<asp:TemplateField SortExpression="DomainName" HeaderText="gvDomainsName">
<ItemStyle Width="60%" Wrap="False"></ItemStyle>
<ItemStyle Width="45%" Wrap="False"></ItemStyle>
<ItemTemplate>
<b><asp:hyperlink id=lnkEdit1 runat="server" CssClass="Medium"
NavigateUrl='<%# GetItemEditUrl(Eval("PackageID"), Eval("DomainID")) %>'>
@ -37,6 +37,12 @@
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvDomainsExpirationDate">
<ItemStyle Width="15%"></ItemStyle>
<ItemTemplate>
<%# GetDomainExpirationDate(Eval("ExpirationDate"))%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvDomainsType">
<ItemStyle Width="30%"></ItemStyle>
<ItemTemplate>

View file

@ -49,10 +49,10 @@ namespace WebsitePanel.Portal
// visibility
chkRecursive.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User);
gvDomains.Columns[2].Visible = gvDomains.Columns[3].Visible =
gvDomains.Columns[3].Visible = gvDomains.Columns[3].Visible =
(PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked;
gvDomains.Columns[4].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
gvDomains.Columns[5].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
gvDomains.Columns[5].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
gvDomains.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
if (!IsPostBack)
{
@ -100,6 +100,18 @@ namespace WebsitePanel.Portal
return GetLocalizedString("DomainType.Domain");
}
public string GetDomainExpirationDate(object expirationDateObject)
{
var expirationDate = expirationDateObject as DateTime?;
if (expirationDate == null)
return GetLocalizedString("DomainExpirationDate.Unknown");
else if (expirationDate < DateTime.Now)
return GetLocalizedString("DomainExpirationDate.Expired");
else
return expirationDate.Value.ToShortDateString();
}
protected void odsDomainsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)

View file

@ -1,31 +1,3 @@
// 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.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.

View file

@ -0,0 +1,129 @@
<?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="cbEnableNotify" xml:space="preserve">
<value>Enable Client Notification</value>
</data>
<data name="lblDayBeforeNotify" xml:space="preserve">
<value>Notify before</value>
</data>
<data name="lblDayBeforeNotifyHint" xml:space="preserve">
<value>Number of days before expiration date</value>
</data>
</root>

View file

@ -0,0 +1,31 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DomainExpirationView.ascx.cs" Inherits="WebsitePanel.Portal.ScheduleTaskControls.DomainExpirationView" %>
<table cellspacing="0" cellpadding="4" width="100%">
<tr>
<td class="SubHead" nowrap>
<asp:Label ID="Label1" runat="server" meta:resourcekey="cbEnableNotify" Text="Enable Client Notification:"></asp:Label>
</td>
<td>
<asp:CheckBox runat="server" ID="cbEnableNotify" meta:resourcekey="cbEnableNotify" /><br/>
</td>
</tr>
<tr>
<td class="SubHead" nowrap>
<asp:Label ID="lblMailTo" runat="server" meta:resourcekey="lblMailTo" Text="Mail To:"></asp:Label>
</td>
<td class="Normal" width="100%">
<asp:TextBox ID="txtMailTo" runat="server" Width="95%" CssClass="NormalTextBox" MaxLength="1000"></asp:TextBox>
</td>
</tr>
<tr>
<td class="SubHead" nowrap>
<asp:Label ID="lblDayBeforeNotify" runat="server" meta:resourcekey="lblDayBeforeNotify" Text="Notify before:"></asp:Label>
</td>
<td class="Normal" width="100%">
<asp:TextBox ID="txtDaysBeforeNotify" runat="server" Width="95%" CssClass="NormalTextBox" MaxLength="1000"></asp:TextBox><br />
<asp:Label ID="lblDayBeforeNotifyHint" runat="server" meta:resourcekey="lblDayBeforeNotifyHint" Text="Number of days before expiration date"></asp:Label>
</td>
</tr>
</table>

View file

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Portal.UserControls.ScheduleTaskView;
namespace WebsitePanel.Portal.ScheduleTaskControls
{
public partial class DomainExpirationView : EmptyView
{
private static readonly string DaysBeforeParameter = "DAYS_BEFORE";
private static readonly string MailToParameter = "MAIL_TO";
private static readonly string EnableNotificationParameter = "ENABLE_NOTIFICATION";
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Sets scheduler task parameters on view.
/// </summary>
/// <param name="parameters">Parameters list to be set on view.</param>
public override void SetParameters(ScheduleTaskParameterInfo[] parameters)
{
base.SetParameters(parameters);
this.SetParameter(this.txtDaysBeforeNotify, DaysBeforeParameter);
this.SetParameter(this.txtMailTo, MailToParameter);
this.SetParameter(this.cbEnableNotify, EnableNotificationParameter);
}
/// <summary>
/// Gets scheduler task parameters from view.
/// </summary>
/// <returns>Parameters list filled from view.</returns>
public override ScheduleTaskParameterInfo[] GetParameters()
{
ScheduleTaskParameterInfo daysBefore = this.GetParameter(this.txtDaysBeforeNotify, DaysBeforeParameter);
ScheduleTaskParameterInfo mailTo = this.GetParameter(this.txtMailTo, MailToParameter);
ScheduleTaskParameterInfo enableNotification = this.GetParameter(this.cbEnableNotify, EnableNotificationParameter);
return new ScheduleTaskParameterInfo[3] { daysBefore, mailTo, enableNotification };
}
}
}

View file

@ -0,0 +1,78 @@
//------------------------------------------------------------------------------
// <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.ScheduleTaskControls {
public partial class DomainExpirationView {
/// <summary>
/// Label1 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 Label1;
/// <summary>
/// cbEnableNotify 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 cbEnableNotify;
/// <summary>
/// lblMailTo 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 lblMailTo;
/// <summary>
/// txtMailTo 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 txtMailTo;
/// <summary>
/// lblDayBeforeNotify 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 lblDayBeforeNotify;
/// <summary>
/// txtDaysBeforeNotify 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 txtDaysBeforeNotify;
/// <summary>
/// lblDayBeforeNotifyHint 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 lblDayBeforeNotifyHint;
}
}

View file

@ -15,5 +15,6 @@
</td>
<td class="Normal" width="100%">
<asp:TextBox ID="txtMailTo" runat="server" Width="95%" CssClass="NormalTextBox" MaxLength="1000"></asp:TextBox>
</td>
</tr>
</table>

View file

@ -293,6 +293,13 @@
<DesignTime>True</DesignTime>
<DependentUpon>DomainLookupView.ascx.resx</DependentUpon>
</Compile>
<Compile Include="ScheduleTaskControls\DomainExpirationView.ascx.cs">
<DependentUpon>DomainExpirationView.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ScheduleTaskControls\DomainExpirationView.ascx.designer.cs">
<DependentUpon>DomainExpirationView.ascx</DependentUpon>
</Compile>
<Compile Include="ScheduleTaskControls\DomainLookupView.ascx.cs">
<DependentUpon>DomainLookupView.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -4246,10 +4253,12 @@
<Content Include="RDS\UserControls\RDSCollectionApps.ascx" />
<Content Include="RDS\UserControls\RDSCollectionServers.ascx" />
<Content Include="RDS\UserControls\RDSCollectionUsers.ascx" />
<Content Include="ScheduleTaskControls\App_LocalResources\DomainExpirationView.ascx.resx" />
<EmbeddedResource Include="ScheduleTaskControls\App_LocalResources\DomainLookupView.ascx.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>DomainLookupView.ascx.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Content Include="ScheduleTaskControls\DomainExpirationView.ascx" />
<Content Include="ScheduleTaskControls\DomainLookupView.ascx" />
<Content Include="SettingsServiceLevels.ascx" />
<Content Include="CRM\CRMStorageSettings.ascx" />