diff options
author | Daniel Molkentin <danimo@owncloud.com> | 2014-06-27 17:34:20 +0400 |
---|---|---|
committer | Daniel Molkentin <danimo@owncloud.com> | 2014-06-27 17:34:20 +0400 |
commit | f8b097669aa5bf651b3a2749190d958a9a79a07f (patch) | |
tree | 60ef60fb3bdbbaeee1e2104e01297a08910c0776 /src/creds | |
parent | e7d597045b69ec9d2cd99338f6bf74e5d4e476aa (diff) | |
parent | 40d765c73aa64de2fcf8503886f27c8da7b7d3d9 (diff) |
Merge remote-tracking branch 'origin/1.6'
Conflicts:
VERSION.cmake
doc/building.rst
Diffstat (limited to 'src/creds')
-rw-r--r-- | src/creds/shibboleth/shibbolethuserjob.h | 4 | ||||
-rw-r--r-- | src/creds/shibbolethcredentials.cpp | 17 | ||||
-rw-r--r-- | src/creds/shibbolethcredentials.h | 3 |
3 files changed, 21 insertions, 3 deletions
diff --git a/src/creds/shibboleth/shibbolethuserjob.h b/src/creds/shibboleth/shibbolethuserjob.h index f6427a45b..8042fe939 100644 --- a/src/creds/shibboleth/shibbolethuserjob.h +++ b/src/creds/shibboleth/shibbolethuserjob.h @@ -26,15 +26,13 @@ class ShibbolethUserJob : public AbstractNetworkJob { Q_OBJECT public: explicit ShibbolethUserJob(Account *account, QObject* parent = 0); +public slots: void start(); signals: // is always emitted when the job is finished. user is empty in case of error. void userFetched(const QString &user); - // Another job need to be created - void tryAgain(); - private slots: virtual bool finished(); }; diff --git a/src/creds/shibbolethcredentials.cpp b/src/creds/shibbolethcredentials.cpp index bf8fea4fe..5b83f701f 100644 --- a/src/creds/shibbolethcredentials.cpp +++ b/src/creds/shibbolethcredentials.cpp @@ -94,6 +94,23 @@ ShibbolethCredentials::ShibbolethCredentials() _browser(0) {} +ShibbolethCredentials::ShibbolethCredentials(const QNetworkCookie& cookie, Account* account) + : _ready(true), + _stillValid(true), + _fetchJobInProgress(false), + _browser(0), + _shibCookie(cookie) +{ + if (account) { + /* The _user has not yet been fetched, so fetch it now */ + ShibbolethUserJob *job = new ShibbolethUserJob(account, this); + connect(job, SIGNAL(userFetched(QString)), this, SLOT(slotUserFetched(QString))); + QTimer::singleShot(1234, job, SLOT(start())); + + } +} + + void ShibbolethCredentials::syncContextPreInit(CSYNC* ctx) { csync_set_auth_callback (ctx, handleNeonSSLProblems); diff --git a/src/creds/shibbolethcredentials.h b/src/creds/shibbolethcredentials.h index 85efe51ad..cb778f219 100644 --- a/src/creds/shibbolethcredentials.h +++ b/src/creds/shibbolethcredentials.h @@ -40,6 +40,9 @@ Q_OBJECT public: ShibbolethCredentials(); + /* create a credidentials for an already connected account */ + ShibbolethCredentials(const QNetworkCookie &cookie, Account *acc); + void syncContextPreInit(CSYNC* ctx); void syncContextPreStart(CSYNC* ctx); bool changed(AbstractCredentials* credentials) const; |