/[AnywhereTS-MSSQL]/trunk/TSAdminTool/ProSupport.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/ProSupport.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/TSAdminTool/ProSupport.cs	2012/07/11 14:19:13	4
+++ trunk/TSAdminTool/ProSupport.cs	2012/07/12 14:17:14	46
@@ -127,18 +127,18 @@
         // Initiate the database
         public static void InitDatabase()
         {
-            // Create and set the connection string
-            string dataServerName; // The name of the database server in the connection string
-            if (strDatabaseServer.Length != 0)
-            {   // We have a database server
-                dataServerName = strDatabaseServer;
-            }
-            else
-            {   // We do not have an external, data server.
-                dataServerName = ".";
-            }
-            Properties.Settings.Default["atsConnectionString"] = @"Data Source=" + dataServerName + @"\SQLEXPRESS;Database='AnywhereTS';Integrated Security=True;Connect Timeout=30;User Instance=False";
-            Properties.Settings.Default.Save();
+            //// Create and set the connection string
+            //string dataServerName; // The name of the database server in the connection string
+            //if (strDatabaseServer.Length != 0)
+            //{   // We have a database server
+            //    dataServerName = strDatabaseServer;
+            //}
+            //else
+            //{   // We do not have an external, data server.
+            //    dataServerName = ".";
+            //}
+            //Properties.Settings.Default["atsConnectionString"] = @"Data Source=" + dataServerName + @"\SQLEXPRESS;Database='AnywhereTS';Integrated Security=True;Connect Timeout=30;User Instance=False";
+            //Properties.Settings.Default.Save();
             
             // Set up table adapters
             clientTableAdapter = new atsDataSetTableAdapters.ClientTableAdapter();
@@ -148,6 +148,7 @@
         }
 
         // Adds an ACL entry for RW access on the specified file for Remote desktop users.
+        [Obsolete("GrantRWaccessForRemoteDesktopUsers has been deprecated - define user access rights via SQL Server")]
         public static void GrantRWaccessForRemoteDesktopUsers(string fileName)
         {
             // Get a FileSecurity object that represents the current security settings.
@@ -163,6 +164,7 @@
         }
 
         // Adds an ACL entry for ReadWriteModify access on the specified file for Remote desktop users.
+        [Obsolete("GrantRWMaccessForRemoteDesktopUsers has been deprecated - define user access rights via SQL Server")]
         public static void GrantRWMaccessForRemoteDesktopUsers(string fileName)
         {
             // Get a FileSecurity object that represents the current security settings.
@@ -180,6 +182,7 @@
 
         // (obsolete)
         // Adds an ACL entry for to deny modify access on the specified file for all users.
+        [Obsolete("DenyAccessRightModifyForUsers has been deprecated - define user access rights via SQL Server")]
         public static void DenyAccessRightModifyForUsers(string fileName)
         {
             // Get a FileSecurity object that represents the current security settings.
@@ -245,6 +248,13 @@
                 catch (Exception e)
                 {
                     MessageBox.Show("Could not update TFTP server '" + GetTftpPath(row) + "' (22181). Error: " + e.Message);
+                    using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
+                    {
+                        using (log4net.NDC.Push(string.Format("tftpPath={0}", GetTftpPath(row))))
+                        {
+                            Logging.ATSAdminLog.Error("Could not update TFTP server");
+                        }
+                    }
                 }
             
                 // Try to set rights for image the image file
@@ -280,6 +290,13 @@
                 catch (Exception e)
                 {
                     MessageBox.Show("Could not update TFTP server '" + GetTftpPath(row) + "' (22381). Error: " + e.Message);
+                    using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
+                    {
+                        using (log4net.NDC.Push(string.Format("tftpPath={0}", GetTftpPath(row))))
+                        {
+                            Logging.ATSAdminLog.Error("Could not update TFTP server");
+                        }
+                    }
                 }
             }
         }
@@ -299,6 +316,10 @@
                 catch (Exception ex)
                 {
                     MessageBox.Show("Cannot set access rights for client configuration. Application will abort. Error: " + ex.Message);
+                    using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString())))
+                    {
+                        Logging.ATSAdminLog.Error("Cannot set access rights for client configuration");
+                    }
                     Application.Exit();
                     return;
                 }
@@ -361,6 +382,13 @@
             {
                 //improve autoretry
                 MessageBox.Show("Error: Could not write configuration data to disk. Possibly the data is being accessed by another component right now or you do not have the sufficient rights. Please retry this operation later (52044). Error details: " + e.Message);
+                using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
+                {
+                    using (log4net.NDC.Push(string.Format("path={0}", path)))
+                    {
+                        Logging.ATSAdminLog.Error("Could not write configuration data to disk");
+                    }
+                }
             }
 
             finally

 

  ViewVC Help
Powered by ViewVC 1.1.22