Commit Changes by DanVB

This commit is contained in:
omara 2012-05-10 19:59:20 -04:00
commit 77017f46d6
8 changed files with 532 additions and 123 deletions

View file

@ -50,12 +50,8 @@ namespace WebsitePanel.Providers.Mail
private bool isDomainAdmin;
private bool isDomainAdminEnabled;
private bool retainLocalCopy;
private bool signatureEnabled;
private string signatureHTML;
/// <summary>
///
/// </summary>
public bool UnlimitedSize
{
get
@ -184,19 +180,17 @@ namespace WebsitePanel.Providers.Mail
#endregion
#region hMail
public bool SignatureEnabled
{
get { return signatureEnabled; }
set { signatureEnabled = value; }
}
public string SignatureHTML
{
get { return signatureHTML; }
set { signatureHTML = value; }
}
#region hMailServer
public bool SignatureEnabled { get; set; }
public string SignatureHTML { get; set; }
public bool ForwardingEnabled { get; set; }
public long Size { get; set; }
public string LastLogonTime { get; set; }
public long QuotaUsed { get; set; }
public bool ResponderExpires {get;set;}
public string ResponderExpirationDate { get; set; }
#endregion
}
}

View file

@ -109,11 +109,25 @@ Public Class hMailServer
objDomain.ComObject = hMailServer.Utilities
objDomain.Succeed = True
Catch ex As Exception
Log.WriteError("Couldn't create hMailServer.Application ActiveX object.", ex)
Log.WriteError("Couldn't create hMailServer.Application Utilities ActiveX object.", ex)
End Try
Return objDomain
End Function
End Function
Private Function GetSettingsObject() As Service
Dim objSettings As New Service()
objSettings.Succeed = False
Try
objSettings.ComObject = hMailServer.Settings
objSettings.Succeed = True
Catch ex As Exception
Log.WriteError("Couldn't create hMailServer.Application Settings ActiveX object.", ex)
End Try
Return objSettings
End Function
Private Function GetDomainObject(ByVal domainName As String) As Service
' find existing domain
@ -124,7 +138,7 @@ Public Class hMailServer
objDomain.ComObject = hMailServer.Domains.ItemByName(domainName)
objDomain.Succeed = True
Catch ex As Exception
Log.WriteError("Couldn't create hMailServer.Application ActiveX object.", ex)
Log.WriteError("Couldn't create hMailServer.Application Domain ActiveX object.", ex)
End Try
Return objDomain
@ -139,7 +153,7 @@ Public Class hMailServer
objDomain.ComObject = hMailServer.Domains
objDomain.Succeed = True
Catch ex As Exception
Log.WriteError("Couldn't create hMailServer.Application ActiveX object.", ex)
Log.WriteError("Couldn't create hMailServer.Application Domains ActiveX object.", ex)
End Try
Return objDomain
@ -285,19 +299,26 @@ Public Class hMailServer
If mailbox.ResponderEnabled Then
objAccount.VacationMessageIsOn = True
objAccount.VacationSubject = mailbox.ResponderSubject
objAccount.VacationMessage = mailbox.ResponderMessage
End If
objAccount.VacationMessage = mailbox.ResponderMessage
objAccount.VacationMessageExpires = False
If mailbox.ResponderExpires Then
If IsDate(mailbox.ResponderExpirationDate) Then
objAccount.VacationMessageExpires = True
objAccount.VacationMessageExpiresDate = mailbox.ResponderExpirationDate.Substring(0, 10)
End If
End If
End If
'set forwarding address
If mailbox.ForwardingAddresses.Length > 0 Then
objAccount.ForwardAddress = mailbox.ForwardingAddresses(0)
objAccount.ForwardEnabled = True
objAccount.ForwardKeepOriginal = mailbox.RetainLocalCopy
End If
If mailbox.ForwardingEnabled Then
objAccount.ForwardAddress = mailbox.ForwardingAddresses(0)
objAccount.ForwardEnabled = True
objAccount.ForwardKeepOriginal = mailbox.RetainLocalCopy
End If
objAccount.Save()
' set account rules
' set account rules
SetAccountRules(mailbox, objAccount)
@ -322,43 +343,43 @@ Public Class hMailServer
' delete rule
objAccount.Rules.DeleteByDBID(objRule.ID)
End If
'// Removed to use built-in forwarding:
'If Not mailbox.ForwardingAddresses Is Nothing _
' And mailbox.ForwardingAddresses.Length > 0 Then
' ' create rule
If Not mailbox.ForwardingAddresses Is Nothing _
And mailbox.ForwardingAddresses.Length > 0 Then
' create rule
' ' add "default" rule
' objRule = objAccount.Rules.Add()
' objRule.AccountID = objAccount.ID
' objRule.Active = True
' objRule.Name = WEBSITEPANEL_RULE_NAME
' objRule.Save()
' add "default" rule
objRule = objAccount.Rules.Add()
objRule.AccountID = objAccount.ID
objRule.Active = True
objRule.Name = WEBSITEPANEL_RULE_NAME
objRule.Save()
' ' Add criteria
' Dim objCriteria As Object = objRule.Criterias.Add()
' objCriteria.RuleID = objRule.ID
' objCriteria.PredefinedField = 6 ' hMailServer.eRulePredefinedField.eFTMessageSize
' objCriteria.MatchType = 4 ' hMailServer.eRuleMatchType.eMTGreaterThan
' objCriteria.MatchValue = "0"
' objCriteria.Save()
' Add criteria
Dim objCriteria As Object = objRule.Criterias.Add()
objCriteria.RuleID = objRule.ID
objCriteria.PredefinedField = 6 ' hMailServer.eRulePredefinedField.eFTMessageSize
objCriteria.MatchType = 4 ' hMailServer.eRuleMatchType.eMTGreaterThan
objCriteria.MatchValue = "0"
objCriteria.Save()
' ' add forwarding addresses
' Dim forwarding As String
' For Each forwarding In mailbox.ForwardingAddresses
' Dim objRuleAction As Object = objRule.Actions.Add()
' objRuleAction.RuleID = objRule.ID
' objRuleAction.Type = 2 'eRAForwardEmail
' objRuleAction.To = forwarding
' objRuleAction.Save()
' Next
' add forwarding addresses
Dim forwarding As String
For Each forwarding In mailbox.ForwardingAddresses
Dim objRuleAction As Object = objRule.Actions.Add()
objRuleAction.RuleID = objRule.ID
objRuleAction.Type = 2 'eRAForwardEmail
objRuleAction.To = forwarding
objRuleAction.Save()
Next
If mailbox.DeleteOnForward Then
Dim objRuleAction As Object = objRule.Actions.Add()
objRuleAction.RuleID = objRule.ID
objRuleAction.RuleID = 1 'eRADeleteEmail
objRuleAction.Save()
End If
End If
' If mailbox.DeleteOnForward Then
' Dim objRuleAction As Object = objRule.Actions.Add()
' objRuleAction.RuleID = objRule.ID
' objRuleAction.RuleID = 1 'eRADeleteEmail
' objRuleAction.Save()
' End If
'End If
End Sub
Public Sub CreateDomain(ByVal domain As MailDomain) Implements IMailServer.CreateDomain
@ -743,11 +764,19 @@ Public Class hMailServer
account.LastName = objAccount.PersonLastName
account.Enabled = objAccount.Active
account.MaxMailboxSize = objAccount.MaxSize
account.Password = objAccount.Password
account.ResponderEnabled = objAccount.VacationMessageIsOn
account.Password = objAccount.Password
account.Size = objAccount.Size()
account.QuotaUsed = objAccount.QuotaUsed()
account.LastLogonTime = CType(objAccount.LastLogonTime(), DateTime)
'auto-responder
account.ResponderEnabled = objAccount.VacationMessageIsOn
account.ResponderSubject = objAccount.VacationSubject
account.ResponderMessage = objAccount.VacationMessage
Dim forwardings As List(Of String) = New List(Of String)
account.ResponderMessage = objAccount.VacationMessage
account.ResponderExpires = objAccount.VacationMessageExpires
account.ResponderExpirationDate = objAccount.VacationMessageExpiresDate
'forwarding
account.ForwardingEnabled = objAccount.ForwardEnabled
Dim forwardings As List(Of String) = New List(Of String)
forwardings.Add(objAccount.ForwardAddress)
account.ForwardingAddresses = forwardings.ToArray
account.RetainLocalCopy = objAccount.ForwardKeepOriginal
@ -793,24 +822,32 @@ Public Class hMailServer
End If
' get account details
Dim account As MailAccount = New MailAccount()
account.Name = objAccount.Address
account.FirstName = objAccount.PersonFirstName
account.LastName = objAccount.PersonLastName
account.Enabled = objAccount.Active
account.MaxMailboxSize = objAccount.MaxSize
account.Password = objAccount.Password
account.ResponderEnabled = objAccount.VacationMessageIsOn
account.ResponderSubject = objAccount.VacationSubject
account.ResponderMessage = objAccount.VacationMessage
Dim forwardings As List(Of String) = New List(Of String)
forwardings.Add(objAccount.ForwardAddress)
account.ForwardingAddresses = forwardings.ToArray
account.RetainLocalCopy = objAccount.ForwardKeepOriginal
'Signature
account.SignatureEnabled = objAccount.SignatureEnabled
account.Signature = objAccount.SignaturePlainText
account.SignatureHTML = objAccount.SignatureHTML
Dim account As MailAccount = New MailAccount()
account.Name = objAccount.Address
account.FirstName = objAccount.PersonFirstName
account.LastName = objAccount.PersonLastName
account.Enabled = objAccount.Active
account.MaxMailboxSize = objAccount.MaxSize
account.Password = objAccount.Password
account.Size = objAccount.Size()
account.QuotaUsed = objAccount.QuotaUsed()
account.LastLogonTime = CType(objAccount.LastLogonTime(), DateTime)
'auto-responder
account.ResponderEnabled = objAccount.VacationMessageIsOn
account.ResponderSubject = objAccount.VacationSubject
account.ResponderMessage = objAccount.VacationMessage
account.ResponderExpires = objAccount.VacationMessageExpires
account.ResponderExpirationDate = objAccount.VacationMessageExpiresDate
'forwarding
account.ForwardingEnabled = objAccount.ForwardEnabled
Dim forwardings As List(Of String) = New List(Of String)
forwardings.Add(objAccount.ForwardAddress)
account.ForwardingAddresses = forwardings.ToArray
account.RetainLocalCopy = objAccount.ForwardKeepOriginal
'Signature
account.SignatureEnabled = objAccount.SignatureEnabled
account.Signature = objAccount.SignaturePlainText
account.SignatureHTML = objAccount.SignatureHTML
accounts.Add(account)
Next
End If
@ -975,31 +1012,42 @@ Public Class hMailServer
objAccount.Active = mailbox.Enabled
objAccount.Password = mailbox.Password
objAccount.MaxSize = mailbox.MaxMailboxSize
objAccount.VacationMessageIsOn = mailbox.ResponderEnabled
'Auto-Responder
objAccount.VacationMessageIsOn = mailbox.ResponderEnabled
objAccount.VacationSubject = mailbox.ResponderSubject
objAccount.VacationMessage = mailbox.ResponderMessage
'Personal Information
objAccount.PersonFirstName = mailbox.FirstName
objAccount.PersonLastName = mailbox.LastName
'Signature
objAccount.SignatureEnabled = mailbox.SignatureEnabled
objAccount.SignaturePlainText = mailbox.Signature
objAccount.SignatureHTML = mailbox.SignatureHTML
objAccount.VacationMessage = mailbox.ResponderMessage
objAccount.VacationMessageExpires = False
If mailbox.ResponderExpires Then
If IsDate(mailbox.ResponderExpirationDate) Then
objAccount.VacationMessageExpires = True
objAccount.VacationMessageExpiresDate = mailbox.ResponderExpirationDate.Substring(0, 10)
End If
End If
'Personal Information
objAccount.PersonFirstName = mailbox.FirstName
objAccount.PersonLastName = mailbox.LastName
'Signature
objAccount.SignatureEnabled = mailbox.SignatureEnabled
objAccount.SignaturePlainText = mailbox.Signature
objAccount.SignatureHTML = mailbox.SignatureHTML
'Forwarding
If mailbox.ForwardingEnabled Then
If mailbox.ForwardingAddresses.Length > 0 Then
objAccount.ForwardAddress = mailbox.ForwardingAddresses(0)
objAccount.ForwardKeepOriginal = mailbox.RetainLocalCopy
objAccount.ForwardEnabled = True
End If
Else
objAccount.ForwardEnabled = False
End If
objAccount.Save()
If mailbox.ForwardingAddresses.Length > 0 Then
objAccount.ForwardAddress = mailbox.ForwardingAddresses(0)
objAccount.ForwardKeepOriginal = mailbox.RetainLocalCopy
objAccount.ForwardEnabled = True
End If
' set account rules
SetAccountRules(mailbox, objAccount)
objAccount.Save()
' set account rules
SetAccountRules(mailbox, objAccount)
Catch ex As Exception
Log.WriteError("Couldn't update an account.", ex)
End Try
Catch ex As Exception
Log.WriteError("Couldn't update an account.", ex)
End Try
End If
End Sub
@ -1169,7 +1217,119 @@ Public Class hMailServer
End Try
End If
Next
End Sub
End Sub
Public Overrides Function GetServiceItemsDiskSpace(ByVal items() As ServiceProviderItem) As ServiceProviderItemDiskSpace()
Dim itemsDiskspace As List(Of ServiceProviderItemDiskSpace) = New List(Of ServiceProviderItemDiskSpace)
Dim item As ServiceProviderItem
For Each item In items
If TypeOf item Is MailAccount Then
Try
Dim objDomain As Service = GetDomainObject(GetDomainName(item.Name))
Dim objAccount = objDomain.ComObject.Accounts.ItemByAddress(item.Name)
Dim objAccountSize As Long = objAccount.Size() * 1048576
Dim diskspace As New ServiceProviderItemDiskSpace()
diskspace.ItemId = item.Id
diskspace.DiskSpace = objAccountSize
itemsDiskspace.Add(diskspace)
Catch ex As Exception
Log.WriteError("Error calculating disk space for mail account: " + item.Name, ex)
End Try
End If
Next item
Return itemsDiskspace.ToArray()
End Function
Public Overrides Function GetServiceItemsBandwidth(ByVal items() As ServiceProviderItem, ByVal since As Date) As ServiceProviderItemBandwidth()
Dim itemsBandwidth(items.Length) As ServiceProviderItemBandwidth
Dim objSets As Service = GetSettingsObject()
If objSets.ComObject.Logging.AWStatsEnabled Then
Dim logsPath As String = objSets.ComObject.Logging.CurrentAwstatsLog()
Dim i As Integer
For i = 0 To items.Length - 1
Dim item As ServiceProviderItem = items(i)
itemsBandwidth(i) = New ServiceProviderItemBandwidth()
itemsBandwidth(i).ItemId = item.Id
itemsBandwidth(i).Days = New DailyStatistics(0) {}
If TypeOf item Is MailDomain Then
Try
itemsBandwidth(i).Days = GetDailyStatistics(since, item.Name, logsPath)
Catch ex As Exception
Log.WriteError("Error calculating bandwidth for mail domain: " + item.Name, ex)
End Try
End If
Next i
End If
Return itemsBandwidth
End Function
Private Function GetDailyStatistics(ByVal since As DateTime, ByVal mailDomainName As String, ByVal logpath As String) As DailyStatistics()
Dim days As New ArrayList()
Dim now As DateTime = DateTime.Now
Dim [date] As DateTime = since
Dim mailDomainBytesReceived As Long = 0
Dim mailDomainBytesSent As Long = 0
Try
While [date] < now
If File.Exists(logpath) Then
Using r As StreamReader = New StreamReader(logpath)
Dim line As String
' Read first line.
line = r.ReadLine
Do While (Not line Is Nothing)
Dim vals As String() = line.Split(vbTab)
If vals.Length = 9 Then
Dim logDate As DateTime = CType(vals(0), DateTime)
If logDate >= [date] Then
'get sent bytes
If InStr(vals(1), mailDomainName) Then
mailDomainBytesSent += Int32.Parse(vals(8))
End If
'get received bytes
If InStr(vals(2), mailDomainName) Then
mailDomainBytesReceived += Int32.Parse(vals(8))
End If
End If
If logDate.Date > [date].Date Then
Exit Do
End If
End If
line = r.ReadLine
Loop
End Using
End If
If mailDomainBytesReceived <> 0 Or mailDomainBytesSent <> 0 Then
Dim dailyStats As New DailyStatistics()
dailyStats.Year = [date].Year
dailyStats.Month = [date].Month
dailyStats.Day = [date].Day
dailyStats.BytesSent = mailDomainBytesSent
dailyStats.BytesReceived = mailDomainBytesReceived
days.Add(dailyStats)
End If
' advance day
[date] = [date].AddDays(1)
mailDomainBytesReceived = 0
mailDomainBytesSent = 0
End While
Catch ex As Exception
Log.WriteError("Could't parse hMailServer Log", ex)
End Try
Return DirectCast(days.ToArray(GetType(DailyStatistics)), DailyStatistics())
End Function
Public Overrides Sub DeleteServiceItems(ByVal items() As ServiceProviderItem)
For Each item As ServiceProviderItem In items

View file

@ -343,7 +343,7 @@ namespace WebsitePanel.Providers.Statistics
string[] split = versionNumber.Split(new char[] { '.' });
return split[0].Equals("6");
return split[0].Equals("6") || split[0].Equals("7");
}
}

View file

@ -121,6 +121,13 @@ namespace WebsitePanel.Providers.Web
Array.ForEach(versionKeys, (x) => { Log.WriteInfo("MSDeploy version key found: {0}", x); });
// Determine appropriate key name to query for
var installPathKey = (IntPtr.Size == 8) ? "InstallPath" : "InstallPath_x86";
// Check if running in 32bit mode under 64bit Windows (WOW64) - works with .NET 2.0+
if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432") == "AMD64")
{
installPathKey = "InstallPath_x64";
}
var fileVersion = String.Empty;
//
var libPath = String.Empty;

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="cbSignatureEnabled.Text" xml:space="preserve">
<value>Yes</value>
@ -165,4 +165,37 @@
<data name="Signature.Text" xml:space="preserve">
<value>Signature</value>
</data>
<data name="chkEnabled.Text" xml:space="preserve">
<value>Yes</value>
</data>
<data name="chkForwardingEnabled.Text" xml:space="preserve">
<value>Yes</value>
</data>
<data name="chkResponderExpires.Text" xml:space="preserve">
<value>Yes</value>
</data>
<data name="lblEnabled.Text" xml:space="preserve">
<value>Mailbox Enabled:</value>
</data>
<data name="lblForwardingEnabled.Text" xml:space="preserve">
<value>Forwarding Enabled:</value>
</data>
<data name="lblLastLoginDate.Text" xml:space="preserve">
<value>Last Login Date:</value>
</data>
<data name="lblQuotaUsed.Text" xml:space="preserve">
<value>Quota Used:</value>
</data>
<data name="lblResponderExpireDate.Text" xml:space="preserve">
<value>Autoresponder Expire Date:</value>
</data>
<data name="lblResponderExpires.Text" xml:space="preserve">
<value>Autoresponder Expires:</value>
</data>
<data name="lblSize.Text" xml:space="preserve">
<value>Current Size:</value>
</data>
<data name="secStatusInfo.Text" xml:space="preserve">
<value>Account Information</value>
</data>
</root>

