[Pkg-owncloud-commits] [owncloud-client] 292/498: Use capabilities to not allow removing of expiredate and password

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:59 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 c052f6d4c96da37d4744837f3b79157c5d6f03f8
Author: Roeland Jago Douma <r.j.douma at uva.nl>
Date:   Fri Jul 10 15:46:17 2015 +0200

    Use capabilities to not allow removing of expiredate and password
    
    If the server admin has enforced the expiration date and the password our UI
    should not give the user the option to remove those.
---
 src/gui/sharedialog.cpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index d33530e..c19319a 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -138,6 +138,22 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt
     _ui->errorLabel->setFrameShape(QFrame::Box);
     _ui->errorLabel->setContentsMargins(QMargins(12,12,12,12));
     _ui->errorLabel->hide();
+
+
+    // Parse capabilities
+
+    // If password is enforced make don't allow users to disable it
+    if (_account->capabilities()["files_sharing"].toMap()["public"].toMap()["password"].toMap()["enforced"].toBool()) {
+        _ui->checkBox_password->setEnabled(false);
+    }
+
+    // If expiredate is enforced do not allow disable and set max days
+    if (_account->capabilities()["files_sharing"].toMap()["public"].toMap()["expire_date"].toMap()["enforced"].toBool()) {
+        _ui->checkBox_expire->setEnabled(false);
+        _ui->calendar->setMaximumDate(QDate::currentDate().addDays(
+            _account->capabilities()["files_sharing"].toMap()["public"].toMap()["expire_date"].toMap()["days"].toInt()
+            ));
+    }
 }
 
 void ShareDialog::done( int r ) {

-- 
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