Avoid showing the email input when viewing the full affiliations UI; disable affiliations when using SAML and LDAP authentication strategies.
This commit is contained in:
@@ -20,5 +20,7 @@ module.exports = Features =
|
|||||||
return Settings.overleaf?
|
return Settings.overleaf?
|
||||||
when 'templates'
|
when 'templates'
|
||||||
return !Settings.overleaf?
|
return !Settings.overleaf?
|
||||||
|
when 'affiliations'
|
||||||
|
return !(Settings.ldap? or Settings.saml?)
|
||||||
else
|
else
|
||||||
throw new Error("unknown feature: #{feature}")
|
throw new Error("unknown feature: #{feature}")
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ block content
|
|||||||
.page-header
|
.page-header
|
||||||
h1 #{translate("account_settings")}
|
h1 #{translate("account_settings")}
|
||||||
.account-settings(ng-controller="AccountSettingsController", ng-cloak)
|
.account-settings(ng-controller="AccountSettingsController", ng-cloak)
|
||||||
if locals.showAffiliationsUI
|
if locals.showAffiliationsUI && hasFeature('affiliations')
|
||||||
include settings/user-affiliations
|
include settings/user-affiliations
|
||||||
|
|
||||||
form-messages(for="settingsForm")
|
form-messages(for="settingsForm")
|
||||||
@@ -22,25 +22,26 @@ block content
|
|||||||
h3 #{translate("update_account_info")}
|
h3 #{translate("update_account_info")}
|
||||||
form(async-form="settings", name="settingsForm", method="POST", action="/user/settings", novalidate)
|
form(async-form="settings", name="settingsForm", method="POST", action="/user/settings", novalidate)
|
||||||
input(type="hidden", name="_csrf", value=csrfToken)
|
input(type="hidden", name="_csrf", value=csrfToken)
|
||||||
if !externalAuthenticationSystemUsed()
|
if !(locals.showAffiliationsUI && hasFeature('affiliations'))
|
||||||
.form-group
|
if !externalAuthenticationSystemUsed()
|
||||||
label(for='email') #{translate("email")}
|
.form-group
|
||||||
input.form-control(
|
label(for='email') #{translate("email")}
|
||||||
type='email',
|
input.form-control(
|
||||||
name='email',
|
type='email',
|
||||||
placeholder="email@example.com"
|
name='email',
|
||||||
required,
|
placeholder="email@example.com"
|
||||||
ng-model="email",
|
required,
|
||||||
ng-init="email = "+JSON.stringify(user.email),
|
ng-model="email",
|
||||||
ng-model-options="{ updateOn: 'blur' }"
|
ng-init="email = "+JSON.stringify(user.email),
|
||||||
)
|
ng-model-options="{ updateOn: 'blur' }"
|
||||||
span.small.text-primary(ng-show="settingsForm.email.$invalid && settingsForm.email.$dirty")
|
)
|
||||||
| #{translate("must_be_email_address")}
|
span.small.text-primary(ng-show="settingsForm.email.$invalid && settingsForm.email.$dirty")
|
||||||
else
|
| #{translate("must_be_email_address")}
|
||||||
// show the email, non-editable
|
else
|
||||||
.form-group
|
// show the email, non-editable
|
||||||
label.control-label #{translate("email")}
|
.form-group
|
||||||
div.form-control(readonly="true") #{user.email}
|
label.control-label #{translate("email")}
|
||||||
|
div.form-control(readonly="true") #{user.email}
|
||||||
|
|
||||||
if shouldAllowEditingDetails
|
if shouldAllowEditingDetails
|
||||||
.form-group
|
.form-group
|
||||||
|
|||||||
Reference in New Issue
Block a user