diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index 0620b792c..84bf6f023 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -189,9 +189,21 @@ public ActionResult EpisodeSorting() public ActionResult System() { + var selectedAuthenticationType = _configFileProvider.AuthenticationType; + var authenticationTypes = new List(); + + 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(); } diff --git a/NzbDrone.Web/Models/SystemSettingsModel.cs b/NzbDrone.Web/Models/SystemSettingsModel.cs index 25615eb77..19a17791d 100644 --- a/NzbDrone.Web/Models/SystemSettingsModel.cs +++ b/NzbDrone.Web/Models/SystemSettingsModel.cs @@ -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; } } } \ No newline at end of file diff --git a/NzbDrone.Web/Views/Settings/System.cshtml b/NzbDrone.Web/Views/Settings/System.cshtml index 2bfc9a5cb..7af233bd2 100644 --- a/NzbDrone.Web/Views/Settings/System.cshtml +++ b/NzbDrone.Web/Views/Settings/System.cshtml @@ -31,6 +31,11 @@ @Html.DescriptionFor(m => m.Port) @Html.TextBoxFor(m => m.Port, new { @class = "inputClass" }) + + + @Html.DropDownListFor(m => m.AuthenticationType, Model.AuthTypeSelectList, new { @class = "inputClass" }) }