From f2e788f4b12517759e016a9f48633597bed82e8f Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 5 May 2016 16:36:42 -0400 Subject: Allow system admins to switch user accounts to email/password (#2893) --- .../admin_console/reset_password_modal.jsx | 25 ++++++++--- webapp/components/admin_console/user_item.jsx | 48 ++++++++++++++++------ webapp/i18n/en.json | 4 +- 3 files changed, 59 insertions(+), 18 deletions(-) (limited to 'webapp') diff --git a/webapp/components/admin_console/reset_password_modal.jsx b/webapp/components/admin_console/reset_password_modal.jsx index 5133f3f28..c383a4fb8 100644 --- a/webapp/components/admin_console/reset_password_modal.jsx +++ b/webapp/components/admin_console/reset_password_modal.jsx @@ -58,7 +58,8 @@ class ResetPasswordModal extends React.Component { } render() { - if (this.props.user == null) { + const user = this.props.user; + if (user == null) { return
; } @@ -70,6 +71,23 @@ class ResetPasswordModal extends React.Component { serverError =

{this.state.serverError}

; } + let title; + if (user.auth_service) { + title = ( + + ); + } else { + title = ( + + ); + } + return ( - + {title}
); + + passwordReset = ( +
  • + + + +
  • + ); } else { authServiceText = ( ); + + passwordReset = ( +
  • + + + +
  • + ); + } + + if (global.window.mm_config.EnableSignInWithEmail !== 'true') { + passwordReset = null; } const me = UserStore.getCurrentUser(); @@ -474,18 +509,7 @@ export default class UserItem extends React.Component { {makeNotActive} {makeSystemAdmin} {mfaReset} -
  • - - - -
  • + {passwordReset}
    diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 7fbe464c1..63669d546 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -378,7 +378,8 @@ "admin.reset_password.newPassword": "New Password", "admin.reset_password.select": "Select", "admin.reset_password.submit": "Please enter at least {chars} characters.", - "admin.reset_password.title": "Reset Password", + "admin.reset_password.titleReset": "Reset Password", + "admin.reset_password.titleSwitch": "Switch Account to Email/Password", "admin.select_team.close": "Close", "admin.select_team.select": "Select", "admin.select_team.selectTeam": "Select Team", @@ -563,6 +564,7 @@ "admin.user_item.mfaYes": ", MFA: Yes", "admin.user_item.resetMfa": "Remove MFA", "admin.user_item.resetPwd": "Reset Password", + "admin.user_item.switchToEmail": "Switch to Email/Password", "admin.user_item.sysAdmin": "System Admin", "admin.user_item.teamAdmin": "Team Admin", "analytics.chart.loading": "Loading...", -- cgit v1.2.3-1-g7c22