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 isDomainAdmin;
private bool isDomainAdminEnabled; private bool isDomainAdminEnabled;
private bool retainLocalCopy; private bool retainLocalCopy;
private bool signatureEnabled;
private string signatureHTML;
/// <summary>
///
/// </summary>
public bool UnlimitedSize public bool UnlimitedSize
{ {
get get
@ -184,18 +180,16 @@ namespace WebsitePanel.Providers.Mail
#endregion #endregion
#region hMail #region hMailServer
public bool SignatureEnabled
{
get { return signatureEnabled; }
set { signatureEnabled = value; }
}
public string SignatureHTML public bool SignatureEnabled { get; set; }
{ public string SignatureHTML { get; set; }
get { return signatureHTML; } public bool ForwardingEnabled { get; set; }
set { signatureHTML = value; } 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 #endregion
} }

View file

@ -109,11 +109,25 @@ Public Class hMailServer
objDomain.ComObject = hMailServer.Utilities objDomain.ComObject = hMailServer.Utilities
objDomain.Succeed = True objDomain.Succeed = True
Catch ex As Exception 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 End Try
Return objDomain 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 Private Function GetDomainObject(ByVal domainName As String) As Service
' find existing domain ' find existing domain
@ -124,7 +138,7 @@ Public Class hMailServer
objDomain.ComObject = hMailServer.Domains.ItemByName(domainName) objDomain.ComObject = hMailServer.Domains.ItemByName(domainName)
objDomain.Succeed = True objDomain.Succeed = True
Catch ex As Exception 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 End Try
Return objDomain Return objDomain
@ -139,7 +153,7 @@ Public Class hMailServer
objDomain.ComObject = hMailServer.Domains objDomain.ComObject = hMailServer.Domains
objDomain.Succeed = True objDomain.Succeed = True
Catch ex As Exception 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 End Try
Return objDomain Return objDomain
@ -285,19 +299,26 @@ Public Class hMailServer
If mailbox.ResponderEnabled Then If mailbox.ResponderEnabled Then
objAccount.VacationMessageIsOn = True objAccount.VacationMessageIsOn = True
objAccount.VacationSubject = mailbox.ResponderSubject objAccount.VacationSubject = mailbox.ResponderSubject
objAccount.VacationMessage = mailbox.ResponderMessage objAccount.VacationMessage = mailbox.ResponderMessage
End If 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 'set forwarding address
If mailbox.ForwardingAddresses.Length > 0 Then If mailbox.ForwardingEnabled Then
objAccount.ForwardAddress = mailbox.ForwardingAddresses(0) objAccount.ForwardAddress = mailbox.ForwardingAddresses(0)
objAccount.ForwardEnabled = True objAccount.ForwardEnabled = True
objAccount.ForwardKeepOriginal = mailbox.RetainLocalCopy objAccount.ForwardKeepOriginal = mailbox.RetainLocalCopy
End If End If
objAccount.Save() objAccount.Save()
' set account rules ' set account rules
SetAccountRules(mailbox, objAccount) SetAccountRules(mailbox, objAccount)
@ -322,43 +343,43 @@ Public Class hMailServer
' delete rule ' delete rule
objAccount.Rules.DeleteByDBID(objRule.ID) objAccount.Rules.DeleteByDBID(objRule.ID)
End If 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 _ ' ' add "default" rule
And mailbox.ForwardingAddresses.Length > 0 Then ' objRule = objAccount.Rules.Add()
' create rule ' objRule.AccountID = objAccount.ID
' objRule.Active = True
' objRule.Name = WEBSITEPANEL_RULE_NAME
' objRule.Save()
' add "default" rule ' ' Add criteria
objRule = objAccount.Rules.Add() ' Dim objCriteria As Object = objRule.Criterias.Add()
objRule.AccountID = objAccount.ID ' objCriteria.RuleID = objRule.ID
objRule.Active = True ' objCriteria.PredefinedField = 6 ' hMailServer.eRulePredefinedField.eFTMessageSize
objRule.Name = WEBSITEPANEL_RULE_NAME ' objCriteria.MatchType = 4 ' hMailServer.eRuleMatchType.eMTGreaterThan
objRule.Save() ' objCriteria.MatchValue = "0"
' objCriteria.Save()
' Add criteria ' ' add forwarding addresses
Dim objCriteria As Object = objRule.Criterias.Add() ' Dim forwarding As String
objCriteria.RuleID = objRule.ID ' For Each forwarding In mailbox.ForwardingAddresses
objCriteria.PredefinedField = 6 ' hMailServer.eRulePredefinedField.eFTMessageSize ' Dim objRuleAction As Object = objRule.Actions.Add()
objCriteria.MatchType = 4 ' hMailServer.eRuleMatchType.eMTGreaterThan ' objRuleAction.RuleID = objRule.ID
objCriteria.MatchValue = "0" ' objRuleAction.Type = 2 'eRAForwardEmail
objCriteria.Save() ' objRuleAction.To = forwarding
' objRuleAction.Save()
' Next
' add forwarding addresses ' If mailbox.DeleteOnForward Then
Dim forwarding As String ' Dim objRuleAction As Object = objRule.Actions.Add()
For Each forwarding In mailbox.ForwardingAddresses ' objRuleAction.RuleID = objRule.ID
Dim objRuleAction As Object = objRule.Actions.Add() ' objRuleAction.RuleID = 1 'eRADeleteEmail
objRuleAction.RuleID = objRule.ID ' objRuleAction.Save()
objRuleAction.Type = 2 'eRAForwardEmail ' End If
objRuleAction.To = forwarding 'End If
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
End Sub End Sub
Public Sub CreateDomain(ByVal domain As MailDomain) Implements IMailServer.CreateDomain Public Sub CreateDomain(ByVal domain As MailDomain) Implements IMailServer.CreateDomain
@ -743,11 +764,19 @@ Public Class hMailServer
account.LastName = objAccount.PersonLastName account.LastName = objAccount.PersonLastName
account.Enabled = objAccount.Active account.Enabled = objAccount.Active
account.MaxMailboxSize = objAccount.MaxSize account.MaxMailboxSize = objAccount.MaxSize
account.Password = objAccount.Password account.Password = objAccount.Password
account.ResponderEnabled = objAccount.VacationMessageIsOn 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.ResponderSubject = objAccount.VacationSubject
account.ResponderMessage = objAccount.VacationMessage account.ResponderMessage = objAccount.VacationMessage
Dim forwardings As List(Of String) = New List(Of String) 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) forwardings.Add(objAccount.ForwardAddress)
account.ForwardingAddresses = forwardings.ToArray account.ForwardingAddresses = forwardings.ToArray
account.RetainLocalCopy = objAccount.ForwardKeepOriginal account.RetainLocalCopy = objAccount.ForwardKeepOriginal
@ -793,24 +822,32 @@ Public Class hMailServer
End If End If
' get account details ' get account details
Dim account As MailAccount = New MailAccount() Dim account As MailAccount = New MailAccount()
account.Name = objAccount.Address account.Name = objAccount.Address
account.FirstName = objAccount.PersonFirstName account.FirstName = objAccount.PersonFirstName
account.LastName = objAccount.PersonLastName account.LastName = objAccount.PersonLastName
account.Enabled = objAccount.Active account.Enabled = objAccount.Active
account.MaxMailboxSize = objAccount.MaxSize account.MaxMailboxSize = objAccount.MaxSize
account.Password = objAccount.Password account.Password = objAccount.Password
account.ResponderEnabled = objAccount.VacationMessageIsOn account.Size = objAccount.Size()
account.ResponderSubject = objAccount.VacationSubject account.QuotaUsed = objAccount.QuotaUsed()
account.ResponderMessage = objAccount.VacationMessage account.LastLogonTime = CType(objAccount.LastLogonTime(), DateTime)
Dim forwardings As List(Of String) = New List(Of String) 'auto-responder
forwardings.Add(objAccount.ForwardAddress) account.ResponderEnabled = objAccount.VacationMessageIsOn
account.ForwardingAddresses = forwardings.ToArray account.ResponderSubject = objAccount.VacationSubject
account.RetainLocalCopy = objAccount.ForwardKeepOriginal account.ResponderMessage = objAccount.VacationMessage
'Signature account.ResponderExpires = objAccount.VacationMessageExpires
account.SignatureEnabled = objAccount.SignatureEnabled account.ResponderExpirationDate = objAccount.VacationMessageExpiresDate
account.Signature = objAccount.SignaturePlainText 'forwarding
account.SignatureHTML = objAccount.SignatureHTML 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) accounts.Add(account)
Next Next
End If End If
@ -975,31 +1012,42 @@ Public Class hMailServer
objAccount.Active = mailbox.Enabled objAccount.Active = mailbox.Enabled
objAccount.Password = mailbox.Password objAccount.Password = mailbox.Password
objAccount.MaxSize = mailbox.MaxMailboxSize objAccount.MaxSize = mailbox.MaxMailboxSize
objAccount.VacationMessageIsOn = mailbox.ResponderEnabled 'Auto-Responder
objAccount.VacationMessageIsOn = mailbox.ResponderEnabled
objAccount.VacationSubject = mailbox.ResponderSubject objAccount.VacationSubject = mailbox.ResponderSubject
objAccount.VacationMessage = mailbox.ResponderMessage objAccount.VacationMessage = mailbox.ResponderMessage
'Personal Information objAccount.VacationMessageExpires = False
objAccount.PersonFirstName = mailbox.FirstName If mailbox.ResponderExpires Then
objAccount.PersonLastName = mailbox.LastName If IsDate(mailbox.ResponderExpirationDate) Then
'Signature objAccount.VacationMessageExpires = True
objAccount.SignatureEnabled = mailbox.SignatureEnabled objAccount.VacationMessageExpiresDate = mailbox.ResponderExpirationDate.Substring(0, 10)
objAccount.SignaturePlainText = mailbox.Signature End If
objAccount.SignatureHTML = mailbox.SignatureHTML 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 ' set account rules
objAccount.ForwardAddress = mailbox.ForwardingAddresses(0) SetAccountRules(mailbox, objAccount)
objAccount.ForwardKeepOriginal = mailbox.RetainLocalCopy
objAccount.ForwardEnabled = True
End If
objAccount.Save() Catch ex As Exception
Log.WriteError("Couldn't update an account.", ex)
' set account rules End Try
SetAccountRules(mailbox, objAccount)
Catch ex As Exception
Log.WriteError("Couldn't update an account.", ex)
End Try
End If End If
End Sub End Sub
@ -1169,7 +1217,119 @@ Public Class hMailServer
End Try End Try
End If End If
Next 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) Public Overrides Sub DeleteServiceItems(ByVal items() As ServiceProviderItem)
For Each item As ServiceProviderItem In items For Each item As ServiceProviderItem In items

