rollbackVersion.php 434 B

123456789101112131415
  1. <?php
  2. OCP\JSON::checkAppEnabled('files_versions');
  3. OCP\JSON::callCheck();
  4. $file = $_GET['file'];
  5. $revision=(int)$_GET['revision'];
  6. if(OCA\Files_Versions\Storage::rollback( $file, $revision )) {
  7. OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
  8. }else{
  9. $l = OC_L10N::get('files_versions');
  10. OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
  11. }