[Pkg-owncloud-commits] [owncloud-client] 448/484: [Sharing] Do not allow users to uset the password if it is enforced

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:38:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 01faf102ba2b4e6177faee87a690b793fe050052
Author: Roeland Jago Douma <rullzer at owncloud.com>
Date:   Tue Dec 1 12:43:14 2015 +0100

    [Sharing] Do not allow users to uset the password if it is enforced
---
 src/gui/sharelinkwidget.cpp | 10 ++++++++--
 src/gui/sharelinkwidget.h   |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gui/sharelinkwidget.cpp b/src/gui/sharelinkwidget.cpp
index 97a6b5e..d482f60 100644
--- a/src/gui/sharelinkwidget.cpp
+++ b/src/gui/sharelinkwidget.cpp
@@ -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();
 }
 
diff --git a/src/gui/sharelinkwidget.h b/src/gui/sharelinkwidget.h
index d6950b3..3f0cd54 100644
--- a/src/gui/sharelinkwidget.h
+++ b/src/gui/sharelinkwidget.h
@@ -107,6 +107,7 @@ private:
     bool _resharingAllowed;
     bool _isFile;
     bool _autoShare;
+    bool _passwordRequired;
 };
 
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list