aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/ajax
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_versions/ajax')
-rw-r--r--apps/files_versions/ajax/getVersions.php5
-rw-r--r--apps/files_versions/ajax/rollbackVersion.php11
2 files changed, 7 insertions, 9 deletions
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index 8476e5e8a51..600e69cf798 100644
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -4,10 +4,9 @@ OCP\JSON::checkAppEnabled('files_versions');
$userDirectory = "/".OCP\USER::getUser()."/files";
$source = $_GET['source'];
-if( OCA_Versions\Storage::isversioned( $source ) ) {
+$count = 5; //show the newest revisions
+if( ($versions = OCA_Versions\Storage::getVersions( $source, $count)) ) {
- $count=5; //show the newest revisions
- $versions = OCA_Versions\Storage::getVersions( $source, $count);
$versionsFormatted = array();
foreach ( $versions AS $version ) {
diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php
index f1b02eb4b92..f2c211d9c1e 100644
--- a/apps/files_versions/ajax/rollbackVersion.php
+++ b/apps/files_versions/ajax/rollbackVersion.php
@@ -8,10 +8,9 @@ $userDirectory = "/".OCP\USER::getUser()."/files";
$file = $_GET['file'];
$revision=(int)$_GET['revision'];
-if( OCA_Versions\Storage::isversioned( $file ) ) {
- 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 )));
- }
+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 )));
}
+