blob: 869ad8d31934c5a1c509efd3b4d6e24c3f0f8a45 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
<?php
/**
* ownCloud - JavaScript XMPP Chat
*
* Copyright (c) 2014-2015 Klaus Herberth <klaus@jsxc.org> <br>
* Released under the MIT license
* @author Klaus Herberth <klaus@jsxc.org>
*/
OCP\App::registerAdmin ( 'ojsxc', 'settings' );
$jsxc_root = (defined('JSXC_ENV') && JSXC_ENV === 'dev')? 'jsxc/dev/' : 'jsxc/';
OCP\Util::addScript ( 'ojsxc', $jsxc_root.'lib/jquery.slimscroll' );
OCP\Util::addScript ( 'ojsxc', $jsxc_root.'lib/jquery.fullscreen' );
OCP\Util::addScript ( 'ojsxc', $jsxc_root.'lib/jsxc.dep' );
OCP\Util::addScript ( 'ojsxc', $jsxc_root.'jsxc' );
OCP\Util::addScript('ojsxc', 'ojsxc');
// ############# CSS #############
OCP\Util::addStyle ( 'ojsxc', 'jsxc.oc' );
if(class_exists('\\OCP\\AppFramework\\Http\\EmptyContentSecurityPolicy')) {
$manager = \OC::$server->getContentSecurityPolicyManager();
$policy = new \OCP\AppFramework\Http\EmptyContentSecurityPolicy();
$policy->addAllowedStyleDomain('\'self\'');
$policy->addAllowedStyleDomain('\'unsafe-inline\'');
$policy->addAllowedScriptDomain('\'self\'');
$policy->addAllowedImageDomain('\'self\'');
$policy->addAllowedImageDomain('data:');
$policy->addAllowedImageDomain('blob:');
$policy->addAllowedMediaDomain('\'self\'');
$policy->addAllowedMediaDomain('blob:');
$policy->addAllowedChildSrcDomain('\'self\'');
$policy->addAllowedConnectDomain('\'self\'');
$boshUrl = \OC::$server->getConfig()->getAppValue('ojsxc', 'boshUrl');
if(preg_match('#^(https?:)?//([a-z0-9][a-z0-9\-.]*[a-z0-9](:[0-9]+)?)/#i', $boshUrl, $matches)) {
$boshDomain = $matches[2];
$policy->addAllowedConnectDomain($boshDomain);
}
$manager->addDefaultPolicy($policy);
}
require_once __DIR__ ."/../vendor/autoload.php";
?>
|