summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/ajax/rollbackVersion.php
blob: f2c211d9c1ec944247c0469c5d1ca654e8331f13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

OCP\JSON::checkAppEnabled('files_versions');
OCP\JSON::callCheck();

$userDirectory = "/".OCP\USER::getUser()."/files";

$file = $_GET['file'];
$revision=(int)$_GET['revision'];

if(OCA_Versions\Storage::rollback( $file, $revision )) {
	OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
}else{
	OCP\JSON::error(array("data" => array( "message" => "Could not revert:" . $file )));
}