diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-05-30 17:46:49 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-14 17:44:41 +0200 |
commit | 4510571aa15d18d958947efd380b211a9a12aaaa (patch) | |
tree | 4e9d75b41730a4845cdb529a86f391887bbca549 /apps/files_sharing | |
parent | 12b34d2dda6569f0f06ead29488c19ec8b9a5a8c (diff) | |
download | nextcloud-server-4510571aa15d18d958947efd380b211a9a12aaaa.tar.gz nextcloud-server-4510571aa15d18d958947efd380b211a9a12aaaa.zip |
Add app for logging access to shared files
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/sharedstorage.php | 16 |
1 files changed, 16 insertions, 0 deletions
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); } |