From 3f8dda6f5ad676c976fd5ae575a6790fdb505449 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Fri, 29 Jul 2016 14:58:37 -0400
Subject: PLT-3633 EE: Add Google and Office365 SSO through OAuth2 (#3660)

* EE: Add Google and Office365 SSO through OAuth2

* Add localization strings

* Text tweaks for PLT-3633

* Added sign-up button for Office 365

* Updated some error messages and a bit of licensing

* Updated sign-in method section in user settings to include Google and Office365

* Added more localization strings
---
 .../user_settings/user_settings_general.jsx        | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)

(limited to 'webapp/components/user_settings/user_settings_general.jsx')

diff --git a/webapp/components/user_settings/user_settings_general.jsx b/webapp/components/user_settings/user_settings_general.jsx
index 8dce4deed..d1c195c7e 100644
--- a/webapp/components/user_settings/user_settings_general.jsx
+++ b/webapp/components/user_settings/user_settings_general.jsx
@@ -419,6 +419,42 @@ class UserSettingsGeneralTab extends React.Component {
                         {helpText}
                     </div>
                 );
+            } else if (this.props.user.auth_service === Constants.GOOGLE_SERVICE) {
+                inputs.push(
+                    <div
+                        key='oauthEmailInfo'
+                        className='form-group'
+                    >
+                        <div className='setting-list__hint'>
+                            <FormattedMessage
+                                id='user.settings.general.emailGoogleCantUpdate'
+                                defaultMessage='Login occurs through Google Apps. Email cannot be updated. Email address used for notifications is {email}.'
+                                values={{
+                                    email: this.state.email
+                                }}
+                            />
+                        </div>
+                        {helpText}
+                    </div>
+                );
+            } else if (this.props.user.auth_service === Constants.OFFICE365_SERVICE) {
+                inputs.push(
+                    <div
+                        key='oauthEmailInfo'
+                        className='form-group'
+                    >
+                        <div className='setting-list__hint'>
+                            <FormattedMessage
+                                id='user.settings.general.emailOffice365CantUpdate'
+                                defaultMessage='Login occurs through Office 365. Email cannot be updated. Email address used for notifications is {email}.'
+                                values={{
+                                    email: this.state.email
+                                }}
+                            />
+                        </div>
+                        {helpText}
+                    </div>
+                );
             } else if (this.props.user.auth_service === Constants.LDAP_SERVICE) {
                 inputs.push(
                     <div
@@ -511,6 +547,26 @@ class UserSettingsGeneralTab extends React.Component {
                         }}
                     />
                 );
+            } else if (this.props.user.auth_service === Constants.GOOGLE_SERVICE) {
+                describe = (
+                    <FormattedMessage
+                        id='user.settings.general.loginGoogle'
+                        defaultMessage='Login done through Google Apps ({email})'
+                        values={{
+                            email: this.state.email
+                        }}
+                    />
+                );
+            } else if (this.props.user.auth_service === Constants.OFFICE365_SERVICE) {
+                describe = (
+                    <FormattedMessage
+                        id='user.settings.general.loginOffice365'
+                        defaultMessage='Login done through Office 365 ({email})'
+                        values={{
+                            email: this.state.email
+                        }}
+                    />
+                );
             } else if (this.props.user.auth_service === Constants.LDAP_SERVICE) {
                 describe = (
                     <FormattedMessage
-- 
cgit v1.2.3-1-g7c22

