Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
b694f996
Commit
b694f996
authored
12 years ago
by
Björn Schießle
Browse files
Options
Downloads
Patches
Plain Diff
allow admin to change retention obligation for the trash bin, default value is 180 days
parent
16d7716d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/files_trashbin/lib/trash.php
+4
-3
4 additions, 3 deletions
apps/files_trashbin/lib/trash.php
config/config.sample.php
+3
-0
3 additions, 0 deletions
config/config.sample.php
with
7 additions
and
3 deletions
apps/files_trashbin/lib/trash.php
+
4
−
3
View file @
b694f996
...
...
@@ -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'
];
...
...
This diff is collapsed.
Click to expand it.
config/config.sample.php
+
3
−
0
View file @
b694f996
...
...
@@ -86,6 +86,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"
=>
""
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment