void OwncloudShibbolethCredsPage::disposeBrowser() { if (_browser) { disconnect(_browser, SIGNAL(otherCookiesReceived(QList<QNetworkCookie>, QUrl)), this, SLOT(slotOtherCookiesReceived(QList<QNetworkCookie>, QUrl))); disconnect(_browser, SIGNAL(viewHidden()), this, SLOT(slotViewHidden())); disconnect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)), this, SLOT(slotShibbolethCookieReceived(QNetworkCookie))); _browser->hide(); _browser->deleteLater(); _browser = 0; } }
void OwncloudShibbolethCredsPage::setupBrowser() { if (_browser) { return; } OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard*>(wizard()); _browser = new ShibbolethWebView(ocWizard->account()); connect(_browser, SIGNAL(shibbolethCookieReceived(QNetworkCookie)), this, SLOT(slotShibbolethCookieReceived(QNetworkCookie))); connect(_browser, SIGNAL(viewHidden()), this, SLOT(slotViewHidden())); connect(_browser, SIGNAL(otherCookiesReceived(QList<QNetworkCookie>, QUrl)), this, SLOT(slotOtherCookiesReceived(QList<QNetworkCookie>, QUrl))); _browser->show(); _browser->setFocus(); }
void ShibbolethWebView::onNewCookiesForUrl (const QList<QNetworkCookie>& cookieList, const QUrl& url) { QList<QNetworkCookie> otherCookies; QNetworkCookie shibCookie; Q_FOREACH (const QNetworkCookie& cookie, cookieList) { if (cookie.name().startsWith ("_shibsession_")) { if (shibCookie.name().isEmpty()) { shibCookie = cookie; } else { qWarning() << "Too many Shibboleth session cookies at once!"; } } else { otherCookies << cookie; } } if (!otherCookies.isEmpty()) { Q_EMIT otherCookiesReceived(otherCookies, url); } if (!shibCookie.name().isEmpty()) { Q_EMIT shibbolethCookieReceived(shibCookie, _account); } }