mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
Add customizations for CUSTOMER16 employees' realm
CUSTOMER16 wants their employee realm to: * only use JWT logins * have name changes be disabled (they want users' full names to be the their CUSTOMER16 user name). * not show the suggestion that users download the desktop app (imported from commit cb5f72c993ddc26132ce50165bb68c3000276de0)
This commit is contained in:
@@ -40,6 +40,8 @@ exports.left_side_userlist = _.contains(['customer7.invalid'], page_params.domai
|
|||||||
//the settings.html django template. See zerver/views/__init__.py:home(request).
|
//the settings.html django template. See zerver/views/__init__.py:home(request).
|
||||||
exports.show_autoscroll_forever_option = page_params.show_autoscroll_forever_option;
|
exports.show_autoscroll_forever_option = page_params.show_autoscroll_forever_option;
|
||||||
|
|
||||||
|
exports.enable_new_user_app_alerts = ! _.contains(['employees.customer16.invalid'], page_params.domain);
|
||||||
|
|
||||||
// Still very beta:
|
// Still very beta:
|
||||||
|
|
||||||
exports.full_width = false; //page_params.staging;
|
exports.full_width = false; //page_params.staging;
|
||||||
|
|||||||
@@ -349,12 +349,14 @@ function finale() {
|
|||||||
|
|
||||||
var alert_contents;
|
var alert_contents;
|
||||||
|
|
||||||
if (page_params.prompt_for_invites) {
|
if (page_params.enable_new_user_app_alerts) {
|
||||||
alert_contents = "<i class='icon-vector-heart alert-icon'></i>It's lonely in here! <a href='#invite-user' data-toggle='modal'>Invite some coworkers</a>.";
|
if (page_params.prompt_for_invites) {
|
||||||
} else {
|
alert_contents = "<i class='icon-vector-heart alert-icon'></i>It's lonely in here! <a href='#invite-user' data-toggle='modal'>Invite some coworkers</a>.";
|
||||||
alert_contents = "<i class='icon-vector-desktop alert-icon'></i>What's better than Zulip in your browser? The <a href='/apps' target='_blank'>Zulip desktop app</a>!";
|
} else {
|
||||||
|
alert_contents = "<i class='icon-vector-desktop alert-icon'></i>What's better than Zulip in your browser? The <a href='/apps' target='_blank'>Zulip desktop app</a>!";
|
||||||
|
}
|
||||||
|
show_app_alert(alert_contents);
|
||||||
}
|
}
|
||||||
show_app_alert(alert_contents);
|
|
||||||
|
|
||||||
// We start you in a narrow so it's not overwhelming.
|
// We start you in a narrow so it's not overwhelming.
|
||||||
if (stream_data.in_home_view(page_params.notifications_stream)) {
|
if (stream_data.in_home_view(page_params.notifications_stream)) {
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ def principal_to_user_profile(agent, principal):
|
|||||||
|
|
||||||
def name_changes_disabled(realm):
|
def name_changes_disabled(realm):
|
||||||
return (settings.NAME_CHANGES_DISABLED
|
return (settings.NAME_CHANGES_DISABLED
|
||||||
or realm.domain in ('users.customer4.invalid'))
|
or realm.domain in ('users.customer4.invalid', 'employees.customer16.invalid'))
|
||||||
|
|
||||||
@require_post
|
@require_post
|
||||||
@has_request_variables
|
@has_request_variables
|
||||||
@@ -302,6 +302,12 @@ def accounts_register(request):
|
|||||||
form = RegistrationForm(
|
form = RegistrationForm(
|
||||||
initial={'full_name': hesiod_name if "@" not in hesiod_name else ""})
|
initial={'full_name': hesiod_name if "@" not in hesiod_name else ""})
|
||||||
name_validated = True
|
name_validated = True
|
||||||
|
elif domain == 'employees.customer16.invalid':
|
||||||
|
full_name = email.rpartition('@')[0]
|
||||||
|
form = RegistrationForm(
|
||||||
|
initial={'full_name': full_name})
|
||||||
|
name_validated = True
|
||||||
|
request.session['authenticated_full_name'] = full_name
|
||||||
elif settings.POPULATE_PROFILE_VIA_LDAP:
|
elif settings.POPULATE_PROFILE_VIA_LDAP:
|
||||||
for backend in get_backends():
|
for backend in get_backends():
|
||||||
if isinstance(backend, LDAPBackend):
|
if isinstance(backend, LDAPBackend):
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ from apiclient.sample_tools import client as googleapiclient
|
|||||||
from oauth2client.crypt import AppIdentityError
|
from oauth2client.crypt import AppIdentityError
|
||||||
|
|
||||||
def password_auth_enabled(realm):
|
def password_auth_enabled(realm):
|
||||||
|
if realm.domain == 'employees.customer16.invalid':
|
||||||
|
return False
|
||||||
for backend in django.contrib.auth.get_backends():
|
for backend in django.contrib.auth.get_backends():
|
||||||
if isinstance(backend, EmailAuthBackend):
|
if isinstance(backend, EmailAuthBackend):
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Secret Django settings for the Zulip project
|
# Secret Django settings for the Zulip project
|
||||||
import platform
|
import platform
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
|
from base64 import b64decode
|
||||||
|
|
||||||
config_file = ConfigParser.RawConfigParser()
|
config_file = ConfigParser.RawConfigParser()
|
||||||
config_file.read("/etc/zulip/zulip.conf")
|
config_file.read("/etc/zulip/zulip.conf")
|
||||||
|
|||||||
Reference in New Issue
Block a user