From 42f7795d5f249a1339fb5220d124659dc1edd658 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 13 May 2024 10:08:36 +0200 Subject: [PATCH 1/3] allow to set expiration date in the past --- views/bootstrap/class.SetExpires.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.SetExpires.php b/views/bootstrap/class.SetExpires.php index 08359a68b..53dcb2f51 100644 --- a/views/bootstrap/class.SetExpires.php +++ b/views/bootstrap/class.SetExpires.php @@ -72,6 +72,7 @@ $(document).ready( function() { $options = array(); $options[] = array('never', getMLText('does_not_expire')); $options[] = array('date', getMLText('expire_by_date'), $expdate != ''); + $options[] = array('today', getMLText('expire_today').' ('.date($df, getTsByPeriod('today', 's')).')'); $options[] = array('tomorrow', getMLText('expire_tomorrow').' ('.date($df, getTsByPeriod('tomorrow', 's')).')'); $options[] = array('1w', getMLText('expire_in_1w').' ('.date($df, getTsByPeriod('1w', 's')).')'); $options[] = array('1m', getMLText('expire_in_1m').' ('.date($df, getTsByPeriod('1m', 's')).')'); @@ -92,7 +93,7 @@ $(document).ready( function() { ); $this->formField( getMLText("expires"), - $this->getDateChooser($expdate, "expdate", $this->params['session']->getLanguage(), '', '+1d') + $this->getDateChooser($expdate, "expdate", $this->params['session']->getLanguage(), '', '') // set last parameter to '+1d' if dates in the past are not allowed ); $this->contentContainerEnd(); $this->formSubmit(" ".getMLText('save')); From 3d605272c8b64f60ae017bafdbb851518879b8ba Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 13 May 2024 10:09:19 +0200 Subject: [PATCH 2/3] check access on RemoveDocumentFile and EditDocumentFile --- views/bootstrap/class.ViewDocument.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 4c4cefb31..8c970d388 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -371,8 +371,10 @@ $(document).ready( function() { $this->showActions($items); $items = []; if (($document->getAccessMode($user) == M_ALL)||($file->getUserID()==$user->getID())) { - $items[] = array('link'=>$this->html_url('RemoveDocumentFile', array('documentid'=>$document->getID(), 'fileid'=>$file->getID())), 'icon'=>'remove', 'label'=>'delete'); - $items[] = array('link'=>$this->html_url('EditDocumentFile', array('documentid'=>$document->getID(), 'fileid'=>$file->getID())), 'icon'=>'edit', 'label'=>'edit'); + if($accessobject->check_view_access('RemoveDocumentFile')) + $items[] = array('link'=>$this->html_url('RemoveDocumentFile', array('documentid'=>$document->getID(), 'fileid'=>$file->getID())), 'icon'=>'remove', 'label'=>'delete'); + if($accessobject->check_view_access('EditDocumentFile')) + $items[] = array('link'=>$this->html_url('EditDocumentFile', array('documentid'=>$document->getID(), 'fileid'=>$file->getID())), 'icon'=>'edit', 'label'=>'edit'); } $this->showActions($items); print ""; From 226b839baa2be4a08c127d3368b18487b5f32181 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 13 May 2024 10:09:56 +0200 Subject: [PATCH 3/3] add changes for 5.1.35 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index b9acf88b2..b036a3201 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ -------------------------------------------------------------------------------- Changes in version 5.1.35 -------------------------------------------------------------------------------- +- check access rights on EditDocumentFile and RemoveDocumentFile +- allow to set expiration dates in the past again -------------------------------------------------------------------------------- Changes in version 5.1.34