mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-12 11:15:43 +02:00
AuthenticationType is now configurable from /Settings/System.
This commit is contained in:
parent
f973c74c87
commit
f627b551fc
@ -189,9 +189,21 @@ public ActionResult EpisodeSorting()
|
||||
|
||||
public ActionResult System()
|
||||
{
|
||||
var selectedAuthenticationType = _configFileProvider.AuthenticationType;
|
||||
var authenticationTypes = new List<AuthenticationType>();
|
||||
|
||||
foreach (AuthenticationType authenticationType in Enum.GetValues(typeof(AuthenticationType)))
|
||||
{
|
||||
authenticationTypes.Add(authenticationType);
|
||||
}
|
||||
|
||||
var authTypeSelectList = new SelectList(authenticationTypes, selectedAuthenticationType);
|
||||
|
||||
var model = new SystemSettingsModel();
|
||||
model.Port = _configFileProvider.Port;
|
||||
model.LaunchBrowser = _configFileProvider.LaunchBrowser;
|
||||
model.AuthenticationType = selectedAuthenticationType;
|
||||
model.AuthTypeSelectList = authTypeSelectList;
|
||||
|
||||
return View(model);
|
||||
}
|
||||
@ -455,6 +467,7 @@ public JsonResult SaveSystem(SystemSettingsModel data)
|
||||
{
|
||||
_configFileProvider.Port = data.Port;
|
||||
_configFileProvider.LaunchBrowser = data.LaunchBrowser;
|
||||
_configFileProvider.AuthenticationType = data.AuthenticationType;
|
||||
|
||||
return GetSuccessResult();
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using NzbDrone.Core.Model;
|
||||
|
||||
namespace NzbDrone.Web.Models
|
||||
{
|
||||
@ -17,5 +19,11 @@ public class SystemSettingsModel
|
||||
[DisplayName("Launch Browser")]
|
||||
[Description("Start default webrowser when NzbDrone starts?")]
|
||||
public bool LaunchBrowser { get; set; }
|
||||
|
||||
[DisplayName("Authentication")]
|
||||
[Description("Secure the webserver with Authentication?")]
|
||||
public AuthenticationType AuthenticationType { get; set; }
|
||||
|
||||
public SelectList AuthTypeSelectList { get; set; }
|
||||
}
|
||||
}
|
@ -31,6 +31,11 @@
|
||||
<span class="small">@Html.DescriptionFor(m => m.Port)</span>
|
||||
</label>
|
||||
@Html.TextBoxFor(m => m.Port, new { @class = "inputClass" })
|
||||
|
||||
<label class="labelClass">@Html.LabelFor(m => m.AuthenticationType)
|
||||
<span class="small">@Html.DescriptionFor(m => m.AuthenticationType)</span>
|
||||
</label>
|
||||
@Html.DropDownListFor(m => m.AuthenticationType, Model.AuthTypeSelectList, new { @class = "inputClass" })
|
||||
|
||||
<button type="submit" id="save_button" disabled="disabled">Save</button>
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user