mirror of https://github.com/Radarr/Radarr
AuthenticationType is now configurable from /Settings/System.
This commit is contained in:
parent
f973c74c87
commit
f627b551fc
|
@ -189,9 +189,21 @@ namespace NzbDrone.Web.Controllers
|
||||||
|
|
||||||
public ActionResult System()
|
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();
|
var model = new SystemSettingsModel();
|
||||||
model.Port = _configFileProvider.Port;
|
model.Port = _configFileProvider.Port;
|
||||||
model.LaunchBrowser = _configFileProvider.LaunchBrowser;
|
model.LaunchBrowser = _configFileProvider.LaunchBrowser;
|
||||||
|
model.AuthenticationType = selectedAuthenticationType;
|
||||||
|
model.AuthTypeSelectList = authTypeSelectList;
|
||||||
|
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
@ -455,6 +467,7 @@ namespace NzbDrone.Web.Controllers
|
||||||
{
|
{
|
||||||
_configFileProvider.Port = data.Port;
|
_configFileProvider.Port = data.Port;
|
||||||
_configFileProvider.LaunchBrowser = data.LaunchBrowser;
|
_configFileProvider.LaunchBrowser = data.LaunchBrowser;
|
||||||
|
_configFileProvider.AuthenticationType = data.AuthenticationType;
|
||||||
|
|
||||||
return GetSuccessResult();
|
return GetSuccessResult();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
using NzbDrone.Core.Model;
|
||||||
|
|
||||||
namespace NzbDrone.Web.Models
|
namespace NzbDrone.Web.Models
|
||||||
{
|
{
|
||||||
|
@ -17,5 +19,11 @@ namespace NzbDrone.Web.Models
|
||||||
[DisplayName("Launch Browser")]
|
[DisplayName("Launch Browser")]
|
||||||
[Description("Start default webrowser when NzbDrone starts?")]
|
[Description("Start default webrowser when NzbDrone starts?")]
|
||||||
public bool LaunchBrowser { get; set; }
|
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>
|
<span class="small">@Html.DescriptionFor(m => m.Port)</span>
|
||||||
</label>
|
</label>
|
||||||
@Html.TextBoxFor(m => m.Port, new { @class = "inputClass" })
|
@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>
|
<button type="submit" id="save_button" disabled="disabled">Save</button>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue