qol: simplify calls
This commit is contained in:
@@ -85,7 +85,7 @@ namespace Disco.Client
|
||||
string reportJson = JsonConvert.SerializeObject(report);
|
||||
string reportResponse;
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(ServicePathTemplate);
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(ServicePathTemplate);
|
||||
request.UserAgent = $"Disco-Client/{Assembly.GetExecutingAssembly().GetName().Version.ToString(3)}";
|
||||
request.ContentType = "application/json";
|
||||
request.Method = WebRequestMethods.Http.Post;
|
||||
@@ -105,7 +105,7 @@ namespace Disco.Client
|
||||
}
|
||||
}
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("Error Report Logged to Server; Response: {0}", reportResponse);
|
||||
Debug.WriteLine("Error Report Logged to Server; Response: {0}", reportResponse);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Disco.Client.Extensions
|
||||
else
|
||||
serviceUrl = string.Format(ServicePathUnauthenticatedTemplate, Service.Feature);
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(serviceUrl);
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl);
|
||||
request.UserAgent = $"Disco-Client/{Assembly.GetExecutingAssembly().GetName().Version.ToString(3)}";
|
||||
request.ContentType = "application/json";
|
||||
request.Method = WebRequestMethods.Http.Post;
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Disco.Client.Extensions
|
||||
Presentation.UpdateStatus("Enrolling Device", $"Configuring the device owner:\r\n{enrolResponse.AssignedUserDescription} ({enrolResponse.AssignedUserDomain}\\{enrolResponse.AssignedUserUsername})", true, -1, 3000);
|
||||
|
||||
if (enrolResponse.AssignedUserIsLocalAdmin)
|
||||
Interop.LocalAuthentication.AddLocalGroupMembership("Administrators", enrolResponse.AssignedUserSID, enrolResponse.AssignedUserUsername, enrolResponse.AssignedUserDomain);
|
||||
LocalAuthentication.AddLocalGroupMembership("Administrators", enrolResponse.AssignedUserSID, enrolResponse.AssignedUserUsername, enrolResponse.AssignedUserDomain);
|
||||
|
||||
// Make Windows think this user was the last to logon
|
||||
using (RegistryKey regWinlogon = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", true))
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Disco.Client
|
||||
}
|
||||
public static void UpdateStatus(string SubHeading, string Message, bool ShowProgress, int Progress, int TryDelay)
|
||||
{
|
||||
Presentation.UpdateStatus(SubHeading, Message, ShowProgress, Progress);
|
||||
UpdateStatus(SubHeading, Message, ShowProgress, Progress);
|
||||
if (TryDelay > 0)
|
||||
Presentation.TryDelay(TryDelay);
|
||||
}
|
||||
|
||||
@@ -35,14 +35,14 @@ namespace Disco.Client
|
||||
Presentation.WriteBanner();
|
||||
|
||||
// WhoAmI Phase
|
||||
keepProcessing = Program.WhoAmI();
|
||||
keepProcessing = WhoAmI();
|
||||
|
||||
// Enrol Phase
|
||||
if (keepProcessing)
|
||||
keepProcessing = Program.Enrol();
|
||||
keepProcessing = Enrol();
|
||||
|
||||
// End conversation with Bootstrapper
|
||||
Presentation.WriteFooter(Program.RebootRequired, Program.AllowUninstall, !keepProcessing);
|
||||
Presentation.WriteFooter(RebootRequired, AllowUninstall, !keepProcessing);
|
||||
}
|
||||
|
||||
public static void SetupEnvironment()
|
||||
@@ -128,7 +128,7 @@ namespace Disco.Client
|
||||
{
|
||||
// Send Request
|
||||
Presentation.UpdateStatus("Enrolling Device", "Sending the enrolment request to the server.", true, -1);
|
||||
response = request.Post(Program.IsAuthenticated);
|
||||
response = request.Post(IsAuthenticated);
|
||||
|
||||
// Process Response
|
||||
Presentation.UpdateStatus("Enrolling Device", "Processing the enrolment response from the server.", true, -1);
|
||||
|
||||
Reference in New Issue
Block a user