/[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 16 by william, Wed Jul 11 16:36:27 2012 UTC revision 64 by william, Thu Jul 12 18:56:31 2012 UTC
# Line 11  using System.Security.Principal; Line 11  using System.Security.Principal;
11  using System.IO;  using System.IO;
12  using System.Management;  using System.Management;
13  using System.Net;  using System.Net;
14    using log4net;
15    
16  // Support class for the AnywhereTS version. This file should only be included in the Pro version.  // Support class for the AnywhereTS version. This file should only be included in the Pro version.
17  namespace AnywhereTS  namespace AnywhereTS
# Line 148  namespace AnywhereTS Line 149  namespace AnywhereTS
149          }          }
150    
151          // 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.
152            [Obsolete("GrantRWaccessForRemoteDesktopUsers has been deprecated - define user access rights via SQL Server")]
153          public static void GrantRWaccessForRemoteDesktopUsers(string fileName)          public static void GrantRWaccessForRemoteDesktopUsers(string fileName)
154          {          {
155              // 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 165  namespace AnywhereTS
165          }          }
166    
167          // 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.
168            [Obsolete("GrantRWMaccessForRemoteDesktopUsers has been deprecated - define user access rights via SQL Server")]
169          public static void GrantRWMaccessForRemoteDesktopUsers(string fileName)          public static void GrantRWMaccessForRemoteDesktopUsers(string fileName)
170          {          {
171              // 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 183  namespace AnywhereTS
183    
184          // (obsolete)          // (obsolete)
185          // 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.
186            [Obsolete("DenyAccessRightModifyForUsers has been deprecated - define user access rights via SQL Server")]
187          public static void DenyAccessRightModifyForUsers(string fileName)          public static void DenyAccessRightModifyForUsers(string fileName)
188          {          {
189              // Get a FileSecurity object that represents the current security settings.              // Get a FileSecurity object that represents the current security settings.
# Line 223  namespace AnywhereTS Line 227  namespace AnywhereTS
227                  }                  }
228              }              }
229              else              else
230                  throw new Exception("Unknown TFTP mode 28158");              {
231                    string error = "Error: Unknown TFTP Config mode (28158)";
232                    using (log4net.NDC.Push(string.Format("tftpConfig={0}", ATSGlobals.tftpConfig)))
233                    {
234                        Logging.ATSAdminLog.Error(error);
235                    }
236                    MessageBox.Show(string.Format("{0} -> {1}", error, string.Format("tftpConfig={0}", ATSGlobals.tftpConfig)));
237                    return;
238                }
239          }          }
240    
241          // Copy image file to all external tftp directories/servers          // Copy image file to all external tftp directories/servers
# Line 245  namespace AnywhereTS Line 257  namespace AnywhereTS
257                  catch (Exception e)                  catch (Exception e)
258                  {                  {
259                      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);
260                        using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
261                        {
262                            using (log4net.NDC.Push(string.Format("tftpPath={0}", GetTftpPath(row))))
263                            {
264                                Logging.ATSAdminLog.Error("Could not update TFTP server");
265                            }
266                        }
267                  }                  }
268                            
269                  // Try to set rights for image the image file                  // Try to set rights for image the image file
# Line 280  namespace AnywhereTS Line 299  namespace AnywhereTS
299                  catch (Exception e)                  catch (Exception e)
300                  {                  {
301                      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);
302                        using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
303                        {
304                            using (log4net.NDC.Push(string.Format("tftpPath={0}", GetTftpPath(row))))
305                            {
306                                Logging.ATSAdminLog.Error("Could not update TFTP server");
307                            }
308                        }
309                  }                  }
310              }              }
311          }          }
# Line 299  namespace AnywhereTS Line 325  namespace AnywhereTS
325                  catch (Exception ex)                  catch (Exception ex)
326                  {                  {
327                      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);
328                        using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString())))
329                        {
330                            Logging.ATSAdminLog.Error("Cannot set access rights for client configuration");
331                        }
332                      Application.Exit();                      Application.Exit();
333                      return;                      return;
334                  }                  }
# Line 325  namespace AnywhereTS Line 355  namespace AnywhereTS
355                  }                  }
356              }              }
357              else              else
358                  throw new Exception("Unknown TFTP mode 48158");              {
359                    string error = "Error: Unknown TFTP Config mode (48158)";
360                    using (log4net.NDC.Push(string.Format("tftpConfig={0}", ATSGlobals.tftpConfig)))
361                    {
362                        Logging.ATSAdminLog.Error(error);
363                    }
364                    MessageBox.Show(string.Format("{0} -> {1}", error, string.Format("tftpConfig={0}", ATSGlobals.tftpConfig)));
365                    return;
366                }
367          }          }
368    
369    
# Line 361  namespace AnywhereTS Line 399  namespace AnywhereTS
399              {              {
400                  //improve autoretry                  //improve autoretry
401                  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);
402                    using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
403                    {
404                        using (log4net.NDC.Push(string.Format("path={0}", path)))
405                        {
406                            Logging.ATSAdminLog.Error("Could not write configuration data to disk");
407                        }
408                    }
409              }              }
410    
411              finally              finally
# Line 436  namespace AnywhereTS Line 481  namespace AnywhereTS
481                  }                  }
482              }              }
483              else              else
484                  throw new Exception("Unknown TFTP mode 88158");              {
485                    string error = "Error: Unknown TFTP Config mode (88158)";
486                    using (log4net.NDC.Push(string.Format("tftpConfig={0}", ATSGlobals.tftpConfig)))
487                    {
488                        Logging.ATSAdminLog.Error(error);
489                    }
490                    MessageBox.Show(string.Format("{0} -> {1}", error, string.Format("tftpConfig={0}", ATSGlobals.tftpConfig)));
491                    return;
492                }
493    
494              WriteHostsFiles();              WriteHostsFiles();
495              ATSImageRuntimeConfig currentConfig = new ATSImageRuntimeConfig();              ATSImageRuntimeConfig currentConfig = new ATSImageRuntimeConfig();

Legend:
Removed from v.16  
changed lines
  Added in v.64

  ViewVC Help
Powered by ViewVC 1.1.22