From eeb1c1b5b827cc20ae32449bfc8c227152ba1a9d Mon Sep 17 00:00:00 2001
From: Reed Garmsen <rgarmsen2295@gmail.com>
Date: Fri, 29 Jan 2016 13:29:43 -0800
Subject: Properly disable the get team link functionality when user creation
 is disabled

---
 web/react/components/get_team_invite_link_modal.jsx | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'web/react/components/get_team_invite_link_modal.jsx')

diff --git a/web/react/components/get_team_invite_link_modal.jsx b/web/react/components/get_team_invite_link_modal.jsx
index 883871267..299729250 100644
--- a/web/react/components/get_team_invite_link_modal.jsx
+++ b/web/react/components/get_team_invite_link_modal.jsx
@@ -16,6 +16,10 @@ const holders = defineMessages({
     help: {
         id: 'get_team_invite_link_modal.help',
         defaultMessage: 'Send teammates the link below for them to sign-up to this team site.'
+    },
+    helpDisabled: {
+        id: 'get_team_invite_link_modal.helpDisabled',
+        defaultMessage: 'User creation has been disabled for your team. Please ask your team administrator for details.'
     }
 });
 
@@ -47,12 +51,18 @@ class GetTeamInviteLinkModal extends React.Component {
     render() {
         const {formatMessage} = this.props.intl;
 
+        let helpText = formatMessage(holders.helpDisabled);
+
+        if (global.window.mm_config.EnableUserCreation === 'true') {
+            helpText = formatMessage(holders.help);
+        }
+
         return (
             <GetLinkModal
                 show={this.state.show}
                 onHide={() => this.setState({show: false})}
                 title={formatMessage(holders.title)}
-                helpText={formatMessage(holders.help)}
+                helpText={helpText}
                 link={TeamStore.getCurrentInviteLink()}
             />
         );
-- 
cgit v1.2.3-1-g7c22

