mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Nextcloud allow in iframe #537
This commit is contained in:
parent
0d715c0bb4
commit
e3d2250e19
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue