From 58d3fc8fd5d70f344e60f2e0e69318b2700e4696 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 26 Feb 2024 02:54:44 +0100 Subject: [PATCH] Example for #1449 --- plugins/nextcloud/index.php | 6 ++++++ plugins/nextcloud/storage.php | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 plugins/nextcloud/storage.php diff --git a/plugins/nextcloud/index.php b/plugins/nextcloud/index.php index 37dd8006e..c6a31ae2d 100644 --- a/plugins/nextcloud/index.php +++ b/plugins/nextcloud/index.php @@ -328,6 +328,12 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin $this->Config()->Get('plugin', 'ignoreSystemAddressbook', true) ); } +/* + if ('storage' === $sName || 'storage-local' === $sName) { + require_once __DIR__ . '/storage.php'; + $oDriver = new \NextcloudStorage(APP_PRIVATE_DATA.'storage', $sName === 'storage-local'); + } +*/ } } diff --git a/plugins/nextcloud/storage.php b/plugins/nextcloud/storage.php new file mode 100644 index 000000000..05f38fb82 --- /dev/null +++ b/plugins/nextcloud/storage.php @@ -0,0 +1,22 @@ +getUserSession()->getUser()->getUID(); + $sDataPath .= "/.config/{$sUID}/"; + if ($bMkDir && !\is_dir($sDataPath) && !\mkdir($sDataPath, 0700, true)) { + throw new \RainLoop\Exceptions\Exception('Can\'t make storage directory "'.$sDataPath.'"'); + } + } + return $sDataPath; + } +}