diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2017-07-28 13:52:31 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-07-28 11:52:31 -0600 |
commit | 3c0f082506a68240abd1960cbd0fda22679e12c2 (patch) | |
tree | 395a1e9ecdb1eb2c6d7bf7141e3364cc043d9edd /webapp/components | |
parent | da6e6ca0bf3f880b60de8d809a7588dfbec3a77a (diff) | |
download | chat-3c0f082506a68240abd1960cbd0fda22679e12c2.tar.gz chat-3c0f082506a68240abd1960cbd0fda22679e12c2.tar.bz2 chat-3c0f082506a68240abd1960cbd0fda22679e12c2.zip |
PLT-6924 Added config options to disable file uploads/downloads on mobile (#7049)
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/admin_console/storage_settings.jsx | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/webapp/components/admin_console/storage_settings.jsx b/webapp/components/admin_console/storage_settings.jsx index 1400b673c..934a82f8f 100644 --- a/webapp/components/admin_console/storage_settings.jsx +++ b/webapp/components/admin_console/storage_settings.jsx @@ -26,6 +26,8 @@ export default class StorageSettings extends AdminSettings { getConfigFromState(config) { config.FileSettings.EnableFileAttachments = this.state.enableFileAttachments; + config.FileSettings.EnableMobileUpload = this.state.enableMobileUpload; + config.FileSettings.EnableMobileDownload = this.state.enableMobileDownload; config.FileSettings.MaxFileSize = this.parseInt(this.state.maxFileSize) * 1024 * 1024; config.FileSettings.DriverName = this.state.driverName; config.FileSettings.Directory = this.state.directory; @@ -41,6 +43,8 @@ export default class StorageSettings extends AdminSettings { getStateFromConfig(config) { return { enableFileAttachments: config.FileSettings.EnableFileAttachments, + enableMobileUpload: config.FileSettings.EnableMobileUpload, + enableMobileDownload: config.FileSettings.EnableMobileDownload, maxFileSize: config.FileSettings.MaxFileSize / 1024 / 1024, driverName: config.FileSettings.DriverName, directory: config.FileSettings.Directory, @@ -206,18 +210,54 @@ export default class StorageSettings extends AdminSettings { label={ <FormattedMessage id='admin.file.enableFileAttachments' - defaultMessage='Enable File Attachments:' + defaultMessage='Allow File Sharing:' /> } helpText={ <FormattedMessage id='admin.file.enableFileAttachmentsDesc' - defaultMessage='When false, disable file and image uploads on messages.' + defaultMessage='When false, disables file sharing on the server. All file and image uploads on messages are forbidden across clients and devices, including mobile.' /> } value={this.state.enableFileAttachments} onChange={this.handleChange} /> + <BooleanSetting + id='enableMobileUpload' + label={ + <FormattedMessage + id='admin.file.enableMobileUploadTitle' + defaultMessage='Allow File Uploads on Mobile:' + /> + } + helpText={ + <FormattedMessage + id='admin.file.enableMobileUploadDesc' + defaultMessage='When false, disables file uploads on mobile apps. If Allow File Sharing is set to true, users can still upload files from a mobile web browser.' + /> + } + value={this.state.enableMobileUpload} + onChange={this.handleChange} + disabled={!this.state.enableFileAttachments} + /> + <BooleanSetting + id='enableMobileDownload' + label={ + <FormattedMessage + id='admin.file.enableMobileDownloadTitle' + defaultMessage='Allow File Downloads on Mobile:' + /> + } + helpText={ + <FormattedMessage + id='admin.file.enableMobileDownloadDesc' + defaultMessage='When false, disables file downloads on mobile apps. Users can still download files from a mobile web browser.' + /> + } + value={this.state.enableMobileDownload} + onChange={this.handleChange} + disabled={!this.state.enableFileAttachments} + /> <TextSetting id='maxFileSize' label={ |