mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-09 06:35:37 +08:00
Adds support for business servers
If the WOPI_BUSINESS_USERS environmental variable is set and true, indicates to Office online that all users are business users when trying to view/edit files
This commit is contained in:
parent
53a1dd14b7
commit
bd9904adb3
1 changed files with 9 additions and 2 deletions
|
@ -380,10 +380,17 @@ class Asset < ActiveRecord::Base
|
||||||
action = get_action(file_ext, action)
|
action = get_action(file_ext, action)
|
||||||
if !action.nil?
|
if !action.nil?
|
||||||
action_url = action.urlsrc
|
action_url = action.urlsrc
|
||||||
action_url = action_url.gsub(/<IsLicensedUser=BUSINESS_USER&>/,
|
if (ENV['WOPI_BUSINESS_USERS']) {
|
||||||
|
action_url = action_url.gsub(/<IsLicensedUser=BUSINESS_USER&>/,
|
||||||
|
'IsLicensedUser=1&')
|
||||||
|
action_url = action_url.gsub(/<IsLicensedUser=BUSINESS_USER>/,
|
||||||
|
'IsLicensedUser=1')
|
||||||
|
} else {
|
||||||
|
action_url = action_url.gsub(/<IsLicensedUser=BUSINESS_USER&>/,
|
||||||
'IsLicensedUser=0&')
|
'IsLicensedUser=0&')
|
||||||
action_url = action_url.gsub(/<IsLicensedUser=BUSINESS_USER>/,
|
action_url = action_url.gsub(/<IsLicensedUser=BUSINESS_USER>/,
|
||||||
'IsLicensedUser=0')
|
'IsLicensedUser=0')
|
||||||
|
}
|
||||||
action_url = action_url.gsub(/<.*?=.*?>/, '')
|
action_url = action_url.gsub(/<.*?=.*?>/, '')
|
||||||
|
|
||||||
rest_url = Rails.application.routes.url_helpers.wopi_rest_endpoint_url(
|
rest_url = Rails.application.routes.url_helpers.wopi_rest_endpoint_url(
|
||||||
|
|
Loading…
Add table
Reference in a new issue