From 528890dba01d6835754c78bf7695621c828b6838 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Tue, 26 Jul 2016 12:39:35 -0400
Subject: Changing LDAP behavour so users disabled in LDAP server are disabled
 in Mattermost. (#3669)

---
 webapp/components/admin_console/user_item.jsx | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

(limited to 'webapp/components/admin_console/user_item.jsx')

diff --git a/webapp/components/admin_console/user_item.jsx b/webapp/components/admin_console/user_item.jsx
index 3743c075d..b4e74057f 100644
--- a/webapp/components/admin_console/user_item.jsx
+++ b/webapp/components/admin_console/user_item.jsx
@@ -260,6 +260,11 @@ export default class UserItem extends React.Component {
             showMakeNotActive = false;
         }
 
+        let disableActivationToggle = false;
+        if (user.auth_service === Constants.LDAP_SERVICE) {
+            disableActivationToggle = true;
+        }
+
         let makeSystemAdmin = null;
         if (showMakeSystemAdmin) {
             makeSystemAdmin = (
@@ -332,10 +337,18 @@ export default class UserItem extends React.Component {
             );
         }
 
+        let menuClass = '';
+        if (disableActivationToggle) {
+            menuClass = 'disabled';
+        }
+
         let makeActive = null;
         if (showMakeActive) {
             makeActive = (
-                <li role='presentation'>
+                <li
+                    role='presentation'
+                    className={menuClass}
+                >
                     <a
                         role='menuitem'
                         href='#'
@@ -353,7 +366,10 @@ export default class UserItem extends React.Component {
         let makeNotActive = null;
         if (showMakeNotActive) {
             makeNotActive = (
-                <li role='presentation'>
+                <li
+                    role='presentation'
+                    className={menuClass}
+                >
                     <a
                         role='menuitem'
                         href='#'
-- 
cgit v1.2.3-1-g7c22

