/[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

revision 4 by william, Wed Jul 11 14:19:13 2012 UTC revision 46 by william, Thu Jul 12 14:17:14 2012 UTC
# Line 127  namespace AnywhereTS Line 127  namespace AnywhereTS
127          // Initiate the database          // Initiate the database
128          public static void InitDatabase()          public static void InitDatabase()
129          {          {
130              // Create and set the connection string              //// Create and set the connection string
131              string dataServerName; // The name of the database server in the connection string              //string dataServerName; // The name of the database server in the connection string
132              if (strDatabaseServer.Length != 0)              //if (strDatabaseServer.Length != 0)
133              {   // We have a database server              //{   // We have a database server
134                  dataServerName = strDatabaseServer;              //    dataServerName = strDatabaseServer;
135              }              //}
136              else              //else
137              {   // We do not have an external, data server.              //{   // We do not have an external, data server.
138                  dataServerName = ".";              //    dataServerName = ".";
139              }              //}
140              Properties.Settings.Default["atsConnectionString"] = @"Data Source=" + dataServerName + @"\SQLEXPRESS;Database='AnywhereTS';Integrated Security=True;Connect Timeout=30;User Instance=False";              //Properties.Settings.Default["atsConnectionString"] = @"Data Source=" + dataServerName + @"\SQLEXPRESS;Database='AnywhereTS';Integrated Security=True;Connect Timeout=30;User Instance=False";
141              Properties.Settings.Default.Save();              //Properties.Settings.Default.Save();
142                            
143              // Set up table adapters              // Set up table adapters
144              clientTableAdapter = new atsDataSetTableAdapters.ClientTableAdapter();              clientTableAdapter = new atsDataSetTableAdapters.ClientTableAdapter();
# Line 148  namespace AnywhereTS Line 148  namespace AnywhereTS
148          }          }
149    
150          // Adds an ACL entry for RW access on the specified file for Remote desktop users.          // Adds an ACL entry for RW access on the specified file for Remote desktop users.
151            [Obsolete("GrantRWaccessForRemoteDesktopUsers has been deprecated - define user access rights via SQL Server")]
152          public static void GrantRWaccessForRemoteDesktopUsers(string fileName)          public static void GrantRWaccessForRemoteDesktopUsers(string fileName)
153          {          {
154              // Get a FileSecurity object that represents the current security settings.              // Get a FileSecurity object that represents the current security settings.
# Line 163  namespace AnywhereTS Line 164  namespace AnywhereTS
164          }          }
165    
166          // Adds an ACL entry for ReadWriteModify access on the specified file for Remote desktop users.          // Adds an ACL entry for ReadWriteModify access on the specified file for Remote desktop users.
167            [Obsolete("GrantRWMaccessForRemoteDesktopUsers has been deprecated - define user access rights via SQL Server")]
168          public static void GrantRWMaccessForRemoteDesktopUsers(string fileName)          public static void GrantRWMaccessForRemoteDesktopUsers(string fileName)
169          {          {
170              // Get a FileSecurity object that represents the current security settings.              // Get a FileSecurity object that represents the current security settings.
# Line 180  namespace AnywhereTS Line 182  namespace AnywhereTS
182    
183          // (obsolete)          // (obsolete)
184          // Adds an ACL entry for to deny modify access on the specified file for all users.          // Adds an ACL entry for to deny modify access on the specified file for all users.
185            [Obsolete("DenyAccessRightModifyForUsers has been deprecated - define user access rights via SQL Server")]
186          public static void DenyAccessRightModifyForUsers(string fileName)          public static void DenyAccessRightModifyForUsers(string fileName)
187          {          {
188              // Get a FileSecurity object that represents the current security settings.              // Get a FileSecurity object that represents the current security settings.
# Line 245  namespace AnywhereTS Line 248  namespace AnywhereTS
248                  catch (Exception e)                  catch (Exception e)
249                  {                  {
250                      MessageBox.Show("Could not update TFTP server '" + GetTftpPath(row) + "' (22181). Error: " + e.Message);                      MessageBox.Show("Could not update TFTP server '" + GetTftpPath(row) + "' (22181). Error: " + e.Message);
251                        using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
252                        {
253                            using (log4net.NDC.Push(string.Format("tftpPath={0}", GetTftpPath(row))))
254                            {
255                                Logging.ATSAdminLog.Error("Could not update TFTP server");
256                            }
257                        }
258                  }                  }
259                            
260                  // Try to set rights for image the image file                  // Try to set rights for image the image file
# Line 280  namespace AnywhereTS Line 290  namespace AnywhereTS
290                  catch (Exception e)                  catch (Exception e)
291                  {                  {
292                      MessageBox.Show("Could not update TFTP server '" + GetTftpPath(row) + "' (22381). Error: " + e.Message);                      MessageBox.Show("Could not update TFTP server '" + GetTftpPath(row) + "' (22381). Error: " + e.Message);
293                        using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
294                        {
295                            using (log4net.NDC.Push(string.Format("tftpPath={0}", GetTftpPath(row))))
296                            {
297                                Logging.ATSAdminLog.Error("Could not update TFTP server");
298                            }
299                        }
300                  }                  }
301              }              }
302          }          }
# Line 299  namespace AnywhereTS Line 316  namespace AnywhereTS
316                  catch (Exception ex)                  catch (Exception ex)
317                  {                  {
318                      MessageBox.Show("Cannot set access rights for client configuration. Application will abort. Error: " + ex.Message);                      MessageBox.Show("Cannot set access rights for client configuration. Application will abort. Error: " + ex.Message);
319                        using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString())))
320                        {
321                            Logging.ATSAdminLog.Error("Cannot set access rights for client configuration");
322                        }
323                      Application.Exit();                      Application.Exit();
324                      return;                      return;
325                  }                  }
# Line 361  namespace AnywhereTS Line 382  namespace AnywhereTS
382              {              {
383                  //improve autoretry                  //improve autoretry
384                  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);                  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);
385                    using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
386                    {
387                        using (log4net.NDC.Push(string.Format("path={0}", path)))
388                        {
389                            Logging.ATSAdminLog.Error("Could not write configuration data to disk");
390                        }
391                    }
392              }              }
393    
394              finally              finally

Legend:
Removed from v.4  
changed lines
  Added in v.46

  ViewVC Help
Powered by ViewVC 1.1.22