summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/ajax/getVersions.php1
-rw-r--r--apps/files_versions/ajax/togglesettings.php10
-rw-r--r--apps/files_versions/appinfo/app.php2
-rw-r--r--apps/files_versions/js/versions.js14
-rw-r--r--apps/files_versions/lib/versions.php6
-rw-r--r--apps/files_versions/settings.php9
-rw-r--r--apps/files_versions/templates/settings.php9
7 files changed, 5 insertions, 46 deletions
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index 8a8fa43080c..f9174c45a65 100644
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -3,7 +3,6 @@ OCP\JSON::checkAppEnabled('files_versions');
$source = $_GET['source'];
list ($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($source);
-
$count = 5; //show the newest revisions
if( ($versions = OCA\Files_Versions\Storage::getVersions($uid, $filename, $count)) ) {
diff --git a/apps/files_versions/ajax/togglesettings.php b/apps/files_versions/ajax/togglesettings.php
deleted file mode 100644
index 546b37ae1aa..00000000000
--- a/apps/files_versions/ajax/togglesettings.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-OCP\JSON::checkAppEnabled('files_versions');
-OCP\JSON::checkAdminUser();
-OCP\JSON::callCheck();
-if (OCP\Config::getSystemValue('versions', 'true')=='true') {
- OCP\Config::setSystemValue('versions', 'false');
-} else {
- OCP\Config::setSystemValue('versions', 'true');
-}
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index 8e0356ada20..ae48b0cc10a 100644
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -4,8 +4,6 @@
OC::$CLASSPATH['OCA\Files_Versions\Storage'] = 'apps/files_versions/lib/versions.php';
OC::$CLASSPATH['OCA\Files_Versions\Hooks'] = 'apps/files_versions/lib/hooks.php';
-OCP\App::registerAdmin('files_versions', 'settings');
-
OCP\Util::addscript('files_versions', 'versions');
// Listen to write signals
diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js
index 109829fa03f..b82b9001fdb 100644
--- a/apps/files_versions/js/versions.js
+++ b/apps/files_versions/js/versions.js
@@ -1,19 +1,9 @@
-$(document).ready(function() {
- $('#versions').bind('change', function() {
- var checked = 1;
- if (!this.checked) {
- checked = 0;
- }
- $.post(OC.filePath('files_versions','ajax','togglesettings.php'), 'versions='+checked);
- });
-});
-
$(document).ready(function(){
if (typeof FileActions !== 'undefined') {
- // Add history button to 'files/index.php'
+ // Add versions button to 'files/index.php'
FileActions.register(
'file'
- , t('files_versions', 'History')
+ , t('files_versions', 'Versions')
, OC.PERMISSION_UPDATE
, function() {
// Specify icon for hitory button
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 778fefd8a72..12f8fdaa0dc 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -107,7 +107,7 @@ class Storage {
// store a new version of a file
$users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename));
$versionsSize = self::getVersionsSize($uid);
- if ( $versionsSize === false || $versionSize < 0 ) {
+ if ( $versionsSize === false || $versionsSize < 0 ) {
$versionsSize = self::calculateSize($uid);
}
@@ -208,10 +208,10 @@ class Storage {
if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
$versions_fileview = new \OC\Files\View('/' . $uid . '/files_versions');
- $versionsName = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
+ $versionsName = \OC_Filesystem::normalizePath(\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename));
$versions = array();
// fetch for old versions
- $matches = glob( $versionsName.'.v*' );
+ $matches = glob(preg_quote($versionsName).'.v*' );
if ( !$matches ) {
return $versions;
diff --git a/apps/files_versions/settings.php b/apps/files_versions/settings.php
deleted file mode 100644
index f2873b8f7c2..00000000000
--- a/apps/files_versions/settings.php
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-
-OCP\User::checkAdminUser();
-
-OCP\Util::addscript( 'files_versions', 'versions' );
-
-$tmpl = new OCP\Template( 'files_versions', 'settings');
-
-return $tmpl->fetchPage();
diff --git a/apps/files_versions/templates/settings.php b/apps/files_versions/templates/settings.php
deleted file mode 100644
index 3b8e4baf119..00000000000
--- a/apps/files_versions/templates/settings.php
+++ /dev/null
@@ -1,9 +0,0 @@
-<form id="versionssettings">
- <fieldset class="personalblock">
- <legend><strong><?php echo $l->t('Files Versioning');?></strong></legend>
- <input type="checkbox" name="versions" id="versions" value="1"
- <?php if (OCP\Config::getSystemValue('versions', 'true')=='true')
- echo ' checked="checked"';
- ?> /> <label for="versions"><?php echo $l->t('Enable'); ?></label> <br/>
- </fieldset>
-</form>