View file

@ -1,6 +1,45 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="hMailServer43_EditAccount.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.hMailServer43_EditAccount" %>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
<wsp:CollapsiblePanel id="secStatusInfo" runat="server" IsCollapsed="True"
TargetControlID="StatusInfoPanel" meta:resourcekey="secStatusInfo" Text="Account Information" >
</wsp:CollapsiblePanel>
<asp:Panel ID="StatusInfoPanel" runat="server" Height="0" style="overflow:hidden;">
<table width="100%">
<tr>
<td class="SubHead" style="width:150px;" nowrap><asp:Label ID="lblEnabled" runat="server" meta:resourcekey="lblEnabled" Text="Mailbox Enabled:"></asp:Label></td>
<td class="normal">
<asp:CheckBox ID="chkEnabled" Runat="server" meta:resourcekey="chkEnabled" Text="Yes" Checked="true"></asp:CheckBox>
</td>
</tr>
<tr>
<td class="SubHead" style="width:150px;" nowrap>
<asp:Label ID="lblSize" runat="server" meta:resourcekey="lblSize" Text="Size:"></asp:Label>
</td>
<td class="normal">
<asp:Label ID="lblSizeInfo" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="SubHead" style="width:150px;" nowrap>
<asp:Label ID="lblQuotaUsed" runat="server" meta:resourcekey="lblQuotaUsed" Text="Quota Used:"></asp:Label>
</td>
<td class="normal">
<asp:Label ID="lblQuotaUsedInfo" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="SubHead" style="width:150px;" nowrap>
<asp:Label ID="lblLastLoginDate" runat="server" meta:resourcekey="lblLastLoginDate" Text="Last Login Date:"></asp:Label>
</td>
<td class="normal">
<asp:Label ID="lblLastLoginDateInfo" runat="server"></asp:Label>
</td>
</tr>
</table>
</asp:Panel>
<wsp:CollapsiblePanel id="secPersonalInfo" runat="server"
TargetControlID="PersonalInfoPanel" meta:resourcekey="secPersonalInfo" Text="Personal Information">
</wsp:CollapsiblePanel>
@ -8,15 +47,15 @@
<asp:Panel ID="PersonalInfoPanel" runat="server" Height="0" style="overflow:hidden;">
<table width="100%">
<tr>
<td class="SubHead" width="200" nowrap>
<td class="SubHead" style="width:150px;" nowrap>
<asp:Label ID="lblFirstName" runat="server" meta:resourcekey="lblFirstName" Text="First Name:"></asp:Label>
</td>
<td class="normal" width="100%">
<td class="normal">
<asp:TextBox ID="txtFirstName" runat="server" Width="200px" CssClass="NormalTextBox"></asp:TextBox>
</td>
</tr>
<tr>
<td class="SubHead">
<td class="SubHead" style="width:150px;">
<asp:Label ID="lblLastName" runat="server" meta:resourcekey="lblLastName" Text="Last Name:"></asp:Label>
</td>
<td class="normal" valign="top">
@ -33,23 +72,35 @@
<asp:Panel ID="AutoresponderPanel" runat="server" Height="0" style="overflow:hidden;">
<table width="100%">
<tr>
<td class="SubHead" width="200" nowrap><asp:Label ID="lblResponderEnabled" runat="server" meta:resourcekey="lblResponderEnabled" Text="Autoresponder Enabled:"></asp:Label></td>
<td class="normal" width="100%">
<td class="SubHead" style="width:150px;" nowrap><asp:Label ID="lblResponderEnabled" runat="server" meta:resourcekey="lblResponderEnabled" Text="Autoresponder Enabled:"></asp:Label></td>
<td class="normal">
<asp:CheckBox ID="chkResponderEnabled" Runat="server" meta:resourcekey="chkResponderEnabled" Text="Yes"></asp:CheckBox>
</td>
</tr>
<tr>
<td class="SubHead"><asp:Label ID="lblSubject" runat="server" meta:resourcekey="lblSubject" Text="Subject:"></asp:Label></td>
<td class="SubHead" style="width:150px;"><asp:Label ID="lblSubject" runat="server" meta:resourcekey="lblSubject" Text="Subject:"></asp:Label></td>
<td class="normal" vAlign="top">
<asp:TextBox id="txtSubject" runat="server" Width="400px" CssClass="NormalTextBox"></asp:TextBox>
</td>
</tr>
<tr>
<td class="SubHead" vAlign="top"><asp:Label ID="lblMessage" runat="server" meta:resourcekey="lblMessage" Text="Message:"></asp:Label></td>
<td class="SubHead" style="width:150px;" vAlign="top"><asp:Label ID="lblMessage" runat="server" meta:resourcekey="lblMessage" Text="Message:"></asp:Label></td>
<td class="normal">
<asp:TextBox id="txtMessage" runat="server" Width="400px" TextMode="MultiLine" Rows="5" CssClass="NormalTextBox"></asp:TextBox>
</td>
</tr>
<tr>
<td class="SubHead" style="width:150px;" nowrap><asp:Label ID="lblResponderExpires" runat="server" meta:resourcekey="lblResponderExpires" Text="Autoresponder Expires:"></asp:Label></td>
<td class="normal">
<asp:CheckBox ID="chkResponderExpires" Runat="server" meta:resourcekey="chkResponderExpires" Text="Yes"></asp:CheckBox>
</td>
</tr>
<tr>
<td class="SubHead" style="width:150px;" nowrap><asp:Label ID="lblResponderExpireDate" runat="server" meta:resourcekey="lblResponderExpireDate" Text="Autoresponder Expire Date:"></asp:Label></td>
<td class="normal">
<asp:TextBox ID="txtResponderExireDate" Runat="server" Text="" CssClass="NormalTextBox"></asp:TextBox>
</td>
</tr>
</table>
</asp:Panel>
@ -59,13 +110,19 @@
<asp:Panel ID="ForwardingPanel" runat="server" Height="0" style="overflow:hidden;">
<table width="100%">
<tr>
<td class="SubHead" width="200" nowrap><asp:Label ID="lblForwardTo" runat="server" meta:resourcekey="lblForwardTo" Text="Forward mail to address:"></asp:Label></td>
<td class="normal" width="100%" valign="top">
<td class="SubHead" style="width:150px;" nowrap><asp:Label ID="lblForwardingEnabled" runat="server" meta:resourcekey="lblForwardingEnabled" Text="Forwarding Enabled:"></asp:Label></td>
<td class="normal">
<asp:CheckBox ID="chkForwardingEnabled" Runat="server" meta:resourcekey="chkForwardingEnabled" Text="Yes"></asp:CheckBox>
</td>
</tr>
<tr>
<td class="SubHead" style="width:150px;" nowrap><asp:Label ID="lblForwardTo" runat="server" meta:resourcekey="lblForwardTo" Text="Forward mail to address:"></asp:Label></td>
<td class="normal" valign="top">
<asp:TextBox id="txtForward" runat="server" Width="200px" CssClass="NormalTextBox"></asp:TextBox>
</td>
</tr>
<tr>
<td class="SubHead">
<td class="SubHead" style="width:150px;">
</td>
<td class="Normal">
<asp:CheckBox ID="chkOriginalMessage" runat="server" meta:resourcekey="chkOriginalMessage"

