Don't run on OCC

Fixes https://github.com/nextcloud/user_saml/issues/46

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2016-11-14 14:08:55 +01:00
parent 4bacf21462
commit cab55e0dc4
No known key found for this signature in database
GPG key ID: B9F6980CF6E759B1

View file

@ -21,6 +21,12 @@
require_once __DIR__ . '/../3rdparty/vendor/autoload.php';
// If we run in CLI mode do not setup the app as it can fail the OCC execution
// since the URLGenerator isn't accessible.
if(OC::$CLI) {
return;
}
$urlGenerator = \OC::$server->getURLGenerator();
$config = \OC::$server->getConfig();
$request = \OC::$server->getRequest();