2012-04-26 13:45:17 -04:00
|
|
|
<?php
|
|
|
|
|
|
2012-05-03 06:23:29 -04:00
|
|
|
OCP\JSON::checkAppEnabled('files_versions');
|
2012-07-17 05:57:38 -04:00
|
|
|
OCP\JSON::callCheck();
|
2012-04-26 13:45:17 -04:00
|
|
|
|
2012-05-16 20:16:33 -04:00
|
|
|
$file = $_GET['file'];
|
|
|
|
|
$revision=(int)$_GET['revision'];
|
2012-04-26 13:45:17 -04:00
|
|
|
|
2012-09-19 14:59:57 -04:00
|
|
|
if(OCA\Files_Versions\Storage::rollback( $file, $revision )) {
|
2013-01-11 08:23:28 -05:00
|
|
|
OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
|
|
|
|
|
}else{
|
2013-02-07 10:17:54 -05:00
|
|
|
$l = OC_L10N::get('files_versions');
|
2013-02-07 10:34:57 -05:00
|
|
|
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
|
2012-04-26 13:45:17 -04:00
|
|
|
}
|