mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
[Sharing] Do not allow users to uset the password if it is enforced
This commit is contained in:
parent
76d1296053
commit
01faf102ba
@ -41,7 +41,8 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
|
||||
_manager(NULL),
|
||||
_share(NULL),
|
||||
_resharingAllowed(resharingAllowed),
|
||||
_autoShare(autoShare)
|
||||
_autoShare(autoShare),
|
||||
_passwordRequired(false)
|
||||
{
|
||||
_ui->setupUi(this);
|
||||
|
||||
@ -116,6 +117,7 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
|
||||
// If password is enforced then don't allow users to disable it
|
||||
if (_account->capabilities().sharePublicLinkEnforcePassword()) {
|
||||
_ui->checkBox_password->setEnabled(false);
|
||||
_passwordRequired = true;
|
||||
}
|
||||
|
||||
// If expiredate is enforced do not allow disable and set max days
|
||||
@ -234,7 +236,9 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
|
||||
_ui->widget_shareLink->show();
|
||||
_ui->checkBox_shareLink->setChecked(true);
|
||||
|
||||
_ui->checkBox_password->setEnabled(true);
|
||||
if (!_passwordRequired) {
|
||||
_ui->checkBox_password->setEnabled(true);
|
||||
}
|
||||
if (_share->isPasswordSet()) {
|
||||
_ui->lineEdit_password->setEnabled(true);
|
||||
_ui->checkBox_password->setChecked(true);
|
||||
@ -419,6 +423,8 @@ void ShareLinkWidget::slotCreateShareRequiresPassword()
|
||||
_ui->checkBox_expire->setEnabled(false);
|
||||
_ui->checkBox_editing->setEnabled(false);
|
||||
|
||||
_passwordRequired = true;
|
||||
|
||||
slotCheckBoxPasswordClicked();
|
||||
}
|
||||
|
||||
|
||||
@ -107,6 +107,7 @@ private:
|
||||
bool _resharingAllowed;
|
||||
bool _isFile;
|
||||
bool _autoShare;
|
||||
bool _passwordRequired;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user