From 20735470185e0b0ac1d15b975041ed9a2e0e43bc Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 11 Aug 2016 14:35:08 -0400 Subject: Update licensing switches for Office365 and Google SSO through OAuth2 (#3786) --- model/license.go | 16 ++++++++-------- utils/config.go | 4 ++-- utils/license.go | 4 ++-- webapp/components/admin_console/oauth_settings.jsx | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/model/license.go b/model/license.go index a27b36263..98b88fdeb 100644 --- a/model/license.go +++ b/model/license.go @@ -35,8 +35,8 @@ type Features struct { Users *int `json:"users"` LDAP *bool `json:"ldap"` MFA *bool `json:"mfa"` - GoogleSSO *bool `json:"google_sso"` - Office365SSO *bool `json:"office365_sso"` + GoogleOAuth *bool `json:"google_oauth"` + Office365OAuth *bool `json:"office365_oauth"` Compliance *bool `json:"compliance"` Cluster *bool `json:"cluster"` CustomBrand *bool `json:"custom_brand"` @@ -67,14 +67,14 @@ func (f *Features) SetDefaults() { *f.MFA = *f.FutureFeatures } - if f.GoogleSSO == nil { - f.GoogleSSO = new(bool) - *f.GoogleSSO = true + if f.GoogleOAuth == nil { + f.GoogleOAuth = new(bool) + *f.GoogleOAuth = *f.FutureFeatures } - if f.Office365SSO == nil { - f.Office365SSO = new(bool) - *f.Office365SSO = true + if f.Office365OAuth == nil { + f.Office365OAuth = new(bool) + *f.Office365OAuth = *f.FutureFeatures } if f.Compliance == nil { diff --git a/utils/config.go b/utils/config.go index 6646a341e..6a4c9c90c 100644 --- a/utils/config.go +++ b/utils/config.go @@ -299,11 +299,11 @@ func getClientConfig(c *model.Config) map[string]string { props["EnableCluster"] = strconv.FormatBool(*c.ClusterSettings.Enable) } - if *License.Features.GoogleSSO { + if *License.Features.GoogleOAuth { props["EnableSignUpWithGoogle"] = strconv.FormatBool(c.GoogleSettings.Enable) } - if *License.Features.Office365SSO { + if *License.Features.Office365OAuth { props["EnableSignUpWithOffice365"] = strconv.FormatBool(c.Office365Settings.Enable) } diff --git a/utils/license.go b/utils/license.go index 246cc553e..f0a91665e 100644 --- a/utils/license.go +++ b/utils/license.go @@ -123,8 +123,8 @@ func getClientLicense(l *model.License) map[string]string { props["MFA"] = strconv.FormatBool(*l.Features.MFA) props["SAML"] = strconv.FormatBool(*l.Features.SAML) props["Cluster"] = strconv.FormatBool(*l.Features.Cluster) - props["GoogleSSO"] = strconv.FormatBool(*l.Features.GoogleSSO) - props["Office365SSO"] = strconv.FormatBool(*l.Features.Office365SSO) + props["GoogleOAuth"] = strconv.FormatBool(*l.Features.GoogleOAuth) + props["Office365OAuth"] = strconv.FormatBool(*l.Features.Office365OAuth) props["Compliance"] = strconv.FormatBool(*l.Features.Compliance) props["CustomBrand"] = strconv.FormatBool(*l.Features.CustomBrand) props["MHPNS"] = strconv.FormatBool(*l.Features.MHPNS) diff --git a/webapp/components/admin_console/oauth_settings.jsx b/webapp/components/admin_console/oauth_settings.jsx index 1f377bcc3..716889401 100644 --- a/webapp/components/admin_console/oauth_settings.jsx +++ b/webapp/components/admin_console/oauth_settings.jsx @@ -402,10 +402,10 @@ export default class OAuthSettings extends AdminSettings { oauthTypes.push({value: 'off', text: Utils.localizeMessage('admin.oauth.off', 'Do not allow sign-in via an OAuth 2.0 provider.')}); oauthTypes.push({value: Constants.GITLAB_SERVICE, text: Utils.localizeMessage('admin.oauth.gitlab', 'GitLab')}); if (global.window.mm_license.IsLicensed === 'true') { - if (global.window.mm_license.GoogleSSO === 'true') { + if (global.window.mm_license.GoogleOAuth === 'true') { oauthTypes.push({value: Constants.GOOGLE_SERVICE, text: Utils.localizeMessage('admin.oauth.google', 'Google Apps')}); } - if (global.window.mm_license.Office365SSO === 'true') { + if (global.window.mm_license.Office365OAuth === 'true') { oauthTypes.push({value: Constants.OFFICE365_SERVICE, text: Utils.localizeMessage('admin.oauth.office365', 'Office 365 (Beta)')}); } } -- cgit v1.2.3-1-g7c22