View file

@ -343,7 +343,7 @@ namespace WebsitePanel.Providers.Statistics
string[] split = versionNumber.Split(new char[] { '.' }); 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); }); Array.ForEach(versionKeys, (x) => { Log.WriteInfo("MSDeploy version key found: {0}", x); });
// Determine appropriate key name to query for // Determine appropriate key name to query for
var installPathKey = (IntPtr.Size == 8) ? "InstallPath" : "InstallPath_x86"; 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 fileVersion = String.Empty;
// //
var libPath = String.Empty; var libPath = String.Empty;

View file

@ -112,10 +112,10 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <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>
<resheader name="writer"> <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> </resheader>
<data name="cbSignatureEnabled.Text" xml:space="preserve"> <data name="cbSignatureEnabled.Text" xml:space="preserve">
<value>Yes</value> <value>Yes</value>
@ -165,4 +165,37 @@
<data name="Signature.Text" xml:space="preserve"> <data name="Signature.Text" xml:space="preserve">
<value>Signature</value> <value>Signature</value>
</data> </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> </root>

View file

@ -1,6 +1,45 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="hMailServer43_EditAccount.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.hMailServer43_EditAccount" %> <%@ 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" %> <%@ 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" <wsp:CollapsiblePanel id="secPersonalInfo" runat="server"
TargetControlID="PersonalInfoPanel" meta:resourcekey="secPersonalInfo" Text="Personal Information"> TargetControlID="PersonalInfoPanel" meta:resourcekey="secPersonalInfo" Text="Personal Information">
</wsp:CollapsiblePanel> </wsp:CollapsiblePanel>
@ -8,15 +47,15 @@
<asp:Panel ID="PersonalInfoPanel" runat="server" Height="0" style="overflow:hidden;"> <asp:Panel ID="PersonalInfoPanel" runat="server" Height="0" style="overflow:hidden;">
<table width="100%"> <table width="100%">
<tr> <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> <asp:Label ID="lblFirstName" runat="server" meta:resourcekey="lblFirstName" Text="First Name:"></asp:Label>
</td> </td>
<td class="normal" width="100%"> <td class="normal">
<asp:TextBox ID="txtFirstName" runat="server" Width="200px" CssClass="NormalTextBox"></asp:TextBox> <asp:TextBox ID="txtFirstName" runat="server" Width="200px" CssClass="NormalTextBox"></asp:TextBox>
</td> </td>
</tr> </tr>
<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> <asp:Label ID="lblLastName" runat="server" meta:resourcekey="lblLastName" Text="Last Name:"></asp:Label>
</td> </td>
<td class="normal" valign="top"> <td class="normal" valign="top">
@ -33,23 +72,35 @@
<asp:Panel ID="AutoresponderPanel" runat="server" Height="0" style="overflow:hidden;"> <asp:Panel ID="AutoresponderPanel" runat="server" Height="0" style="overflow:hidden;">
<table width="100%"> <table width="100%">
<tr> <tr>
<td class="SubHead" width="200" nowrap><asp:Label ID="lblResponderEnabled" runat="server" meta:resourcekey="lblResponderEnabled" Text="Autoresponder Enabled:"></asp:Label></td> <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" width="100%"> <td class="normal">
<asp:CheckBox ID="chkResponderEnabled" Runat="server" meta:resourcekey="chkResponderEnabled" Text="Yes"></asp:CheckBox> <asp:CheckBox ID="chkResponderEnabled" Runat="server" meta:resourcekey="chkResponderEnabled" Text="Yes"></asp:CheckBox>
</td> </td>
</tr> </tr>
<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"> <td class="normal" vAlign="top">
<asp:TextBox id="txtSubject" runat="server" Width="400px" CssClass="NormalTextBox"></asp:TextBox> <asp:TextBox id="txtSubject" runat="server" Width="400px" CssClass="NormalTextBox"></asp:TextBox>
</td> </td>
</tr> </tr>
<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"> <td class="normal">
<asp:TextBox id="txtMessage" runat="server" Width="400px" TextMode="MultiLine" Rows="5" CssClass="NormalTextBox"></asp:TextBox> <asp:TextBox id="txtMessage" runat="server" Width="400px" TextMode="MultiLine" Rows="5" CssClass="NormalTextBox"></asp:TextBox>
</td> </td>
</tr> </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> </table>
</asp:Panel> </asp:Panel>
@ -59,13 +110,19 @@
<asp:Panel ID="ForwardingPanel" runat="server" Height="0" style="overflow:hidden;"> <asp:Panel ID="ForwardingPanel" runat="server" Height="0" style="overflow:hidden;">
<table width="100%"> <table width="100%">
<tr> <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="SubHead" style="width:150px;" nowrap><asp:Label ID="lblForwardingEnabled" runat="server" meta:resourcekey="lblForwardingEnabled" Text="Forwarding Enabled:"></asp:Label></td>
<td class="normal" width="100%" valign="top"> <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> <asp:TextBox id="txtForward" runat="server" Width="200px" CssClass="NormalTextBox"></asp:TextBox>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="SubHead"> <td class="SubHead" style="width:150px;">
</td> </td>
<td class="Normal"> <td class="Normal">
<asp:CheckBox ID="chkOriginalMessage" runat="server" meta:resourcekey="chkOriginalMessage" <asp:CheckBox ID="chkOriginalMessage" runat="server" meta:resourcekey="chkOriginalMessage"

