allow entry of name during installation
This commit is contained in:
@ -60,9 +60,9 @@ namespace Oqtane.Controllers
|
||||
{
|
||||
installation = _databaseManager.Install(config);
|
||||
|
||||
if (installation.Success && config.Register)
|
||||
if (installation.Success)
|
||||
{
|
||||
await RegisterContact(config.HostEmail);
|
||||
await RegisterContact(config.HostEmail, config.HostName);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -257,7 +257,7 @@ namespace Oqtane.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RegisterContact(string email)
|
||||
private async Task RegisterContact(string email, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -268,7 +268,7 @@ namespace Oqtane.Controllers
|
||||
{
|
||||
client.DefaultRequestHeaders.Add("Referer", HttpContext.Request.Scheme + "://" + HttpContext.Request.Host.Value);
|
||||
client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(Constants.PackageId, Constants.Version));
|
||||
var response = await client.GetAsync(new Uri(url + $"/api/registry/contact/?id={_configManager.GetInstallationId()}&email={WebUtility.UrlEncode(email)}")).ConfigureAwait(false);
|
||||
var response = await client.GetAsync(new Uri(url + $"/api/registry/contact/?id={_configManager.GetInstallationId()}&email={WebUtility.UrlEncode(email)}&name={WebUtility.UrlEncode(name)}")).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -278,12 +278,12 @@ namespace Oqtane.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
// GET api/<controller>/register?email=x
|
||||
// GET api/<controller>/register?email=x&name=y
|
||||
[HttpPost("register")]
|
||||
[Authorize(Roles = RoleNames.Host)]
|
||||
public async Task Register(string email)
|
||||
public async Task Register(string email, string name)
|
||||
{
|
||||
await RegisterContact(email);
|
||||
await RegisterContact(email, name);
|
||||
}
|
||||
|
||||
public struct ClientAssembly
|
||||
|
Reference in New Issue
Block a user