mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: sso_overrides_(email|username|name) for all auth methods
These settings previously applied only to discourse-sso. Now they work for all external authentication methods.
This commit is contained in:
@@ -2,7 +2,7 @@ import getURL from "discourse-common/lib/get-url";
|
||||
import I18n from "I18n";
|
||||
import { A } from "@ember/array";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { notEmpty, or, not } from "@ember/object/computed";
|
||||
import { notEmpty, and } from "@ember/object/computed";
|
||||
import Controller, { inject as controller } from "@ember/controller";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||
@@ -69,7 +69,8 @@ export default Controller.extend(
|
||||
return false;
|
||||
},
|
||||
|
||||
usernameRequired: not("authOptions.omit_username"),
|
||||
usernameDisabled: and("authOptions", "!authOptions.can_edit_username"),
|
||||
nameDisabled: and("authOptions", "!authOptions.can_edit_name"),
|
||||
|
||||
@discourseComputed
|
||||
fullnameRequired() {
|
||||
|
||||
@@ -389,6 +389,6 @@ export default Controller.extend(ModalFunctionality, {
|
||||
authOptions: EmberObject.create(options)
|
||||
});
|
||||
|
||||
showModal("createAccount");
|
||||
showModal("createAccount", { modalClass: "create-account" });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
<tr class="input create-account-email">
|
||||
<td class="label"><label for="new-account-email">{{i18n "user.email.title"}}</label></td>
|
||||
<td>
|
||||
{{input type="email" value=accountEmail id="new-account-email" disabled=emailValidated name="email" autofocus="autofocus"}}
|
||||
{{#if emailValidated}}
|
||||
<span class="value">{{accountEmail}}</span>
|
||||
{{else}}
|
||||
{{input type="email" value=accountEmail id="new-account-email" name="email" autofocus="autofocus"}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -25,19 +29,21 @@
|
||||
<td><label>{{i18n "user.email.instructions"}}</label></td>
|
||||
</tr>
|
||||
|
||||
{{#if usernameRequired}}
|
||||
<tr class="input">
|
||||
<td class="label"><label for="new-account-username">{{i18n "user.username.title"}}</label></td>
|
||||
<td>
|
||||
<tr class="input">
|
||||
<td class="label"><label for="new-account-username">{{i18n "user.username.title"}}</label></td>
|
||||
<td>
|
||||
{{#if usernameDisabled}}
|
||||
<span class="value">{{accountUsername}}</span>
|
||||
{{else}}
|
||||
{{input value=accountUsername id="new-account-username" name="username" maxlength=maxUsernameLength autocomplete="discourse"}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="instructions">
|
||||
<td></td>
|
||||
{{input-tip validation=usernameValidation id="username-validation"}}
|
||||
<td><label>{{i18n "user.username.instructions"}}</label></td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="instructions">
|
||||
<td></td>
|
||||
{{input-tip validation=usernameValidation id="username-validation"}}
|
||||
<td><label>{{i18n "user.username.instructions"}}</label></td>
|
||||
</tr>
|
||||
|
||||
{{#if fullnameRequired}}
|
||||
<tr class="input">
|
||||
@@ -45,7 +51,11 @@
|
||||
<label for="new-account-name">{{i18n "user.name.title"}}</label>
|
||||
</td>
|
||||
<td>
|
||||
{{text-field value=accountName id="new-account-name"}}
|
||||
{{#if nameDisabled}}
|
||||
<span class="value">{{accountName}}</span>
|
||||
{{else}}
|
||||
{{text-field value=accountName id="new-account-name"}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="instructions">
|
||||
|
||||
Reference in New Issue
Block a user