diff --git a/integrations/nextcloud/snappymail/INSTALL b/integrations/nextcloud/snappymail/INSTALL index d9c57d60b..a77fd58f1 100755 --- a/integrations/nextcloud/snappymail/INSTALL +++ b/integrations/nextcloud/snappymail/INSTALL @@ -7,7 +7,7 @@ ************************************************************************ REQUIREMENTS: -- Nextcloud version 14 and above +- Nextcloud version 18 and above INSTALL & CONFIGURATION: Start within Nextcloud, and click on the "+ Apps" button in the upper-left corner dropdown menu: diff --git a/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php b/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php index b9d5c6653..16e49a66c 100644 --- a/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php +++ b/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php @@ -47,12 +47,21 @@ class SnappyMailHelper if (!\class_exists('RainLoop\\Api')) { if ($api) { $_ENV['SNAPPYMAIL_INCLUDE_AS_API'] = true; + } else { + $_SERVER['SCRIPT_NAME'] = \OC::$server->getAppManager()->getAppWebPath('snappymail') . '/app/index.php'; } $_ENV['SNAPPYMAIL_NEXTCLOUD'] = true; - $sData = \rtrim(\trim(\OC::$server->getSystemConfig()->getValue('datadirectory', '')), '\\/').'/'; + $sData = \rtrim(\trim(\OC::$server->getSystemConfig()->getValue('datadirectory', '')), '\\/').'/snappymail/'; if (\is_dir($sData)) { \define('APP_DATA_FOLDER_PATH', $sData); } + // Nextcloud the default spl_autoload_register() not working + \spl_autoload_register(function($sClassName){ + $file = RAINLOOP_APP_LIBRARIES_PATH . \strtolower(\strtr($sClassName, '\\', DIRECTORY_SEPARATOR)) . '.php'; + if (is_file($file)) { + include_once $file; + } + }); require_once \OC::$server->getAppManager()->getAppPath('snappymail') . '/app/index.php'; } }