diff options
author | Christian Kamm <mail@ckamm.de> | 2019-04-17 10:23:28 +0300 |
---|---|---|
committer | Christian Kamm <mail@ckamm.de> | 2019-04-23 10:22:21 +0300 |
commit | 8848aba0745d997dcd3b3557c119ba513ccae8f3 (patch) | |
tree | 314e0d3b54bf9b1014e9d9e8bef12691519779bb /src/gui/sharemanager.cpp | |
parent | 96831247e24118018b4ccfca70253cd47996e3e4 (diff) |
Link shares: Adjust creation flow
The important thing is that, similar to the web link share creation
flow, the share properties can be set before creation is done. This
allows better handling of error conditions. One such condition is the
password policy app restricting valid expire dates.
See owncloud/enterprise#3271
Diffstat (limited to 'src/gui/sharemanager.cpp')
-rw-r--r-- | src/gui/sharemanager.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/sharemanager.cpp b/src/gui/sharemanager.cpp index a1be4ce30..a4013dd2b 100644 --- a/src/gui/sharemanager.cpp +++ b/src/gui/sharemanager.cpp @@ -252,12 +252,14 @@ ShareManager::ShareManager(AccountPtr account, QObject *parent) void ShareManager::createLinkShare(const QString &path, const QString &name, - const QString &password) + const QString &password, + const QDate &expireDate, + const Share::Permissions permissions) { OcsShareJob *job = new OcsShareJob(_account); connect(job, &OcsShareJob::shareJobFinished, this, &ShareManager::slotLinkShareCreated); connect(job, &OcsJob::ocsError, this, &ShareManager::slotOcsError); - job->createLinkShare(path, name, password); + job->createLinkShare(path, name, password, expireDate, permissions); } void ShareManager::slotLinkShareCreated(const QJsonDocument &reply) @@ -265,12 +267,10 @@ void ShareManager::slotLinkShareCreated(const QJsonDocument &reply) QString message; int code = OcsShareJob::getJsonReturnCode(reply, message); - /* - * Before we had decent sharing capabilities on the server a 403 "generally" - * meant that a share was password protected - */ + // A 403 generally means some of the settings for the share are not allowed. + // Maybe a password is required, or the expire date isn't acceptable. if (code == 403) { - emit linkShareRequiresPassword(message); + emit linkShareCreationForbidden(message); return; } |