-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust settings for mail link password #31975
Adjust settings for mail link password #31975
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 <vincent@nextcloud.com>
9da4e23
to
82f1344
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good, only no milestone set
$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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$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); |
} | ||
$now = new \DateTime(); | ||
$expirationInterval = $this->config->getSystemValue('sharing.mail_link_password_expiration_interval', 3600); | ||
$expirationTime = $now->add(new \DateInterval('PT' . $expirationInterval . 'S')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
failure unrelated, merging |
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