server/apps/files_versions/ajax/rollbackVersion.php

16 lines
478 B
PHP
Raw Normal View History

<?php
OCP\JSON::checkLoggedIn();
2012-05-03 10:23:29 +00:00
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{
2014-08-31 08:05:59 +00:00
$l = \OC::$server->getL10N('files_versions');
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
}