View file

@ -50,9 +50,16 @@ namespace WebsitePanel.Portal.ProviderControls
public void BindItem(MailAccount item) 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; txtSubject.Text = item.ResponderSubject;
txtMessage.Text = item.ResponderMessage; txtMessage.Text = item.ResponderMessage;
chkForwardingEnabled.Checked = item.ForwardingEnabled;
txtForward.Text = item.ForwardingAddresses[0]; txtForward.Text = item.ForwardingAddresses[0];
chkOriginalMessage.Checked = item.RetainLocalCopy; chkOriginalMessage.Checked = item.RetainLocalCopy;
txtFirstName.Text = item.FirstName; txtFirstName.Text = item.FirstName;
@ -60,14 +67,21 @@ namespace WebsitePanel.Portal.ProviderControls
cbSignatureEnabled.Checked = item.SignatureEnabled; cbSignatureEnabled.Checked = item.SignatureEnabled;
txtPlainSignature.Text = item.Signature; txtPlainSignature.Text = item.Signature;
txtHtmlSignature.Text = item.SignatureHTML; txtHtmlSignature.Text = item.SignatureHTML;
secStatusInfo.IsCollapsed = false;
} }
public void SaveItem(MailAccount item) public void SaveItem(MailAccount item)
{ {
item.Enabled = chkEnabled.Checked;
item.ResponderEnabled = chkResponderEnabled.Checked; item.ResponderEnabled = chkResponderEnabled.Checked;
item.ResponderSubject = txtSubject.Text; item.ResponderSubject = txtSubject.Text;
item.ResponderMessage = txtMessage.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.RetainLocalCopy = chkOriginalMessage.Checked;
item.FirstName = txtFirstName.Text; item.FirstName = txtFirstName.Text;
item.LastName = txtLastName.Text; item.LastName = txtLastName.Text;

View file

@ -12,6 +12,96 @@ namespace WebsitePanel.Portal.ProviderControls {
public partial class hMailServer43_EditAccount { 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> /// <summary>
/// secPersonalInfo control. /// secPersonalInfo control.
/// </summary> /// </summary>
@ -138,6 +228,42 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtMessage; 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> /// <summary>
/// secForwarding control. /// secForwarding control.
/// </summary> /// </summary>
@ -156,6 +282,24 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Panel ForwardingPanel; 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> /// <summary>
/// lblForwardTo control. /// lblForwardTo control.
/// </summary> /// </summary>