From ceaaf2243c1f8a3568476c3e32ab6046b33731bd Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 10 May 2016 12:49:17 -0400 Subject: Fixing configuration file (#2948) --- config/config.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/config.json b/config/config.json index 7eff8ad37..b62713a91 100644 --- a/config/config.json +++ b/config/config.json @@ -148,8 +148,7 @@ "IdAttribute": "", "SkipCertificateVerification": false, "QueryTimeout": 60, - "LoginFieldName": "", - "PasswordFieldName": "" + "LoginFieldName": "" }, "ComplianceSettings": { "Enable": false, -- cgit v1.2.3-1-g7c22 From c8285185a91c48f9b6db866b65b293cb9eceeb65 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Tue, 10 May 2016 09:54:11 -0700 Subject: PLT-2806 sending websocket when adding user to team (#2953) * PLT-2806 sending websocket when adding user to team * Fixing config file --- api/team.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/team.go b/api/team.go index 6db8bc245..605aa590b 100644 --- a/api/team.go +++ b/api/team.go @@ -275,6 +275,9 @@ func JoinUserToTeam(team *model.Team, user *model.User) *model.AppError { RemoveAllSessionsForUserId(user.Id) InvalidateCacheForUser(user.Id) + // This message goes to every channel, so the channelId is irrelevant + PublishAndForget(model.NewMessage("", "", user.Id, model.ACTION_NEW_USER)) + return nil } -- cgit v1.2.3-1-g7c22 From 338223d204c76c713acd6ae2165e5d97c71f3c18 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Tue, 10 May 2016 23:47:57 +0500 Subject: Fixing DM separator and margin on system console (#2944) Fixing margins on system console --- webapp/components/admin_console/setting.jsx | 2 +- webapp/sass/layout/_sidebar-left.scss | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/webapp/components/admin_console/setting.jsx b/webapp/components/admin_console/setting.jsx index 8fc5c2ad8..7dee6c8dc 100644 --- a/webapp/components/admin_console/setting.jsx +++ b/webapp/components/admin_console/setting.jsx @@ -5,7 +5,7 @@ import React from 'react'; export default class Setting extends React.Component { render() { - let marginClass; + let marginClass = ''; if (this.props.margin === 'small') { marginClass = ' form-group--small'; } diff --git a/webapp/sass/layout/_sidebar-left.scss b/webapp/sass/layout/_sidebar-left.scss index ad23df6ca..7ac1fee75 100644 --- a/webapp/sass/layout/_sidebar-left.scss +++ b/webapp/sass/layout/_sidebar-left.scss @@ -16,9 +16,10 @@ color: $white; font-size: .9em; height: 20px; - margin: 5px 0 6px; line-height: 20px; + margin: 5px 0 6px; position: relative; + z-index: 0; &:before { background: $light-gray; -- cgit v1.2.3-1-g7c22 From 2dbc1a50fa6deb6e79e6ee463740ee14eaa7a55e Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 10 May 2016 20:37:12 -0400 Subject: Fix compliance saving and reload page when enabling/disabling compliance (#2960) --- webapp/components/admin_console/compliance_settings.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/components/admin_console/compliance_settings.jsx b/webapp/components/admin_console/compliance_settings.jsx index b127634e8..53f060e11 100644 --- a/webapp/components/admin_console/compliance_settings.jsx +++ b/webapp/components/admin_console/compliance_settings.jsx @@ -2,7 +2,7 @@ // See License.txt for license information. import $ from 'jquery'; -import * as Client from '../../utils/web_client.jsx'; +import Client from 'utils/web_client.jsx'; import * as AsyncClient from '../../utils/async_client.jsx'; import * as Utils from '../../utils/utils.jsx'; @@ -40,6 +40,7 @@ export default class ComplianceSettings extends React.Component { $('#save-button').button('loading'); const config = this.props.config; + const oldEnable = config.ComplianceSettings.Enable; config.ComplianceSettings.Enable = this.refs.Enable.checked; config.ComplianceSettings.Directory = ReactDOM.findDOMNode(this.refs.Directory).value; config.ComplianceSettings.EnableDaily = this.refs.EnableDaily.checked; @@ -47,12 +48,15 @@ export default class ComplianceSettings extends React.Component { Client.saveConfig( config, () => { + $('#save-button').button('reset'); AsyncClient.getConfig(); this.setState({ serverError: null, saveNeeded: false }); - $('#save-button').button('reset'); + if (oldEnable !== config.ComplianceSettings.Enable) { + window.location.reload(); + } }, (err) => { this.setState({ -- cgit v1.2.3-1-g7c22 From 95cc21fb716c1810041c2b438641125ec71dbf5c Mon Sep 17 00:00:00 2001 From: David Lu Date: Wed, 11 May 2016 08:02:36 -0400 Subject: Fixed username restriction display errors (#2952) --- webapp/components/user_settings/user_settings_general.jsx | 6 +++--- webapp/i18n/en.json | 4 ++-- webapp/i18n/es.json | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/webapp/components/user_settings/user_settings_general.jsx b/webapp/components/user_settings/user_settings_general.jsx index b48026a39..be1d1e6c5 100644 --- a/webapp/components/user_settings/user_settings_general.jsx +++ b/webapp/components/user_settings/user_settings_general.jsx @@ -23,7 +23,7 @@ const holders = defineMessages({ }, usernameRestrictions: { id: 'user.settings.general.usernameRestrictions', - defaultMessage: "Pick something easy for teammates to recognize and recall. Username must begin with a letter, and contain between {min} to {max} lowercase characters made up of numbers, letters, and the symbols '.', '-', and '_'" + defaultMessage: "Username must begin with a letter, and contain between {min} to {max} lowercase characters made up of numbers, letters, and the symbols '.', '-', and '_'." }, validEmail: { id: 'user.settings.general.validEmail', @@ -108,7 +108,7 @@ class UserSettingsGeneralTab extends React.Component { this.setState({clientError: formatMessage(holders.usernameReserved)}); return; } else if (usernameError) { - this.setState({clientError: formatMessage(holders.usernameRestrictions, {min: Constants.MIN_USERNAME_LENGTH}, {max: Constants.MAX_USERNAME_LENGTH})}); + this.setState({clientError: formatMessage(holders.usernameRestrictions, {min: Constants.MIN_USERNAME_LENGTH, max: Constants.MAX_USERNAME_LENGTH})}); return; } @@ -773,7 +773,7 @@ class UserSettingsGeneralTab extends React.Component { ); diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 0c3da96ed..b622c9ab1 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -1341,9 +1341,9 @@ "user.settings.general.title": "General Settings", "user.settings.general.uploadImage": "Click 'Edit' to upload an image.", "user.settings.general.username": "Username", - "user.settings.general.usernameInfo": "Pick something easy for teammates to recognize and recall. Username must begin with a letter, and contain between {min) to {max} lowercase characters made up of numbers, letters, and the symbols '.', '-', and '_'.", + "user.settings.general.usernameInfo": "Pick something easy for teammates to recognize and recall.", "user.settings.general.usernameReserved": "This username is reserved, please choose a new one.", - "user.settings.general.usernameRestrictions": "Pick something easy for teammates to recognize and recall. Username must begin with a letter, and contain between {min} to {max} lowercase characters made up of numbers, letters, and the symbols '.', '-', and '_'.", + "user.settings.general.usernameRestrictions": "Username must begin with a letter, and contain between {min} to {max} lowercase characters made up of numbers, letters, and the symbols '.', '-', and '_'.", "user.settings.general.validEmail": "Please enter a valid email address", "user.settings.general.validImage": "Only JPG or PNG images may be used for profile pictures", "user.settings.import_theme.cancel": "Cancel", diff --git a/webapp/i18n/es.json b/webapp/i18n/es.json index 62bd460f7..ce29d234b 100644 --- a/webapp/i18n/es.json +++ b/webapp/i18n/es.json @@ -1341,9 +1341,7 @@ "user.settings.general.title": "Configuración General", "user.settings.general.uploadImage": "Pinchar 'Editar' para subir una imagen.", "user.settings.general.username": "Nombre de usuario", - "user.settings.general.usernameInfo": "Escoge algo que sea sencillo para que tus compañeros reconozcan y puedan asociar. El nombre de usuario debe comenzar con una letra, y tener entre {min) y {max} caracteres en minúscula y componerse en numeros, letras y los símboloes '.', '-', y '_'.", "user.settings.general.usernameReserved": "Este nombre de usuario está reservado, por favor escoge otro", - "user.settings.general.usernameRestrictions": "Escoge algo que sea sencillo para que tus compañeros reconozcan y puedan asociar. El nombre de usuario debe comenzar con una letra, y tener entre {min) y {max} caracteres en minúscula y componerse en numeros, letras y los símboloes '.', '-', y '_'.", "user.settings.general.validEmail": "Por favor ingresa una dirección de correo electrónico válida", "user.settings.general.validImage": "Sólo pueden ser utilizadas imágenes JPG o PNG en el perfil", "user.settings.import_theme.cancel": "Cancelar", -- cgit v1.2.3-1-g7c22 From 720222f3a65fbe0de53aec84730af5ba37794c42 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 11 May 2016 08:04:01 -0400 Subject: Removing export route (#2955) --- api/team.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/api/team.go b/api/team.go index 605aa590b..f9b718e06 100644 --- a/api/team.go +++ b/api/team.go @@ -41,7 +41,6 @@ func InitTeam() { // These should be moved to the global admain console BaseRoutes.NeedTeam.Handle("/import_team", ApiUserRequired(importTeam)).Methods("POST") - BaseRoutes.NeedTeam.Handle("/export_team", ApiUserRequired(exportTeam)).Methods("GET") BaseRoutes.Teams.Handle("/add_user_to_team_from_invite", ApiUserRequired(addUserToTeamFromInvite)).Methods("POST") } @@ -753,25 +752,6 @@ func importTeam(c *Context, w http.ResponseWriter, r *http.Request) { http.ServeContent(w, r, "MattermostImportLog.txt", time.Now(), bytes.NewReader(log.Bytes())) } -func exportTeam(c *Context, w http.ResponseWriter, r *http.Request) { - if !c.HasPermissionsToTeam(c.TeamId, "export") || !c.IsTeamAdmin() { - c.Err = model.NewLocAppError("exportTeam", "api.team.export_team.admin.app_error", nil, "userId="+c.Session.UserId) - c.Err.StatusCode = http.StatusForbidden - return - } - - options := ExportOptionsFromJson(r.Body) - - if link, err := ExportToFile(options); err != nil { - c.Err = err - return - } else { - result := map[string]string{} - result["link"] = link - w.Write([]byte(model.MapToJson(result))) - } -} - func getInviteInfo(c *Context, w http.ResponseWriter, r *http.Request) { m := model.MapFromJson(r.Body) inviteId := m["invite_id"] -- cgit v1.2.3-1-g7c22 From a12e575877d0fcfc90a1f3fd3a7fc7878a12a757 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 11 May 2016 08:04:13 -0400 Subject: Fixing email invite link handling (#2956) --- webapp/client/client.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx index c81c5a1d7..12cf21f5c 100644 --- a/webapp/client/client.jsx +++ b/webapp/client/client.jsx @@ -542,8 +542,14 @@ export default class Client { createUserWithInvite = (user, data, emailHash, inviteId, success, error) => { var url = `${this.getUsersRoute()}/create`; - if (data || emailHash || inviteId) { - url += '?d=' + encodeURIComponent(data) + '&h=' + encodeURIComponent(emailHash) + '&iid=' + encodeURIComponent(inviteId); + url += '?d=' + encodeURIComponent(data); + + if (emailHash) { + url += '&h=' + encodeURIComponent(emailHash); + } + + if (inviteId) { + url += '&iid=' + encodeURIComponent(inviteId); } request. -- cgit v1.2.3-1-g7c22 From d7197943f0e645c6a5a3c463ae9df2beab1256b9 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Wed, 11 May 2016 05:24:20 -0700 Subject: Fixing compliance reporting (#2964) --- api/admin.go | 2 +- webapp/components/admin_console/compliance_reports.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/admin.go b/api/admin.go index 7ab2c9cfc..8f66f60c1 100644 --- a/api/admin.go +++ b/api/admin.go @@ -33,7 +33,7 @@ func InitAdmin() { BaseRoutes.Admin.Handle("/analytics/{name:[A-Za-z0-9_]+}", ApiUserRequired(getAnalytics)).Methods("GET") BaseRoutes.Admin.Handle("/save_compliance_report", ApiUserRequired(saveComplianceReport)).Methods("POST") BaseRoutes.Admin.Handle("/compliance_reports", ApiUserRequired(getComplianceReports)).Methods("GET") - BaseRoutes.Admin.Handle("/download_compliance_report/{id:[A-Za-z0-9]+}", ApiUserRequired(downloadComplianceReport)).Methods("GET") + BaseRoutes.Admin.Handle("/download_compliance_report/{id:[A-Za-z0-9]+}", ApiUserRequiredTrustRequester(downloadComplianceReport)).Methods("GET") BaseRoutes.Admin.Handle("/upload_brand_image", ApiAdminSystemRequired(uploadBrandImage)).Methods("POST") BaseRoutes.Admin.Handle("/get_brand_image", ApiAppHandlerTrustRequester(getBrandImage)).Methods("GET") BaseRoutes.Admin.Handle("/reset_mfa", ApiAdminSystemRequired(adminResetMfa)).Methods("POST") diff --git a/webapp/components/admin_console/compliance_reports.jsx b/webapp/components/admin_console/compliance_reports.jsx index 702c1a969..04b2c4deb 100644 --- a/webapp/components/admin_console/compliance_reports.jsx +++ b/webapp/components/admin_console/compliance_reports.jsx @@ -7,7 +7,7 @@ import * as Utils from '../../utils/utils.jsx'; import AdminStore from '../../stores/admin_store.jsx'; import UserStore from '../../stores/user_store.jsx'; -import * as Client from '../../utils/web_client.jsx'; +import Client from 'utils/web_client.jsx'; import * as AsyncClient from '../../utils/async_client.jsx'; import {FormattedMessage, FormattedDate, FormattedTime} from 'react-intl'; -- cgit v1.2.3-1-g7c22 From a574397a7256bed7738f499019f97ab468b5161d Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 11 May 2016 11:44:45 -0400 Subject: Pull direct profiles when switching teams (#2965) --- webapp/root.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webapp/root.jsx b/webapp/root.jsx index 3f1edda38..2b54c2174 100644 --- a/webapp/root.jsx +++ b/webapp/root.jsx @@ -132,6 +132,7 @@ function preNeedsTeam(nextState, replace, callback) { // for the current url. var teamName = Utils.getTeamNameFromUrl(); var team = TeamStore.getByName(teamName); + const oldTeamId = TeamStore.getCurrentId(); if (!team) { browserHistory.push('/'); @@ -143,6 +144,12 @@ function preNeedsTeam(nextState, replace, callback) { TeamStore.saveMyTeam(team); TeamStore.emitChange(); + // If the old team id is null then we will already have the direct + // profiles from initial load + if (oldTeamId != null) { + AsyncClient.getDirectProfiles(); + } + var d1 = $.Deferred(); //eslint-disable-line new-cap var d2 = $.Deferred(); //eslint-disable-line new-cap -- cgit v1.2.3-1-g7c22