U4-10368 Need option to set username different than e-mail for AD compatibility
This commit is contained in:
@@ -13,6 +13,15 @@
|
||||
|
||||
string AuthCookieName { get; }
|
||||
|
||||
string AuthCookieDomain { get; }
|
||||
string AuthCookieDomain { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A boolean indicating that by default the email address will be the username
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Even if this is true and the username is different from the email in the database, the username field will still be shown.
|
||||
/// When this is false, the username and email fields will be shown in the user section.
|
||||
/// </remarks>
|
||||
bool UsernameIsEmail { get; }
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,19 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
get { return GetOptionalTextElement("allowPasswordReset", true); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A boolean indicating that by default the email address will be the username
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Even if this is true and the username is different from the email in the database, the username field will still be shown.
|
||||
/// When this is false, the username and email fields will be shown in the user section.
|
||||
/// </remarks>
|
||||
[ConfigurationProperty("usernameIsEmail")]
|
||||
internal InnerTextConfigurationElement<bool> UsernameIsEmail
|
||||
{
|
||||
get { return GetOptionalTextElement("usernameIsEmail", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("authCookieName")]
|
||||
internal InnerTextConfigurationElement<string> AuthCookieName
|
||||
{
|
||||
@@ -55,6 +68,18 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
get { return AllowPasswordReset; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A boolean indicating that by default the email address will be the username
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Even if this is true and the username is different from the email in the database, the username field will still be shown.
|
||||
/// When this is false, the username and email fields will be shown in the user section.
|
||||
/// </remarks>
|
||||
bool ISecuritySection.UsernameIsEmail
|
||||
{
|
||||
get { return UsernameIsEmail; }
|
||||
}
|
||||
|
||||
string ISecuritySection.AuthCookieName
|
||||
{
|
||||
get { return AuthCookieName; }
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
vm.labels = {};
|
||||
vm.maxFileSize = Umbraco.Sys.ServerVariables.umbracoSettings.maxFileSize + "KB";
|
||||
vm.acceptedFileTypes = mediaHelper.formatFileTypes(Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes);
|
||||
vm.emailIsUsername = true;
|
||||
vm.usernameIsEmail = Umbraco.Sys.ServerVariables.umbracoSettings.usernameIsEmail;
|
||||
|
||||
//create the initial model for change password
|
||||
vm.changePasswordModel = {
|
||||
@@ -68,7 +68,7 @@
|
||||
setUserDisplayState();
|
||||
formatDatesToLocal(vm.user);
|
||||
|
||||
vm.emailIsUsername = user.email === user.username;
|
||||
vm.usernameIsEmail = Umbraco.Sys.ServerVariables.umbracoSettings.usernameIsEmail || user.email === user.username;
|
||||
|
||||
//go get the config for the membership provider and add it to the model
|
||||
authResource.getMembershipProviderConfig().then(function (data) {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<span class="help-inline" val-msg-for="email" val-toggle-msg="valServerField"></span>
|
||||
</umb-control-group>
|
||||
|
||||
<umb-control-group label="@general_username" ng-if="!vm.emailIsUsername" required="true">
|
||||
<umb-control-group label="@general_username" ng-if="!vm.usernameIsEmail" required="true">
|
||||
<input
|
||||
type="text"
|
||||
localize="placeholder"
|
||||
|
||||
@@ -286,6 +286,7 @@ namespace Umbraco.Web.Editors
|
||||
GetMaxRequestLength()
|
||||
},
|
||||
{"keepUserLoggedIn", UmbracoConfig.For.UmbracoSettings().Security.KeepUserLoggedIn},
|
||||
{"usernameIsEmail", UmbracoConfig.For.UmbracoSettings().Security.UsernameIsEmail},
|
||||
{"cssPath", IOHelper.ResolveUrl(SystemDirectories.Css).TrimEnd('/')},
|
||||
{"allowPasswordReset", UmbracoConfig.For.UmbracoSettings().Security.AllowPasswordReset},
|
||||
{"loginBackgroundImage", UmbracoConfig.For.UmbracoSettings().Content.LoginBackgroundImage},
|
||||
|
||||
Reference in New Issue
Block a user