AuthenticationType is now configurable from /Settings/System.

pull/4/head
Mark McDowall 13 years ago
parent f973c74c87
commit f627b551fc

@ -189,9 +189,21 @@ namespace NzbDrone.Web.Controllers
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 @@ namespace NzbDrone.Web.Controllers
{
_configFileProvider.Port = data.Port;
_configFileProvider.LaunchBrowser = data.LaunchBrowser;
_configFileProvider.AuthenticationType = data.AuthenticationType;
return GetSuccessResult();
}

@ -4,6 +4,8 @@ using System.ComponentModel;
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 @@ namespace NzbDrone.Web.Models
[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…
Cancel
Save