Adjust settings for mail link password#31975
Merged
Conversation
Rename the settings and invert the meaning. Increase default interval to one hour. Changed the interval to be a number of seconds, to align with other setting styles. Signed-off-by: Vincent Petry <[email protected]>
9da4e23 to
82f1344
Compare
blizzz
approved these changes
Apr 14, 2022
come-nc
reviewed
Apr 14, 2022
Comment on lines
+1185
to
+1188
| $now = new \DateTime(); | ||
| $expirationInterval = $this->config->getSystemValue('sharing.mail_link_password_expiration_interval', 3600); | ||
| $expirationTime = $now->add(new \DateInterval('PT' . $expirationInterval . 'S')); | ||
| $share->setPasswordExpirationTime($expirationTime); |
Contributor
There was a problem hiding this comment.
Suggested change
| $now = new \DateTime(); | |
| $expirationInterval = $this->config->getSystemValue('sharing.mail_link_password_expiration_interval', 3600); | |
| $expirationTime = $now->add(new \DateInterval('PT' . $expirationInterval . 'S')); | |
| $share->setPasswordExpirationTime($expirationTime); | |
| $expirationTime = new \DateTime(); | |
| $expirationInterval = $this->config->getSystemValue('sharing.mail_link_password_expiration_interval', 3600); | |
| $expirationTime->add(new \DateInterval('PT' . $expirationInterval . 'S')); | |
| $share->setPasswordExpirationTime($expirationTime); |
CarlSchwan
reviewed
Apr 14, 2022
| } | ||
| $now = new \DateTime(); | ||
| $expirationInterval = $this->config->getSystemValue('sharing.mail_link_password_expiration_interval', 3600); | ||
| $expirationTime = $now->add(new \DateInterval('PT' . $expirationInterval . 'S')); |
Member
There was a problem hiding this comment.
A try catch with a error log would make sense in case the admin did a mistake when configuration the interval (e,g, put a broken value or negative number)
Member
Author
There was a problem hiding this comment.
I just removed the try catch because I didn't think such easy mistake could be done
the try-catch before was because of the complex interval string where a mistake is much more likely
CarlSchwan
approved these changes
Apr 14, 2022
Member
Author
|
failure unrelated, merging |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rename the settings and invert the meaning.
Increase default interval to one hour.
Changed the interval to be a number of seconds, to align with other
setting styles.
as discussed with @jancborchardt