Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-06-09 21:10:26 +0300
committerLukas Reschke <lukas@owncloud.com>2016-06-10 16:49:58 +0300
commit22bbb047a05d68506ada9a331bc3c649e67c7e5e (patch)
treed4afe9bd4fa76831c8b59474a7094a7b7fa1c02d /apps
parent0880cba8161940257ed66345d89f327c260989ea (diff)
log events from versions app
Diffstat (limited to 'apps')
-rw-r--r--apps/admin_audit/lib/actions/versions.php45
-rw-r--r--apps/admin_audit/lib/auditlogger.php8
2 files changed, 53 insertions, 0 deletions
diff --git a/apps/admin_audit/lib/actions/versions.php b/apps/admin_audit/lib/actions/versions.php
new file mode 100644
index 00000000000..006c33bf04f
--- /dev/null
+++ b/apps/admin_audit/lib/actions/versions.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * @copyright Bjoern Schiessle <bjoern@schiessle.org>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+namespace OCA\Admin_Audit\Actions;
+
+
+class Versions extends Action {
+
+ public function rollback($params) {
+ $this->log('Version "%s" of "%s" was restored.',
+ [
+ 'version' => $params['revision'],
+ 'path' => $params['path']
+ ],
+ ['version', 'path']
+ );
+ }
+
+ public function delete($params) {
+ $this->log('Version "%s" was deleted.',
+ ['path' => $params['path']],
+ ['path']
+ );
+ }
+
+}
diff --git a/apps/admin_audit/lib/auditlogger.php b/apps/admin_audit/lib/auditlogger.php
index e3cfd42f5d0..f7dae10701f 100644
--- a/apps/admin_audit/lib/auditlogger.php
+++ b/apps/admin_audit/lib/auditlogger.php
@@ -30,6 +30,7 @@ use OCA\Admin_Audit\Actions\GroupManagement;
use OCA\Admin_Audit\Actions\Sharing;
use OCA\Admin_Audit\Actions\Trashbin;
use OCA\Admin_Audit\Actions\UserManagement;
+use OCA\Admin_Audit\Actions\Versions;
use OCP\IGroupManager;
use OCP\ILogger;
use OCP\IUserSession;
@@ -71,6 +72,7 @@ class AuditLogger {
$this->authHooks();
$this->fileHooks();
$this->trashbinHooks();
+ $this->versionsHooks();
}
/**
@@ -166,6 +168,12 @@ class AuditLogger {
);
}
+ public function versionsHooks() {
+ $versionsActions = new Versions($this->logger);
+ Util::connectHook('\OCP\Versions', 'rollback', $versionsActions, 'rollback');
+ Util::connectHook('\OCP\Versions', 'delete',$versionsActions, 'delete');
+ }
+
/**
* connect to trash bin hooks
*/