summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/appinfo/update.php
diff options
context:
space:
mode:
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>2015-08-05 01:00:42 +0300
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>2015-08-10 23:54:44 +0300
commit33c29d3da75447da6a659239e8a2b60c72230588 (patch)
tree00fc25a66474e67b305f14c8f1d118c4c7a1f504 /apps/files_trashbin/appinfo/update.php
parent4ef26157880f5cd5d5bd27abe0a6991d7c8a415a (diff)
downloadnextcloud-server-33c29d3da75447da6a659239e8a2b60c72230588.tar.gz
nextcloud-server-33c29d3da75447da6a659239e8a2b60c72230588.zip
Migrate settings
Diffstat (limited to 'apps/files_trashbin/appinfo/update.php')
-rw-r--r--apps/files_trashbin/appinfo/update.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/files_trashbin/appinfo/update.php b/apps/files_trashbin/appinfo/update.php
index e1a0cf95576..b77210ae4c0 100644
--- a/apps/files_trashbin/appinfo/update.php
+++ b/apps/files_trashbin/appinfo/update.php
@@ -20,10 +20,29 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-$installedVersion=OCP\Config::getAppValue('files_trashbin', 'installed_version');
+
+$config = \OC::$server->getConfig();
+$installedVersion = $config->getAppValue('files_trashbin', 'installed_version');
if (version_compare($installedVersion, '0.6', '<')) {
//size of the trash bin could be incorrect, remove it for all users to
//enforce a recalculation during next usage.
\OC_DB::dropTable('files_trashsize');
}
+
+if (version_compare($installedVersion, '0.6.4', '<')) {
+ $isExpirationEnabled = $config->getSystemValue('trashbin_auto_expire', true);
+ $oldObligation = $config->getSystemValue('trashbin_retention_obligation', null);
+
+ $newObligation = 'auto';
+ if ($isExpirationEnabled) {
+ if (!is_null($oldObligation)) {
+ $newObligation = strval($oldObligation) . ', auto';
+ }
+ } else {
+ $newObligation = 'disabled';
+ }
+
+ $config->setSystemValue('trashbin_retention_obligation', $newObligation);
+ $config->deleteSystemValue('trashbin_auto_expire');
+}