diff options
author | Sam Tuke <samtuke@jack-laptop.(none)> | 2012-04-27 13:19:16 +0100 |
---|---|---|
committer | Sam Tuke <samtuke@jack-laptop.(none)> | 2012-04-27 13:19:16 +0100 |
commit | 80c850d018baceca3a6197a7c21651c58d0edc25 (patch) | |
tree | 6bf962e30bf88e2e5397f598e0ec18938a38c4a8 /apps/files_versions/versions.php | |
parent | 768041b6cba5e8d4614e17d2ad492c855ec740a0 (diff) | |
download | nextcloud-server-80c850d018baceca3a6197a7c21651c58d0edc25.tar.gz nextcloud-server-80c850d018baceca3a6197a7c21651c58d0edc25.zip |
added revert attempt outcome messages, removed contextual ajax revert button for now as it's not functional, improved readaibility of scripts
Diffstat (limited to 'apps/files_versions/versions.php')
-rw-r--r-- | apps/files_versions/versions.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/files_versions/versions.php b/apps/files_versions/versions.php index 167c64a4345..ece84da468d 100644 --- a/apps/files_versions/versions.php +++ b/apps/files_versions/versions.php @@ -36,7 +36,7 @@ class Storage { const DEFAULTFOLDER='versions'; const DEFAULTBLACKLIST='avi mp3 mpg mp4'; const DEFAULTMAXFILESIZE=1048576; // 10MB - const DEFAULTMININTERVAL=1; // 5 min + const DEFAULTMININTERVAL=120; // 2 min const DEFAULTMAXVERSIONS=50; /** @@ -122,12 +122,26 @@ class Storage { * rollback to an old version of a file. */ public static function rollback($filename,$revision) { + if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') { + $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER); + $filesfoldername=\OC_Config::getValue('datadirectory').'/'. \OC_User::getUser() .'/files'; + // rollback - @copy($versionsfoldername.$filename.'.v'.$revision,$filesfoldername.$filename); + if ( @copy($versionsfoldername.$filename.'.v'.$revision,$filesfoldername.$filename) ) { + + return true; + + }else{ + + return false; + + } + } + } /** |