Nextcloud allow in iframe #537

This commit is contained in:
the-djmaze 2023-02-23 16:33:38 +01:00
parent 0d715c0bb4
commit e3d2250e19
2 changed files with 13 additions and 1 deletions

View file

@ -38,6 +38,7 @@ class PageController extends Controller
]); ]);
$csp = new ContentSecurityPolicy(); $csp = new ContentSecurityPolicy();
$csp->addAllowedFrameDomain("'self'"); $csp->addAllowedFrameDomain("'self'");
// $csp->addAllowedFrameAncestorDomain("'self'");
$response->setContentSecurityPolicy($csp); $response->setContentSecurityPolicy($csp);
return $response; return $response;
} }

View file

@ -4,7 +4,7 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
{ {
const const
NAME = 'Nextcloud', NAME = 'Nextcloud',
VERSION = '2.19', VERSION = '2.20',
RELEASE = '2023-02-22', RELEASE = '2023-02-22',
CATEGORY = 'Integrations', CATEGORY = 'Integrations',
DESCRIPTION = 'Integrate with Nextcloud v20+', DESCRIPTION = 'Integrate with Nextcloud v20+',
@ -33,6 +33,17 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
$this->addTemplate('templates/PopupsNextcloudFiles.html'); $this->addTemplate('templates/PopupsNextcloudFiles.html');
$this->addTemplate('templates/PopupsNextcloudCalendars.html'); $this->addTemplate('templates/PopupsNextcloudCalendars.html');
} else {
// \OC::$server->getConfig()->getAppValue('snappymail', 'snappymail-no-embed');
$this->addHook('main.content-security-policy', 'ContentSecurityPolicy');
}
}
public function ContentSecurityPolicy(\SnappyMail\HTTP\CSP $CSP)
{
if (\method_exists($CSP, 'add')) {
$CSP->add('frame-ancestors', "'self'");
} }
} }