View file

@ -50,9 +50,16 @@ namespace WebsitePanel.Portal.ProviderControls
public void BindItem(MailAccount item)
{
chkResponderEnabled.Checked = item.ResponderEnabled;
chkEnabled.Checked = item.Enabled;
lblSizeInfo.Text = item.Size.ToString() + " MB";
lblQuotaUsedInfo.Text = item.QuotaUsed.ToString() + " %";
lblLastLoginDateInfo.Text = item.LastLogonTime;
chkResponderEnabled.Checked = item.ResponderEnabled;
chkResponderExpires.Checked = item.ResponderExpires;
txtResponderExireDate.Text = item.ResponderExpirationDate;
txtSubject.Text = item.ResponderSubject;
txtMessage.Text = item.ResponderMessage;
chkForwardingEnabled.Checked = item.ForwardingEnabled;
txtForward.Text = item.ForwardingAddresses[0];
chkOriginalMessage.Checked = item.RetainLocalCopy;
txtFirstName.Text = item.FirstName;
@ -60,14 +67,21 @@ namespace WebsitePanel.Portal.ProviderControls
cbSignatureEnabled.Checked = item.SignatureEnabled;
txtPlainSignature.Text = item.Signature;
txtHtmlSignature.Text = item.SignatureHTML;
secStatusInfo.IsCollapsed = false;
}
public void SaveItem(MailAccount item)
{
item.Enabled = chkEnabled.Checked;
item.ResponderEnabled = chkResponderEnabled.Checked;
item.ResponderSubject = txtSubject.Text;
item.ResponderMessage = txtMessage.Text;
item.ForwardingAddresses = new string[] { txtForward.Text };
item.ResponderExpires = chkResponderExpires.Checked;
if (txtResponderExireDate.Text.Trim().Length >= 10) {
item.ResponderExpirationDate = txtResponderExireDate.Text.Trim().Substring(0, 10);}
item.ForwardingEnabled = chkForwardingEnabled.Checked;
if (txtForward.Text.Trim().Length > 0) {
item.ForwardingAddresses = new string[] { txtForward.Text.Trim() };}
item.RetainLocalCopy = chkOriginalMessage.Checked;
item.FirstName = txtFirstName.Text;
item.LastName = txtLastName.Text;

View file

@ -3,7 +3,7 @@
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -12,6 +12,96 @@ namespace WebsitePanel.Portal.ProviderControls {
public partial class hMailServer43_EditAccount {
/// <summary>
/// secStatusInfo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secStatusInfo;
/// <summary>
/// StatusInfoPanel 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.Panel StatusInfoPanel;
/// <summary>
/// lblEnabled 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 lblEnabled;
/// <summary>
/// chkEnabled 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 chkEnabled;
/// <summary>
/// lblSize 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 lblSize;
/// <summary>
/// lblSizeInfo 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 lblSizeInfo;
/// <summary>
/// lblQuotaUsed 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 lblQuotaUsed;
/// <summary>
/// lblQuotaUsedInfo 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 lblQuotaUsedInfo;
/// <summary>
/// lblLastLoginDate 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 lblLastLoginDate;
/// <summary>
/// lblLastLoginDateInfo 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 lblLastLoginDateInfo;
/// <summary>
/// secPersonalInfo control.
/// </summary>
@ -138,6 +228,42 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtMessage;
/// <summary>
/// lblResponderExpires 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 lblResponderExpires;
/// <summary>
/// chkResponderExpires 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 chkResponderExpires;
/// <summary>
/// lblResponderExpireDate 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 lblResponderExpireDate;
/// <summary>
/// txtResponderExireDate 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 txtResponderExireDate;
/// <summary>
/// secForwarding control.
/// </summary>
@ -156,6 +282,24 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks>
protected global::System.Web.UI.WebControls.Panel ForwardingPanel;
/// <summary>
/// lblForwardingEnabled 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 lblForwardingEnabled;
/// <summary>
/// chkForwardingEnabled 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 chkForwardingEnabled;
/// <summary>
/// lblForwardTo control.
/// </summary>