Skip to content
Snippets Groups Projects
Commit 5c4e2ad4 authored by Björn Schießle's avatar Björn Schießle
Browse files

allow admin to change retention obligation for the trash bin, default value is 180 days

parent bdee0e20
Branches
No related tags found
No related merge requests found
...@@ -24,8 +24,7 @@ namespace OCA_Trash; ...@@ -24,8 +24,7 @@ namespace OCA_Trash;
class Trashbin { 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 * move file to the trash bin
* *
...@@ -148,7 +147,9 @@ class Trashbin { ...@@ -148,7 +147,9 @@ class Trashbin {
$query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?'); $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?');
$result = $query->execute(array($user))->fetchAll(); $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 ) { foreach ( $result as $r ) {
$timestamp = $r['timestamp']; $timestamp = $r['timestamp'];
......
...@@ -92,6 +92,9 @@ $CONFIG = array( ...@@ -92,6 +92,9 @@ $CONFIG = array(
/* Password to use for sendmail mail, depends on mail_smtpauth if this is used */ /* Password to use for sendmail mail, depends on mail_smtpauth if this is used */
"mail_smtppassword" => "", "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 */ /* Check 3rdparty apps for malicious code fragments */
"appcodechecker" => "", "appcodechecker" => "",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment