From 4510571aa15d18d958947efd380b211a9a12aaaa Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Wed, 30 May 2012 17:46:49 +0200 Subject: Add app for logging access to shared files --- apps/files_sharing/sharedstorage.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'apps/files_sharing') diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index 3bb6e73035e..e8aa73dd564 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -320,6 +320,11 @@ class OC_Filestorage_Shared extends OC_Filestorage { public function file_get_contents($path) { $source = $this->getSource($path); if ($source) { + $info = array( + 'target' => $this->datadir.$path, + 'source' => $source, + ); + OCP\Util::emitHook('OC_Filestorage_Shared', 'file_get_contents', $info); $storage = OC_Filesystem::getStorage($source); return $storage->file_get_contents($this->getInternalPath($source)); } @@ -329,6 +334,11 @@ class OC_Filestorage_Shared extends OC_Filestorage { if ($this->is_writable($path)) { $source = $this->getSource($path); if ($source) { + $info = array( + 'target' => $this->datadir.$path, + 'source' => $source, + ); + OCP\Util::emitHook('OC_Filestorage_Shared', 'file_put_contents', $info); $storage = OC_Filesystem::getStorage($source); $result = $storage->file_put_contents($this->getInternalPath($source), $data); if ($result) { @@ -416,6 +426,12 @@ class OC_Filestorage_Shared extends OC_Filestorage { public function fopen($path, $mode) { $source = $this->getSource($path); if ($source) { + $info = array( + 'target' => $this->datadir.$path, + 'source' => $source, + 'mode' => $mode, + ); + OCP\Util::emitHook('OC_Filestorage_Shared', 'fopen', $info); $storage = OC_Filesystem::getStorage($source); return $storage->fopen($this->getInternalPath($source), $mode); } -- cgit v1.2.3