Ejemplo n.º 1
0
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                Logging_Settings settings = m_pVirtualServer.SystemSettings.Logging;

                settings.LogSMTP               = m_pLogSMTP.Checked;
                settings.SmtpLogsPath          = m_pSMTPLogPath.Text;
                settings.LogPOP3               = m_pLogPOP3.Checked;
                settings.Pop3LogsPath          = m_pPOP3LogPath.Text;
                settings.LogIMAP               = m_pLogIMAP.Checked;
                settings.ImapLogsPath          = m_pIMAPLogPath.Text;
                settings.LogRelay              = m_pLogRelay.Checked;
                settings.RelayLogsPath         = m_pRelayLogPath.Text;
                settings.LogFetchMessages      = m_pLogFetchPOP3.Checked;
                settings.FetchMessagesLogsPath = m_pFetchPOP3LogPath.Text;

                if (m_pVirtualServer.SystemSettings.HasChanges)
                {
                    if (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Savves system general settings.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                System_Settings settings = m_pVirtualServer.SystemSettings;

                List <IPAddress> dnsServers = new List <IPAddress>();
                foreach (ListViewItem item in m_pTabGeneral_DnsServers.Items)
                {
                    dnsServers.Add(IPAddress.Parse(item.Text));
                }
                settings.DnsServers = dnsServers.ToArray();

                if (m_pVirtualServer.SystemSettings.HasChanges)
                {
                    if (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                IMAP_Settings settings = m_pVirtualServer.SystemSettings.IMAP;

                settings.Enabled                 = m_pEnabled.Checked;
                settings.GreetingText            = m_pGreetingText.Text;
                settings.SessionIdleTimeOut      = (int)m_pSessionTimeout.Value;
                settings.MaximumConnections      = (int)m_pMaxConnections.Value;
                settings.MaximumConnectionsPerIP = (int)m_pMaxConnsPerIP.Value;
                settings.MaximumBadCommands      = (int)m_pMaxBadCommands.Value;                // IP binds
                List <IPBindInfo> binds = new List <IPBindInfo>();
                foreach (ListViewItem it in m_pTabGeneral_Bindings.Items)
                {
                    binds.Add((IPBindInfo)it.Tag);
                }
                settings.Binds = binds.ToArray();

                if (m_pVirtualServer.SystemSettings.HasChanges)
                {
                    if (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 4
0
        private void m_pOk_Click(object sender, EventArgs e)
        {
            try{
                if (m_pDomainName.Text.Length <= 0)
                {
                    MessageBox.Show("Domain name cannot be empty!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                // Add new domain.
                if (m_pDomain == null)
                {
                    m_pDomain = m_pVirtualServer.Domains.Add(
                        m_pDomainName.Text,
                        m_pDescription.Text
                        );
                }
                // Update domain.
                else
                {
                    m_pDomain.DomainName  = m_pDomainName.Text;
                    m_pDomain.Description = m_pDescription.Text;
                    m_pDomain.Commit();
                }

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                Relay_Settings settings = m_pVirtualServer.SystemSettings.Relay;

                if (m_pTabGeneral_SendSmartHost.Checked)
                {
                    settings.RelayMode = Relay_Mode.SmartHost;
                }
                else
                {
                    settings.RelayMode = Relay_Mode.Dns;
                }
                if (m_pTabGeneral_SmartHostsBalanceMode.SelectedIndex == 0)
                {
                    settings.SmartHostsBalanceMode = BalanceMode.LoadBalance;
                }
                else
                {
                    settings.SmartHostsBalanceMode = BalanceMode.FailOver;
                }
                settings.SessionIdleTimeOut          = (int)m_pTabGeneral_SessionTimeout.Value;
                settings.MaximumConnections          = (int)m_pTabGeneral_MaxConnections.Value;
                settings.MaximumConnectionsPerIP     = (int)m_pTabGeneral_MaxConnsPerIP.Value;
                settings.RelayInterval               = (int)m_pTabGeneral_RelayInterval.Value;
                settings.RelayRetryInterval          = (int)m_pTabGeneral_RelayRetryInterval.Value;
                settings.SendUndeliveredWarningAfter = (int)m_pTabGeneral_SendUndelWarning.Value;
                settings.SendUndeliveredAfter        = (int)m_pTabGeneral_SendUndelivered.Value;
                settings.StoreUndeliveredMessages    = m_pTabGeneral_StoreUndeliveredMsgs.Checked;
                settings.UseTlsIfPossible            = m_pTabGeneral_UseTlsIfPossible.Checked;
                // Smart hosts
                List <Relay_SmartHost> smartHosts = new List <Relay_SmartHost>();
                foreach (ListViewItem it in m_pTabGeneral_SmartHosts.Items)
                {
                    smartHosts.Add((Relay_SmartHost)it.Tag);
                }
                settings.SmartHosts = smartHosts.ToArray();
                // IP binds
                List <IPBindInfo> binds = new List <IPBindInfo>();
                foreach (ListViewItem it in m_pTabBindings_Bindings.Items)
                {
                    binds.Add((IPBindInfo)it.Tag);
                }
                settings.Binds = binds.ToArray();

                if (m_pVirtualServer.SystemSettings.HasChanges)
                {
                    if (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                SIP_Settings settings = m_pVirtualServer.SystemSettings.SIP;

                m_pTabGeneral_Enabled.Checked = settings.Enabled;
                if ((settings.ProxyMode & LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.B2BUA) != 0)
                {
                    m_pTabGeneral_ProxyType.SelectedIndex = 0;
                }
                else
                {
                    m_pTabGeneral_ProxyType.SelectedIndex = 1;
                }
                m_pTabGeneral_MinExpires.Value = Convert.ToDecimal(settings.MinimumExpires);

                foreach (IPBindInfo binding in settings.Binds)
                {
                    ListViewItem it = new ListViewItem();
                    it.Text = binding.HostName;
                    if (binding.IP.ToString() == "0.0.0.0")
                    {
                        it.SubItems.Add("Any IPv4");
                    }
                    else if (binding.IP.ToString() == "0:0:0:0:0:0:0:0")
                    {
                        it.SubItems.Add("Any IPv6");
                    }
                    else
                    {
                        it.SubItems.Add(binding.IP.ToString());
                    }
                    it.SubItems.Add(binding.Protocol.ToString());
                    it.SubItems.Add(binding.Port.ToString());
                    it.SubItems.Add(binding.SslMode.ToString());
                    it.SubItems.Add(Convert.ToString(binding.Certificate != null));
                    it.Tag = binding;
                    m_pTabGeneral_Bindings.Items.Add(it);
                }

                foreach (SIP_Gateway gw in m_pVirtualServer.SystemSettings.SIP.Gateways)
                {
                    ListViewItem item = new ListViewItem(gw.UriScheme);
                    item.SubItems.Add(gw.Transport);
                    item.SubItems.Add(gw.Host);
                    item.SubItems.Add(gw.Port.ToString());
                    item.Tag = gw;
                    m_pTabGateways_Gateways.Items.Add(item);
                }

                m_pTabGateways_Gateways_SelectedIndexChanged(null, null);
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                FetchMessages_Settings settings = m_pVirtualServer.SystemSettings.FetchMessages;

                m_pEnabled.Checked     = settings.Enabled;
                m_pFetchInterval.Value = settings.FetchInterval;
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 8
0
        private void wfrm_User_FolderProperties_VisibleChanged(object sender, EventArgs e)
        {
            if (this.Visible)
            {
                return;
            }

            try{
                // Apply changes
                foreach (UserFolderAcl acl in m_pFolder.ACL)
                {
                    acl.Commit();
                }

                //--- See if sharing data changed ------------------------------------------------------------
                // Sharing removed
                if (m_pTab_Sharing_DontShare.Checked && m_ShareName != "")
                {
                    SharedRootFolder root = m_pVirtualServer.RootFolders.GetRootFolderByName(m_ShareName);
                    root.Owner.Remove(root);
                }
                else if (m_pTab_Sharing_Share.Checked && m_ShareName != m_pTab_Sharing_ShareName.Text)
                {
                    // Update shared root folder info
                    if (m_pVirtualServer.RootFolders.Contains(m_ShareName))
                    {
                        SharedRootFolder root = m_pVirtualServer.RootFolders.GetRootFolderByName(m_ShareName);
                        root.Enabled = true;
                        root.Name    = m_pTab_Sharing_ShareName.Text;
                        root.Commit();
                    }
                    // Add new shared root folder
                    else
                    {
                        m_pVirtualServer.RootFolders.Add(
                            true,
                            m_pTab_Sharing_ShareName.Text,
                            "",
                            SharedFolderRootType_enum.BoundedRootFolder,
                            m_pFolder.User.UserName,
                            m_pFolder.FolderFullPath
                            );
                    }
                }
                //-------------------------------------------------------------------------------------------
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(null);
            }
        }
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                SMTP_Settings settings = m_pVirtualServer.SystemSettings.SMTP;

                m_pEnabled.Checked       = settings.Enabled;
                m_pGreetingText.Text     = settings.GreetingText;
                m_pDefaultDomain.Text    = settings.DefaultDomain;
                m_pSessionTimeout.Value  = settings.SessionIdleTimeOut;
                m_pMaxConnections.Value  = settings.MaximumConnections;
                m_pMaxConnsPerIP.Value   = settings.MaximumConnectionsPerIP;
                m_pMaxBadCommands.Value  = settings.MaximumBadCommands;
                m_pMaxMessageSize.Value  = settings.MaximumMessageSize;
                m_pMaxRecipients.Value   = settings.MaximumRecipientsPerMessage;
                m_pMaxTransactions.Value = settings.MaximumTransactions;
                m_pRequireAuth.Checked   = settings.RequireAuthentication;

                foreach (IPBindInfo binding in settings.Binds)
                {
                    ListViewItem it = new ListViewItem();
                    it.Text = binding.HostName;
                    if (binding.IP.ToString() == "0.0.0.0")
                    {
                        it.SubItems.Add("Any IPv4");
                    }
                    else if (binding.IP.ToString() == "0:0:0:0:0:0:0:0")
                    {
                        it.SubItems.Add("Any IPv6");
                    }
                    else
                    {
                        it.SubItems.Add(binding.IP.ToString());
                    }
                    it.SubItems.Add(binding.Port.ToString());
                    it.SubItems.Add(binding.SslMode.ToString());
                    it.SubItems.Add(Convert.ToString(binding.Certificate != null));
                    it.Tag = binding;
                    m_pTabGeneral_Bindings.Items.Add(it);
                }

                m_pTabGeneral_Bindings_SelectedIndexChanged(this, new EventArgs());
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Loads system general settings to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                System_Settings settings = m_pVirtualServer.SystemSettings;

                foreach (IPAddress ip in settings.DnsServers)
                {
                    ListViewItem it = new ListViewItem(ip.ToString());
                    m_pTabGeneral_DnsServers.Items.Add(it);
                }

                AddNotifications();
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                Auth_Settings settings = m_pVirtualServer.SystemSettings.Authentication;

                m_pAuthenticationType.SelectedIndex = Convert.ToInt32(settings.AuthenticationType) - 1;
                m_pDomainName.Text = settings.WinDomain;
                m_pLdapServer.Text = settings.LdapServer;
                m_pLdapDN.Text     = settings.LdapDn;

                if (m_pLdapDN.Text == "")
                {
                    m_pLdapDN.Text = "CN=%user,DC=domain,DC=com";
                }
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                FetchMessages_Settings settings = m_pVirtualServer.SystemSettings.FetchMessages;

                settings.Enabled       = m_pEnabled.Checked;
                settings.FetchInterval = (int)m_pFetchInterval.Value;

                if (m_pVirtualServer.SystemSettings.HasChanges)
                {
                    if (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                Logging_Settings settings = m_pVirtualServer.SystemSettings.Logging;

                m_pLogSMTP.Checked       = settings.LogSMTP;
                m_pSMTPLogPath.Text      = settings.SmtpLogsPath;
                m_pLogPOP3.Checked       = settings.LogPOP3;
                m_pPOP3LogPath.Text      = settings.Pop3LogsPath;
                m_pLogIMAP.Checked       = settings.LogIMAP;
                m_pIMAPLogPath.Text      = settings.ImapLogsPath;
                m_pLogRelay.Checked      = settings.LogRelay;
                m_pRelayLogPath.Text     = settings.RelayLogsPath;
                m_pLogFetchPOP3.Checked  = settings.LogFetchMessages;
                m_pFetchPOP3LogPath.Text = settings.FetchMessagesLogsPath;
                //m_pServerLogPath.Text    = dr["Server_LogPath"].ToString();
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                Auth_Settings settings = m_pVirtualServer.SystemSettings.Authentication;

                settings.AuthenticationType = (ServerAuthenticationType_enum)(m_pAuthenticationType.SelectedIndex + 1);
                settings.WinDomain          = m_pDomainName.Text;
                settings.LdapServer         = m_pLdapServer.Text;
                settings.LdapDn             = m_pLdapDN.Text;

                if (m_pVirtualServer.SystemSettings.HasChanges)
                {
                    if (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 15
0
        private void m_pOk_Click(object sender, EventArgs e)
        {
            //--- Validate values ---------------------------------------------------//
            if (m_pFolderName.Text == "")
            {
                MessageBox.Show("Folder name cannot be empty!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            //-----------------------------------------------------------------------//

            try{
                m_pVirtualServer.UsersDefaultFolders.Add(
                    m_pFolderName.Text,
                    m_pPermanent.Checked
                    );

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                SIP_Settings settings = m_pVirtualServer.SystemSettings.SIP;

                settings.Enabled = m_pTabGeneral_Enabled.Checked;
                if (m_pTabGeneral_ProxyType.SelectedIndex == 0)
                {
                    settings.ProxyMode = LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.Registrar | LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.B2BUA;
                }
                else
                {
                    settings.ProxyMode = LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.Registrar | LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.Statefull;
                }
                settings.MinimumExpires = (int)m_pTabGeneral_MinExpires.Value;
                // IP binds
                List <IPBindInfo> binds = new List <IPBindInfo>();
                foreach (ListViewItem it in m_pTabGeneral_Bindings.Items)
                {
                    binds.Add((IPBindInfo)it.Tag);
                }
                settings.Binds = binds.ToArray();

                if (m_pVirtualServer.SystemSettings.HasChanges)
                {
                    if (!confirmSave || MessageBox.Show(this, "You have changes settings, do you want to save them ?", "Confirm:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
        private void wfrm_User_FolderProperties_FormClosing(object sender, FormClosingEventArgs e)
        {
            try{
                // See if permissions has chanhed, if so update them,
                if(m_pTab_Security_UsersOrGroups.SelectedItems.Count > 0){
                    //--- Construct ACl flags ---------------//
                    IMAP_ACL_Flags acl = IMAP_ACL_Flags.None;
                    if(m_pTab_Security_Permissions.Items[0].Checked){
                        acl |= IMAP_ACL_Flags.a;
                    }
                    if(m_pTab_Security_Permissions.Items[1].Checked){
                        acl |= IMAP_ACL_Flags.l;
                    }
                    if(m_pTab_Security_Permissions.Items[2].Checked){
                        acl |= IMAP_ACL_Flags.c;
                    }
                    if(m_pTab_Security_Permissions.Items[3].Checked){
                        acl |= IMAP_ACL_Flags.r;
                    }
                    if(m_pTab_Security_Permissions.Items[4].Checked){
                        acl |= IMAP_ACL_Flags.i | IMAP_ACL_Flags.p;
                    }
                    if(m_pTab_Security_Permissions.Items[5].Checked){
                        acl |= IMAP_ACL_Flags.d;
                    }
                    if(m_pTab_Security_Permissions.Items[6].Checked){
                        acl |= IMAP_ACL_Flags.w | IMAP_ACL_Flags.s;
                    }
                    //--------------------------------------//

                    UserFolderAcl aclEntry = (UserFolderAcl)m_pTab_Security_UsersOrGroups.SelectedItems[0].Tag;
                    if(aclEntry.Permissions != acl){
                        aclEntry.Permissions = acl;
                        aclEntry.Commit();
                    }
                }

                //--- See if sharing data changed ------------------------------------------------------------
                // Sharing removed
                if(m_pTab_Sharing_DontShare.Checked && m_ShareName != ""){
                    SharedRootFolder root = m_pVirtualServer.RootFolders.GetRootFolderByName(m_ShareName);
                    root.Owner.Remove(root);
                }
                else if(m_pTab_Sharing_Share.Checked && m_ShareName != m_pTab_Sharing_ShareName.Text){
                    // Update shared root folder info
                    if(m_pVirtualServer.RootFolders.Contains(m_ShareName)){
                        SharedRootFolder root = m_pVirtualServer.RootFolders.GetRootFolderByName(m_ShareName);
                        root.Enabled = true;
                        root.Name = m_pTab_Sharing_ShareName.Text;
                        root.Commit();
                    }
                    // Add new shared root folder
                    else{
                        m_pVirtualServer.RootFolders.Add(
                            true,
                            m_pTab_Sharing_ShareName.Text,
                            "",
                            SharedFolderRootType_enum.BoundedRootFolder,
                            m_pFolder.User.UserName,
                            m_pFolder.FolderFullPath
                        );
                    }
                }
                //-------------------------------------------------------------------------------------------
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(null);

                if(MessageBox.Show(this,"Do you want to reconfigure ?","Confirmation",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                    e.Cancel = true;
                }
            }
        }
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                SIP_Settings settings = m_pVirtualServer.SystemSettings.SIP;

                m_pEnabled.Checked  = settings.Enabled;
                m_pHostName.Text    = settings.HostName;
                m_pMinExpires.Value = Convert.ToDecimal(settings.MinimumExpires);

                foreach(BindInfo binding in settings.Binds){
                    ListViewItem it = new ListViewItem();
                    it.Text = binding.Protocol;
                    if(binding.IP.ToString() == "0.0.0.0"){
                        it.SubItems.Add("Any IPv4");
                    }
                    else if(binding.IP.ToString() == "0:0:0:0:0:0:0:0"){
                        it.SubItems.Add("Any IPv6");
                    }
                    else{
                        it.SubItems.Add(binding.IP.ToString());
                    }
                    it.SubItems.Add(binding.Port.ToString());
                    it.SubItems.Add(binding.SSL.ToString());
                    it.SubItems.Add(Convert.ToString(binding.Certificate != null));
                    it.Tag = binding;
                    m_pBindings.Items.Add(it);
                }
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
				SIP_Settings settings = m_pVirtualServer.SystemSettings.SIP;
            
				m_pTabGeneral_Enabled.Checked = settings.Enabled;
                if((settings.ProxyMode & LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.B2BUA) != 0){
                    m_pTabGeneral_ProxyType.SelectedIndex = 0;
                }
                else{
                    m_pTabGeneral_ProxyType.SelectedIndex = 1;
                }
                m_pTabGeneral_MinExpires.Value = Convert.ToDecimal(settings.MinimumExpires);

                foreach(IPBindInfo binding in settings.Binds){
                    ListViewItem it = new ListViewItem();
                    it.Text = binding.HostName;
                    if(binding.IP.ToString() == "0.0.0.0"){
                        it.SubItems.Add("Any IPv4");
                    }
                    else if(binding.IP.ToString() == "0:0:0:0:0:0:0:0"){
                        it.SubItems.Add("Any IPv6");
                    }
                    else{
                        it.SubItems.Add(binding.IP.ToString());
                    }
                    it.SubItems.Add(binding.Protocol.ToString());
                    it.SubItems.Add(binding.Port.ToString());
                    it.SubItems.Add(binding.SslMode.ToString());
                    it.SubItems.Add(Convert.ToString(binding.Certificate != null));
                    it.Tag = binding;
                    m_pTabGeneral_Bindings.Items.Add(it);
                }

                foreach(SIP_Gateway gw in m_pVirtualServer.SystemSettings.SIP.Gateways){
                    ListViewItem item = new ListViewItem(gw.UriScheme);
                    item.SubItems.Add(gw.Transport);
                    item.SubItems.Add(gw.Host);
                    item.SubItems.Add(gw.Port.ToString());
                    item.Tag = gw;
                    m_pTabGateways_Gateways.Items.Add(item);
                }

                m_pTabGateways_Gateways_SelectedIndexChanged(null,null);
			}
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                Relay_Settings settings = m_pVirtualServer.SystemSettings.Relay;

                if (settings.RelayMode == Relay_Mode.SmartHost)
                {
                    m_pTabGeneral_SendSmartHost.Checked = true;
                }
                else
                {
                    m_pTabGeneral_SendDns.Checked = true;
                }
                if (settings.SmartHostsBalanceMode == BalanceMode.LoadBalance)
                {
                    m_pTabGeneral_SmartHostsBalanceMode.SelectedIndex = 0;
                }
                else
                {
                    m_pTabGeneral_SmartHostsBalanceMode.SelectedIndex = 1;
                }
                m_pTabGeneral_SessionTimeout.Value         = settings.SessionIdleTimeOut;
                m_pTabGeneral_MaxConnections.Value         = settings.MaximumConnections;
                m_pTabGeneral_MaxConnsPerIP.Value          = settings.MaximumConnectionsPerIP;
                m_pTabGeneral_RelayInterval.Value          = settings.RelayInterval;
                m_pTabGeneral_RelayRetryInterval.Value     = settings.RelayRetryInterval;
                m_pTabGeneral_SendUndelWarning.Value       = settings.SendUndeliveredWarningAfter;
                m_pTabGeneral_SendUndelivered.Value        = settings.SendUndeliveredAfter;
                m_pTabGeneral_StoreUndeliveredMsgs.Checked = settings.StoreUndeliveredMessages;

                foreach (Relay_SmartHost smartHost in settings.SmartHosts)
                {
                    ListViewItem it = new ListViewItem();
                    it.Text = smartHost.Host;
                    it.SubItems.Add(smartHost.Port.ToString());
                    it.SubItems.Add(smartHost.SslMode.ToString());
                    it.SubItems.Add(smartHost.UserName);
                    it.Tag = smartHost;
                    m_pTabGeneral_SmartHosts.Items.Add(it);
                }

                foreach (IPBindInfo binding in settings.Binds)
                {
                    ListViewItem it = new ListViewItem();
                    it.Text = binding.HostName;
                    if (binding.IP.ToString() == "0.0.0.0")
                    {
                        it.SubItems.Add("Any IPv4");
                    }
                    else if (binding.IP.ToString() == "0:0:0:0:0:0:0:0")
                    {
                        it.SubItems.Add("Any IPv6");
                    }
                    else
                    {
                        it.SubItems.Add(binding.IP.ToString());
                    }
                    it.SubItems.Add(binding.Port.ToString());
                    it.SubItems.Add(binding.SslMode.ToString());
                    it.SubItems.Add(Convert.ToString(binding.Certificate != null));
                    it.Tag = binding;
                    m_pTabBindings_Bindings.Items.Add(it);
                }

                AddNotifications();
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                Logging_Settings settings = m_pVirtualServer.SystemSettings.Logging;

				settings.LogSMTP               = m_pLogSMTP.Checked;
				settings.SmtpLogsPath          = m_pSMTPLogPath.Text;
				settings.LogPOP3               = m_pLogPOP3.Checked;
				settings.Pop3LogsPath          = m_pPOP3LogPath.Text;
				settings.LogIMAP               = m_pLogIMAP.Checked;
				settings.ImapLogsPath          = m_pIMAPLogPath.Text;
				settings.LogRelay              = m_pLogRelay.Checked;
				settings.RelayLogsPath         = m_pRelayLogPath.Text;
				settings.LogFetchMessages      = m_pLogFetchPOP3.Checked;
				settings.FetchMessagesLogsPath = m_pFetchPOP3LogPath.Text;
                
                if(m_pVirtualServer.SystemSettings.HasChanges){
                    if(!confirmSave || MessageBox.Show(this,"You have changes settings, do you want to save them ?","Confirm:",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
Ejemplo n.º 22
0
        private void wfrm_User_FolderProperties_FormClosing(object sender, FormClosingEventArgs e)
        {
            try{
                // See if permissions has chanhed, if so update them,
                if (m_pTab_Security_UsersOrGroups.SelectedItems.Count > 0)
                {
                    //--- Construct ACl flags ---------------//
                    IMAP_ACL_Flags acl = IMAP_ACL_Flags.None;
                    if (m_pTab_Security_Permissions.Items[0].Checked)
                    {
                        acl |= IMAP_ACL_Flags.a;
                    }
                    if (m_pTab_Security_Permissions.Items[1].Checked)
                    {
                        acl |= IMAP_ACL_Flags.l;
                    }
                    if (m_pTab_Security_Permissions.Items[2].Checked)
                    {
                        acl |= IMAP_ACL_Flags.c;
                    }
                    if (m_pTab_Security_Permissions.Items[3].Checked)
                    {
                        acl |= IMAP_ACL_Flags.r;
                    }
                    if (m_pTab_Security_Permissions.Items[4].Checked)
                    {
                        acl |= IMAP_ACL_Flags.i | IMAP_ACL_Flags.p;
                    }
                    if (m_pTab_Security_Permissions.Items[5].Checked)
                    {
                        acl |= IMAP_ACL_Flags.d;
                    }
                    if (m_pTab_Security_Permissions.Items[6].Checked)
                    {
                        acl |= IMAP_ACL_Flags.w | IMAP_ACL_Flags.s;
                    }
                    //--------------------------------------//

                    UserFolderAcl aclEntry = (UserFolderAcl)m_pTab_Security_UsersOrGroups.SelectedItems[0].Tag;
                    if (aclEntry.Permissions != acl)
                    {
                        aclEntry.Permissions = acl;
                        aclEntry.Commit();
                    }
                }

                //--- See if sharing data changed ------------------------------------------------------------
                // Sharing removed
                if (m_pTab_Sharing_DontShare.Checked && m_ShareName != "")
                {
                    SharedRootFolder root = m_pVirtualServer.RootFolders.GetRootFolderByName(m_ShareName);
                    root.Owner.Remove(root);
                }
                else if (m_pTab_Sharing_Share.Checked && m_ShareName != m_pTab_Sharing_ShareName.Text)
                {
                    // Update shared root folder info
                    if (m_pVirtualServer.RootFolders.Contains(m_ShareName))
                    {
                        SharedRootFolder root = m_pVirtualServer.RootFolders.GetRootFolderByName(m_ShareName);
                        root.Enabled = true;
                        root.Name    = m_pTab_Sharing_ShareName.Text;
                        root.Commit();
                    }
                    // Add new shared root folder
                    else
                    {
                        m_pVirtualServer.RootFolders.Add(
                            true,
                            m_pTab_Sharing_ShareName.Text,
                            "",
                            SharedFolderRootType_enum.BoundedRootFolder,
                            m_pFolder.User.UserName,
                            m_pFolder.FolderFullPath
                            );
                    }
                }
                //-------------------------------------------------------------------------------------------
            }
            catch (Exception x) {
                wfrm_sys_Error frm = new wfrm_sys_Error(x, new System.Diagnostics.StackTrace());
                frm.ShowDialog(null);

                if (MessageBox.Show(this, "Do you want to reconfigure ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    e.Cancel = true;
                }
            }
        }
Ejemplo n.º 23
0
Archivo: MainX.cs Proyecto: dioptre/nkd
        private static void Application_ThreadException(object sender,ThreadExceptionEventArgs e)
        {
            wfrm_sys_Error frm = new wfrm_sys_Error(e.Exception,new System.Diagnostics.StackTrace());
			frm.ShowDialog(null);
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                IMAP_Settings settings = m_pVirtualServer.SystemSettings.IMAP;
 
				m_pEnabled.Checked      = settings.Enabled;
                m_pGreetingText.Text    = settings.GreetingText;
				m_pSessionTimeout.Value = settings.SessionIdleTimeOut;
				m_pMaxConnections.Value = settings.MaximumConnections;
                m_pMaxConnsPerIP.Value  = settings.MaximumConnectionsPerIP;
				m_pMaxBadCommands.Value = settings.MaximumBadCommands;
                
                foreach(IPBindInfo binding in settings.Binds){                    
                    ListViewItem it = new ListViewItem();
                    it.Text = binding.HostName;
                    if(binding.IP.ToString() == "0.0.0.0"){
                        it.SubItems.Add("Any IPv4");
                    }
                    else if(binding.IP.ToString() == "0:0:0:0:0:0:0:0"){
                        it.SubItems.Add("Any IPv6");
                    }
                    else{
                        it.SubItems.Add(binding.IP.ToString());
                    }
                    it.SubItems.Add(binding.Port.ToString());
                    it.SubItems.Add(binding.SslMode.ToString());
                    it.SubItems.Add(Convert.ToString(binding.Certificate != null));
                    it.Tag = binding;
                    m_pTabGeneral_Bindings.Items.Add(it);
                }

                m_pTabGeneral_Bindings_SelectedIndexChanged(this,new EventArgs());
			}
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Loads system general settings to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                System_Settings settings = m_pVirtualServer.SystemSettings;
                
                foreach(IPAddress ip in settings.DnsServers){
                    ListViewItem it = new ListViewItem(ip.ToString());
                    m_pTabGeneral_DnsServers.Items.Add(it);
                }

                AddNotifications();
            }
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                SIP_Settings settings = m_pVirtualServer.SystemSettings.SIP;

                settings.Enabled        = m_pEnabled.Checked;
                settings.HostName       = m_pHostName.Text;
                settings.MinimumExpires = (int)m_pMinExpires.Value;
                // IP binds
                List<BindInfo> binds = new List<BindInfo>();
                foreach(ListViewItem it in m_pBindings.Items){
                    binds.Add((BindInfo)it.Tag);
                }
                settings.Binds = binds.ToArray();

                if(m_pVirtualServer.SystemSettings.HasChanges){
                    if(!confirmSave || MessageBox.Show(this,"You have changes settings, do you want to save them ?","Confirm:",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {            
            try{
                Relay_Settings settings =  m_pVirtualServer.SystemSettings.Relay;
 		
				if(settings.RelayMode == Relay_Mode.SmartHost){
					m_pTabGeneral_SendSmartHost.Checked = true;
				}
				else{
					m_pTabGeneral_SendDns.Checked = true;
				}
                if(settings.SmartHostsBalanceMode == BalanceMode.LoadBalance){
                    m_pTabGeneral_SmartHostsBalanceMode.SelectedIndex = 0;
                }
                else{
                    m_pTabGeneral_SmartHostsBalanceMode.SelectedIndex = 1;
                }
                m_pTabGeneral_SessionTimeout.Value         = settings.SessionIdleTimeOut;
				m_pTabGeneral_MaxConnections.Value         = settings.MaximumConnections;
                m_pTabGeneral_MaxConnsPerIP.Value          = settings.MaximumConnectionsPerIP;
				m_pTabGeneral_RelayInterval.Value          = settings.RelayInterval;
				m_pTabGeneral_RelayRetryInterval.Value     = settings.RelayRetryInterval;
				m_pTabGeneral_SendUndelWarning.Value       = settings.SendUndeliveredWarningAfter;
				m_pTabGeneral_SendUndelivered.Value        = settings.SendUndeliveredAfter;
				m_pTabGeneral_StoreUndeliveredMsgs.Checked = settings.StoreUndeliveredMessages;

                foreach(Relay_SmartHost smartHost in settings.SmartHosts){
                    ListViewItem it = new ListViewItem();
                    it.Text = smartHost.Host;
                    it.SubItems.Add(smartHost.Port.ToString());
                    it.SubItems.Add(smartHost.SslMode.ToString());
                    it.SubItems.Add(smartHost.UserName);
                    it.Tag = smartHost;
                    m_pTabGeneral_SmartHosts.Items.Add(it);
                }

                foreach(IPBindInfo binding in settings.Binds){
                    ListViewItem it = new ListViewItem();
                    it.Text = binding.HostName;
                    if(binding.IP.ToString() == "0.0.0.0"){
                        it.SubItems.Add("Any IPv4");
                    }
                    else if(binding.IP.ToString() == "0:0:0:0:0:0:0:0"){
                        it.SubItems.Add("Any IPv6");
                    }
                    else{
                        it.SubItems.Add(binding.IP.ToString());
                    }
                    it.SubItems.Add(binding.Port.ToString());
                    it.SubItems.Add(binding.SslMode.ToString());
                    it.SubItems.Add(Convert.ToString(binding.Certificate != null));
                    it.Tag = binding;
                    m_pTabBindings_Bindings.Items.Add(it);
                }

                AddNotifications();
			}
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
        private void wfrm_User_FolderProperties_VisibleChanged(object sender,EventArgs e)
        {
            if(this.Visible){
                return;
            }

            try{
                // Apply changes
                foreach(UserFolderAcl acl in m_pFolder.ACL){
                    acl.Commit();
                }

                //--- See if sharing data changed ------------------------------------------------------------
                // Sharing removed
                if(m_pTab_Sharing_DontShare.Checked && m_ShareName != ""){
                    SharedRootFolder root = m_pVirtualServer.RootFolders.GetRootFolderByName(m_ShareName);
                    root.Owner.Remove(root);
                }
                else if(m_pTab_Sharing_Share.Checked && m_ShareName != m_pTab_Sharing_ShareName.Text){
                    // Update shared root folder info
                    if(m_pVirtualServer.RootFolders.Contains(m_ShareName)){
                        SharedRootFolder root = m_pVirtualServer.RootFolders.GetRootFolderByName(m_ShareName);
                        root.Enabled = true;
                        root.Name = m_pTab_Sharing_ShareName.Text;
                        root.Commit();
                    }
                    // Add new shared root folder
                    else{
                        m_pVirtualServer.RootFolders.Add(
                            true,
                            m_pTab_Sharing_ShareName.Text,
                            "",
                            SharedFolderRootType_enum.BoundedRootFolder,
                            m_pFolder.User.UserName,
                            m_pFolder.FolderFullPath
                        );
                    }
                }
                //-------------------------------------------------------------------------------------------
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(null);
            }
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                Relay_Settings settings =  m_pVirtualServer.SystemSettings.Relay;
 		
                if(m_pTabGeneral_SendSmartHost.Checked){
				    settings.RelayMode               = Relay_Mode.SmartHost;
                }
                else{
                    settings.RelayMode               = Relay_Mode.Dns;
                }
                if(m_pTabGeneral_SmartHostsBalanceMode.SelectedIndex == 0){
                    settings.SmartHostsBalanceMode   = BalanceMode.LoadBalance;
                }
                else{
                    settings.SmartHostsBalanceMode   = BalanceMode.FailOver;
                }
                settings.SessionIdleTimeOut          = (int)m_pTabGeneral_SessionTimeout.Value;
				settings.MaximumConnections          = (int)m_pTabGeneral_MaxConnections.Value;
                settings.MaximumConnectionsPerIP     = (int)m_pTabGeneral_MaxConnsPerIP.Value;
				settings.RelayInterval               = (int)m_pTabGeneral_RelayInterval.Value;
				settings.RelayRetryInterval          = (int)m_pTabGeneral_RelayRetryInterval.Value;
				settings.SendUndeliveredWarningAfter = (int)m_pTabGeneral_SendUndelWarning.Value;
				settings.SendUndeliveredAfter        = (int)m_pTabGeneral_SendUndelivered.Value;
				settings.StoreUndeliveredMessages    = m_pTabGeneral_StoreUndeliveredMsgs.Checked;
                // Smart hosts
                List<Relay_SmartHost> smartHosts = new List<Relay_SmartHost>();
                foreach(ListViewItem it in m_pTabGeneral_SmartHosts.Items){
                    smartHosts.Add((Relay_SmartHost)it.Tag);
                }
                settings.SmartHosts = smartHosts.ToArray();
                // IP binds
                List<IPBindInfo> binds = new List<IPBindInfo>();
                foreach(ListViewItem it in m_pTabBindings_Bindings.Items){
                    binds.Add((IPBindInfo)it.Tag);
                }
                settings.Binds = binds.ToArray();
                               
                if(m_pVirtualServer.SystemSettings.HasChanges){
                    if(!confirmSave || MessageBox.Show(this,"You have changes settings, do you want to save them ?","Confirm:",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Savves system general settings.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                System_Settings settings = m_pVirtualServer.SystemSettings;

                List<IPAddress> dnsServers = new List<IPAddress>();
                foreach(ListViewItem item in m_pTabGeneral_DnsServers.Items){
                    dnsServers.Add(IPAddress.Parse(item.Text));
                }
                settings.DnsServers = dnsServers.ToArray();

                if(m_pVirtualServer.SystemSettings.HasChanges){
                    if(!confirmSave || MessageBox.Show(this,"You have changes settings, do you want to save them ?","Confirm:",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }            
            }
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
Ejemplo n.º 31
0
        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            wfrm_sys_Error frm = new wfrm_sys_Error((Exception)e.ExceptionObject, new System.Diagnostics.StackTrace());

            frm.ShowDialog(null);
        }
Ejemplo n.º 32
0
Archivo: MainX.cs Proyecto: dioptre/nkd
        private static void CurrentDomain_UnhandledException(object sender,UnhandledExceptionEventArgs e)
        {
            wfrm_sys_Error frm = new wfrm_sys_Error((Exception)e.ExceptionObject,new System.Diagnostics.StackTrace());
			frm.ShowDialog(null);
        }
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                Auth_Settings settings = m_pVirtualServer.SystemSettings.Authentication;

                m_pAuthenticationType.SelectedIndex = Convert.ToInt32(settings.AuthenticationType) - 1;
                m_pDomainName.Text                  = settings.WinDomain;
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 34
0
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                IMAP_Settings settings = m_pVirtualServer.SystemSettings.IMAP;
 
				settings.Enabled                 = m_pEnabled.Checked;
                settings.GreetingText            = m_pGreetingText.Text;
				settings.SessionIdleTimeOut      = (int)m_pSessionTimeout.Value ;
				settings.MaximumConnections      = (int)m_pMaxConnections.Value;
                settings.MaximumConnectionsPerIP = (int)m_pMaxConnsPerIP.Value;
				settings.MaximumBadCommands      = (int)m_pMaxBadCommands.Value;// IP binds
                List<IPBindInfo> binds = new List<IPBindInfo>();
                foreach(ListViewItem it in m_pTabGeneral_Bindings.Items){
                    binds.Add((IPBindInfo)it.Tag);
                }
                settings.Binds = binds.ToArray();
                
                if(m_pVirtualServer.SystemSettings.HasChanges){
                    if(!confirmSave || MessageBox.Show(this,"You have changes settings, do you want to save them ?","Confirm:",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                Auth_Settings settings = m_pVirtualServer.SystemSettings.Authentication;

                settings.AuthenticationType = (ServerAuthenticationType_enum)(m_pAuthenticationType.SelectedIndex + 1);
                settings.WinDomain          = m_pDomainName.Text;

                if(m_pVirtualServer.SystemSettings.HasChanges){
                    if(!confirmSave || MessageBox.Show(this,"You have changes settings, do you want to save them ?","Confirm:",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 36
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {            
            try{
				Logging_Settings settings = m_pVirtualServer.SystemSettings.Logging;

				m_pLogSMTP.Checked       = settings.LogSMTP;
				m_pSMTPLogPath.Text      = settings.SmtpLogsPath;
				m_pLogPOP3.Checked       = settings.LogPOP3;
				m_pPOP3LogPath.Text      = settings.Pop3LogsPath;
				m_pLogIMAP.Checked       = settings.LogIMAP;
				m_pIMAPLogPath.Text      = settings.ImapLogsPath;
				m_pLogRelay.Checked      = settings.LogRelay;
				m_pRelayLogPath.Text     = settings.RelayLogsPath;
				m_pLogFetchPOP3.Checked  = settings.LogFetchMessages;
				m_pFetchPOP3LogPath.Text = settings.FetchMessagesLogsPath;
				//m_pServerLogPath.Text    = dr["Server_LogPath"].ToString();
			}
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
Ejemplo n.º 37
0
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                FetchMessages_Settings settings = m_pVirtualServer.SystemSettings.FetchMessages;

                m_pEnabled.Checked     = settings.Enabled;
				m_pFetchInterval.Value = settings.FetchInterval;
			}
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
Ejemplo n.º 38
0
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                SIP_Settings settings = m_pVirtualServer.SystemSettings.SIP;

                settings.Enabled = m_pTabGeneral_Enabled.Checked;
                if(m_pTabGeneral_ProxyType.SelectedIndex == 0){
                    settings.ProxyMode = LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.Registrar | LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.B2BUA;
                }
                else{
                    settings.ProxyMode = LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.Registrar | LumiSoft.Net.SIP.Proxy.SIP_ProxyMode.Statefull;
                }
                settings.MinimumExpires = (int)m_pTabGeneral_MinExpires.Value;
                // IP binds
                List<IPBindInfo> binds = new List<IPBindInfo>();
                foreach(ListViewItem it in m_pTabGeneral_Bindings.Items){
                    binds.Add((IPBindInfo)it.Tag);
                }
                settings.Binds = binds.ToArray();
                
                if(m_pVirtualServer.SystemSettings.HasChanges){
                    if(!confirmSave || MessageBox.Show(this,"You have changes settings, do you want to save them ?","Confirm:",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
Ejemplo n.º 39
0
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                FetchMessages_Settings settings = m_pVirtualServer.SystemSettings.FetchMessages;

                settings.Enabled       = m_pEnabled.Checked;
				settings.FetchInterval = (int)m_pFetchInterval.Value;

                if(m_pVirtualServer.SystemSettings.HasChanges){
                    if(!confirmSave || MessageBox.Show(this,"You have changes settings, do you want to save them ?","Confirm:",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
			catch(Exception x){
				wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
			}
        }
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                Relay_Settings settings =  m_pVirtualServer.SystemSettings.Relay;

                if(settings.UseSmartHost){
                    m_pSendSmartHost.Checked = true;
                }
                else{
                    m_pSendDns.Checked = true;
                }
                m_pSmartHost.Text               = settings.SmartHost;
                m_pSmartHostPort.Value          = settings.SmartHostPort;
                m_pUseSSL.Checked               = settings.SmartHostSsl;
                m_pSmartHostUser.Text           = settings.SmartHostUserName;
                m_pSmartHostPassword.Text       = settings.SmartHostPassword;
                m_pDns1.Text                    = settings.Dns1;
                m_pDns2.Text                    = settings.Dns2;
                m_pHostName.Text                = settings.HostName;
                m_pSessionTimeout.Value         = settings.SessionIdleTimeOut;
                m_pMaxConnections.Value         = settings.MaximumConnections;
                m_pMaxConnsPerIP.Value          = settings.MaximumConnectionsPerIP;
                m_pRelayInterval.Value          = settings.RelayInterval;
                m_pRelayRetryInterval.Value     = settings.RelayRetryInterval;
                m_pSendUndelWarning.Value       = settings.SendUndeliveredWarningAfter;
                m_pSendUndelivered.Value        = settings.SendUndeliveredAfter;
                m_pStoreUndeliveredMsgs.Checked = settings.StoreUndeliveredMessages;
                m_pSendingIP.Text               = settings.BindIP.ToString();
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
        /// <summary>
        /// Loads data to UI.
        /// </summary>
        private void LoadData()
        {
            try{
                SMTP_Settings settings =  m_pVirtualServer.SystemSettings.SMTP;

                m_pEnabled.Checked      = settings.Enabled;
                m_pHostName.Text        = settings.HostName;
                m_pGreetingText.Text    = settings.GreetingText;
                m_pDefaultDomain.Text   = settings.DefaultDomain;
                m_pSessionTimeout.Value = settings.SessionIdleTimeOut;
                m_pMaxConnections.Value = settings.MaximumConnections;
                m_pMaxConnsPerIP.Value  = settings.MaximumConnectionsPerIP;
                m_pMaxBadCommands.Value = settings.MaximumBadCommands;
                m_pMaxMessageSize.Value = settings.MaximumMessageSize;
                m_pMaxRecipients.Value  = settings.MaximumRecipientsPerMessage;
                m_pRequireAuth.Checked  = settings.RequireAuthentication;

                foreach(BindInfo binding in settings.Binds){
                    ListViewItem it = new ListViewItem();
                    if(binding.IP.ToString() == "0.0.0.0"){
                        it.Text = "Any IPv4";
                    }
                    else if(binding.IP.ToString() == "0:0:0:0:0:0:0:0"){
                        it.Text = "Any IPv6";
                    }
                    else{
                        it.Text = binding.IP.ToString();
                    }
                    it.SubItems.Add(binding.Port.ToString());
                    it.SubItems.Add(binding.SSL.ToString());
                    it.SubItems.Add(Convert.ToString(binding.Certificate != null));
                    it.Tag = binding;
                    m_pBindings.Items.Add(it);
                }

                m_pBindings_SelectedIndexChanged(this,new EventArgs());
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
Ejemplo n.º 42
0
        private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            wfrm_sys_Error frm = new wfrm_sys_Error(e.Exception, new System.Diagnostics.StackTrace());

            frm.ShowDialog(null);
        }
        /// <summary>
        /// Saves data.
        /// </summary>
        /// <param name="confirmSave">Specifies is save confirmation UI is showed.</param>
        private void SaveData(bool confirmSave)
        {
            try{
                Relay_Settings settings =  m_pVirtualServer.SystemSettings.Relay;

                settings.UseSmartHost                = m_pSendSmartHost.Checked;
                settings.SmartHost                   = m_pSmartHost.Text;
                settings.SmartHostPort               = (int)m_pSmartHostPort.Value;
                settings.SmartHostSsl                = m_pUseSSL.Checked;
                settings.SmartHostUserName           = m_pSmartHostUser.Text;
                settings.SmartHostPassword           = m_pSmartHostPassword.Text;
                settings.Dns1                        = m_pDns1.Text;
                settings.Dns2                        = m_pDns2.Text;
                settings.HostName                    = m_pHostName.Text;
                settings.SessionIdleTimeOut          = (int)m_pSessionTimeout.Value;
                settings.MaximumConnections          = (int)m_pMaxConnections.Value;
                settings.MaximumConnectionsPerIP     = (int)m_pMaxConnsPerIP.Value;
                settings.RelayInterval               = (int)m_pRelayInterval.Value;
                settings.RelayRetryInterval          = (int)m_pRelayRetryInterval.Value;
                settings.SendUndeliveredWarningAfter = (int)m_pSendUndelWarning.Value;
                settings.SendUndeliveredAfter        = (int)m_pSendUndelivered.Value;
                settings.StoreUndeliveredMessages    = m_pStoreUndeliveredMsgs.Checked;
                settings.BindIP                      = (IPAddress)((WComboBoxItem)m_pSendingIP.SelectedItem).Tag;

                if(m_pVirtualServer.SystemSettings.HasChanges){
                    if(!confirmSave || MessageBox.Show(this,"You have changes settings, do you want to save them ?","Confirm:",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes){
                        m_pVirtualServer.SystemSettings.Commit();
                    }
                }
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
        private void m_pOk_Click(object sender, EventArgs e)
        {
            try{
                if(m_pDomainName.Text.Length <= 0){
                    MessageBox.Show("Domain name cannot be empty!!!","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
                    return;
                }

                // Add new domain.
                if(m_pDomain == null){
                    m_pDomain = m_pVirtualServer.Domains.Add(
                        m_pDomainName.Text,
                        m_pDescription.Text
                    );
                }
                // Update domain.
                else{
                    m_pDomain.DomainName  = m_pDomainName.Text;
                    m_pDomain.Description = m_pDescription.Text;
                    m_pDomain.Commit();
                }

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
                frm.ShowDialog(this);
            }
        }
        private void m_pOk_Click(object sender, EventArgs e)
        {
            //--- Validate values ---------------------------------------------------//
            if(m_pFolderName.Text == ""){
                MessageBox.Show("Folder name cannot be empty!!!","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);					
				return;
            }
            //-----------------------------------------------------------------------//

            try{
                m_pVirtualServer.UsersDefaultFolders.Add(
                    m_pFolderName.Text,
                    m_pPermanent.Checked
                );

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch(Exception x){
                wfrm_sys_Error frm = new wfrm_sys_Error(x,new System.Diagnostics.StackTrace());
				frm.ShowDialog(this);
            }
        }