mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
Allow enterprise customers to disable name changes
(imported from commit 1f2039f3e88a4ec0cc48dba75f714563c1de4af8)
This commit is contained in:
@@ -55,12 +55,16 @@ $(function () {
|
|||||||
|
|
||||||
avatar.build_user_avatar_widget(upload_avatar);
|
avatar.build_user_avatar_widget(upload_avatar);
|
||||||
|
|
||||||
if (page_params.domain === "users.customer4.invalid") {
|
if (page_params.domain === "users.customer4.invalid" ||
|
||||||
|
page_params.name_changes_disabled) {
|
||||||
// At the request of the facilitators, CUSTOMER4 users
|
// At the request of the facilitators, CUSTOMER4 users
|
||||||
// can't change their names, so don't show that as a settings
|
// can't change their names, so don't show that as a settings
|
||||||
// option. This is also disabled through the JSON UI. Once we
|
// option. This is also disabled through the JSON UI. Once we
|
||||||
// have the infrastructure for administrative policies, we can
|
// have the infrastructure for administrative policies, we can
|
||||||
// handle this more gracefully.
|
// handle this more gracefully.
|
||||||
|
//
|
||||||
|
// Additionally, if this install has disabled name changes, hide the
|
||||||
|
// container
|
||||||
$("#name_change_container").hide();
|
$("#name_change_container").hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -725,6 +725,7 @@ def home(request):
|
|||||||
muted_topics = register_ret['muted_topics'],
|
muted_topics = register_ret['muted_topics'],
|
||||||
show_admin = user_profile.show_admin,
|
show_admin = user_profile.show_admin,
|
||||||
notify_for_streams_by_default = notify_for_streams_by_default(user_profile),
|
notify_for_streams_by_default = notify_for_streams_by_default(user_profile),
|
||||||
|
name_changes_disabled = settings.NAME_CHANGES_DISABLED,
|
||||||
has_mobile_devices = num_push_devices_for_user(user_profile) > 0
|
has_mobile_devices = num_push_devices_for_user(user_profile) > 0
|
||||||
))
|
))
|
||||||
|
|
||||||
@@ -1745,11 +1746,15 @@ def json_change_settings(request, user_profile,
|
|||||||
|
|
||||||
result = {}
|
result = {}
|
||||||
if user_profile.full_name != full_name and full_name.strip() != "":
|
if user_profile.full_name != full_name and full_name.strip() != "":
|
||||||
if user_profile.realm.domain == "users.customer4.invalid":
|
if settings.NAME_CHANGES_DISABLED or \
|
||||||
|
user_profile.realm.domain == "users.customer4.invalid":
|
||||||
# At the request of the facilitators, CUSTOMER4
|
# At the request of the facilitators, CUSTOMER4
|
||||||
# students can't change their names. Failingly silently is
|
# students can't change their names. Failingly silently is
|
||||||
# fine -- they can't do it through the UI, so they'd have
|
# fine -- they can't do it through the UI, so they'd have
|
||||||
# to be trying to break the rules.
|
# to be trying to break the rules.
|
||||||
|
#
|
||||||
|
# Additionally, if this install has disabled name changes altogether,
|
||||||
|
# ignore name changes as well
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
new_full_name = full_name.strip()
|
new_full_name = full_name.strip()
|
||||||
|
|||||||
@@ -71,6 +71,10 @@ INLINE_IMAGE_PREVIEW = True
|
|||||||
# setting up the appropriate integration.
|
# setting up the appropriate integration.
|
||||||
LOCAL_UPLOADS_DIR = "/home/zulip/uploads"
|
LOCAL_UPLOADS_DIR = "/home/zulip/uploads"
|
||||||
|
|
||||||
|
# Controls whether name changes are completely disabled for this installation
|
||||||
|
# This is useful in settings where you're syncing names from an integrated LDAP/Active Directory
|
||||||
|
NAME_CHANGES_DISABLED = False
|
||||||
|
|
||||||
### TWITTER INTEGRATION
|
### TWITTER INTEGRATION
|
||||||
|
|
||||||
# Zulip supports showing inline Tweet previews when a tweet is linked
|
# Zulip supports showing inline Tweet previews when a tweet is linked
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
|
|||||||
'LOCAL_UPLOADS_DIR': None,
|
'LOCAL_UPLOADS_DIR': None,
|
||||||
'DROPBOX_APP_KEY': '',
|
'DROPBOX_APP_KEY': '',
|
||||||
'ERROR_REPORTING': True,
|
'ERROR_REPORTING': True,
|
||||||
|
'NAME_CHANGES_DISABLED': False,
|
||||||
'DEPLOYMENT_ROLE_NAME': ADMIN_DOMAIN,
|
'DEPLOYMENT_ROLE_NAME': ADMIN_DOMAIN,
|
||||||
# The following bots only exist in non-ENTERPRISE installs
|
# The following bots only exist in non-ENTERPRISE installs
|
||||||
'ERROR_BOT': None,
|
'ERROR_BOT': None,
|
||||||
|
|||||||
Reference in New Issue
Block a user