diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-01-22 13:19:41 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-01-22 13:19:41 +0100 |
commit | 5c4e2ad490014113ad32c33e00e2aab01d7a3205 (patch) | |
tree | 0260f3f9d56d9579e0f97abfd0175fa349b9940f | |
parent | bdee0e204eed057270f787afc9aa1702147b37d9 (diff) | |
download | nextcloud-server-5c4e2ad490014113ad32c33e00e2aab01d7a3205.tar.gz nextcloud-server-5c4e2ad490014113ad32c33e00e2aab01d7a3205.zip |
allow admin to change retention obligation for the trash bin, default value is 180 days
-rw-r--r-- | apps/files_trashbin/lib/trash.php | 7 | ||||
-rw-r--r-- | config/config.sample.php | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 9b891e773bf..0dad0590227 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -24,8 +24,7 @@ namespace OCA_Trash; class Trashbin { - const DELETEAFTER=30; // how long do we keep files in the trash bin (number of days) - + const DEFAULT_RETENTION_OBLIGATION=180; // how long do we keep files in the trash bin if no other value is defined in the config file (unit: days) /** * move file to the trash bin * @@ -148,7 +147,9 @@ class Trashbin { $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?');
$result = $query->execute(array($user))->fetchAll(); - $limit = time() - (self::DELETEAFTER * 86400); + $retention_obligation = \OC_Config::getValue('trashbin_retention_obligation', self::DEFAULT_RETENTION_OBLIGATION); + + $limit = time() - ($retention_obligation * 86400); foreach ( $result as $r ) { $timestamp = $r['timestamp']; diff --git a/config/config.sample.php b/config/config.sample.php index b1655d02830..373466c08dc 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -92,6 +92,9 @@ $CONFIG = array( /* Password to use for sendmail mail, depends on mail_smtpauth if this is used */ "mail_smtppassword" => "", +/* how long should ownCloud keep delteted files in the trash bin, default value: 180 days */ +'trashbin_retention_obligation' => 180, + /* Check 3rdparty apps for malicious code fragments */ "appcodechecker" => "", |