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

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

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

if(OCA\Files_Versions\Storage::rollback( $file, $revision )) {
	OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
}else{
	$l = \OC::$server->getL10N('files_versions');
	OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
}