Add WOPI client settings
This commit is contained in:
parent
ce5528be4d
commit
08dbf236d9
@ -61,9 +61,8 @@ class DocumentController extends Controller{
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$policy = new ContentSecurityPolicy();
|
$policy = new ContentSecurityPolicy();
|
||||||
//$policy->addAllowedChildSrcDomain('\'self\' http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js http://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js \'unsafe-eval\'');
|
+ $policy->addAllowedScriptDomain('\'self\' http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js http://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js \'unsafe-eval\' ' . $this->settings->getAppValue('documents', 'wopi_url', $_SERVER['SERVER_NAME']));
|
||||||
$policy->addAllowedScriptDomain('\'self\' http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js http://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js \'unsafe-eval\'');
|
+ $policy->addAllowedFrameDomain('\'self\' http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js http://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js \'unsafe-eval\' ' . $this->settings->getAppValue('documents', 'wopi_url', $_SERVER['SERVER_NAME']));
|
||||||
$policy->addAllowedFrameDomain('\'self\' http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js http://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js \'unsafe-eval\'');
|
|
||||||
$policy->addAllowedConnectDomain('ws://' . $_SERVER['SERVER_NAME'] . ':9980');
|
$policy->addAllowedConnectDomain('ws://' . $_SERVER['SERVER_NAME'] . ':9980');
|
||||||
$policy->addAllowedImageDomain('*');
|
$policy->addAllowedImageDomain('*');
|
||||||
$policy->allowInlineScript(true);
|
$policy->allowInlineScript(true);
|
||||||
|
@ -78,6 +78,7 @@ class SettingsController extends Controller{
|
|||||||
'admin',
|
'admin',
|
||||||
[
|
[
|
||||||
'converter' => $this->appConfig->getAppValue('converter'),
|
'converter' => $this->appConfig->getAppValue('converter'),
|
||||||
|
'wopi_url' => $this->appConfig->getAppValue('wopi_url'),
|
||||||
'converter_url' => $this->appConfig->getAppValue('converter_url'),
|
'converter_url' => $this->appConfig->getAppValue('converter_url'),
|
||||||
],
|
],
|
||||||
'blank'
|
'blank'
|
||||||
@ -120,11 +121,15 @@ class SettingsController extends Controller{
|
|||||||
return array('status' => 'success');
|
return array('status' => 'success');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setConverter($converter, $url){
|
public function setConverter($converter, $wopi_url, $url){
|
||||||
if (!is_null($converter)){
|
if (!is_null($converter)){
|
||||||
$this->appConfig->setAppValue('converter', $converter);
|
$this->appConfig->setAppValue('converter', $converter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_null($wopi_url)){
|
||||||
|
$this->appConfig->setAppValue('wopi_url', $wopi_url);
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_null($url)){
|
if (!is_null($url)){
|
||||||
$this->appConfig->setAppValue('converter_url', $url);
|
$this->appConfig->setAppValue('converter_url', $url);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,8 @@ $(document).ready(function(){
|
|||||||
save : function() {
|
save : function() {
|
||||||
$('#docs_apply').attr('disabled', true);
|
$('#docs_apply').attr('disabled', true);
|
||||||
var data = {
|
var data = {
|
||||||
converter : $('[name="docs_converter"]:checked').val()
|
converter : $('[name="docs_converter"]:checked').val(),
|
||||||
|
wopi_url : $('#wopi_url').val()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (data.converter === 'external'){
|
if (data.converter === 'external'){
|
||||||
|
@ -18,7 +18,8 @@ use \OCP\IConfig;
|
|||||||
private $defaults = [
|
private $defaults = [
|
||||||
'converter' => 'off',
|
'converter' => 'off',
|
||||||
'converter_url' => 'http://localhost:16080',
|
'converter_url' => 'http://localhost:16080',
|
||||||
'unstable' => 'false'
|
'unstable' => 'false',
|
||||||
|
'wopi_url' => 'htpp://localhost'
|
||||||
];
|
];
|
||||||
|
|
||||||
private $config;
|
private $config;
|
||||||
|
@ -33,6 +33,11 @@ script('richdocuments', 'admin');
|
|||||||
/>
|
/>
|
||||||
<br /><em><?php p($l->t('Server URL')) ?></em>
|
<br /><em><?php p($l->t('Server URL')) ?></em>
|
||||||
</div>
|
</div>
|
||||||
|
<br />
|
||||||
|
<div id="wopi_client">
|
||||||
|
<input type="text" name="wopi_url" id="wopi_url" value="<?php p($_['wopi_url'])?>" style="width:250px;">
|
||||||
|
<br /><em><?php p($l->t('WOPI Client')) ?></em>
|
||||||
|
</div>
|
||||||
<br /><button type="button" id="docs_apply"><?php p($l->t('Apply and test')) ?></button>
|
<br /><button type="button" id="docs_apply"><?php p($l->t('Apply and test')) ?></button>
|
||||||
<span id="documents-admin-msg" class="msg"></span>
|
<span id="documents-admin-msg" class="msg"></span>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user