aboutsummaryrefslogtreecommitdiff
path: root/databases
diff options
context:
space:
mode:
authorAlberto Villa <avilla@FreeBSD.org>2012-07-18 22:56:35 +0000
committerAlberto Villa <avilla@FreeBSD.org>2012-07-18 22:56:35 +0000
commit2419ec8a67af0d698004362b61add3e26ad4b97c (patch)
tree7ee4907627ef9e541ade712ce1024efede70fcba /databases
parent0292b4324017bad4910178a45c5c3320ae43756c (diff)
downloadports-2419ec8a67af0d698004362b61add3e26ad4b97c.tar.gz
ports-2419ec8a67af0d698004362b61add3e26ad4b97c.zip
Notes
Diffstat (limited to 'databases')
-rw-r--r--databases/akonadi-google/Makefile2
-rw-r--r--databases/akonadi-google/files/patch-git_a5ab37f40
2 files changed, 41 insertions, 1 deletions
diff --git a/databases/akonadi-google/Makefile b/databases/akonadi-google/Makefile
index 27a39550a600..35d19c678297 100644
--- a/databases/akonadi-google/Makefile
+++ b/databases/akonadi-google/Makefile
@@ -7,7 +7,7 @@
PORTNAME= akonadi-google
PORTVERSION= 0.3.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= databases kde
MASTER_SITES= http://www.progdan.cz/wp-content/uploads/
DISTNAME= ${PORTNAME}-${PORTVERSION}
diff --git a/databases/akonadi-google/files/patch-git_a5ab37f b/databases/akonadi-google/files/patch-git_a5ab37f
new file mode 100644
index 000000000000..8f2dfb6ddd54
--- /dev/null
+++ b/databases/akonadi-google/files/patch-git_a5ab37f
@@ -0,0 +1,40 @@
+commit a5ab37f15f39217cf631f8d61b2ea21305b81490
+Author: Dan Vrátil <dan@progdan.cz>
+Date: Wed Jun 6 00:36:46 2012 +0200
+
+ Parse OAuth code from page title instead of body
+
+ The OAuth code used for obtaining access tokens is provided
+ in webpage <title> as a string. The title is guaranteed not to change
+ syntax, while the body of the page, from which we were parsing the token
+ before, can change anytime, which breaks the authentication process.
+
+ BUG: 301240
+ FIXED-IN: 0.4.1
+
+diff --git a/libkgapi/ui/authwidget_p.cpp b/libkgapi/ui/authwidget_p.cpp
+index 57d914c..55e77cb 100644
+--- ./libkgoogle/authdialog.cpp
++++ ./libkgoogle/authdialog.cpp
+@@ -147,13 +147,18 @@ void AuthWidgetPrivate::webviewFinished()
+ }
+
+ if (url.host() == "accounts.google.com" && url.path() == "/o/oauth2/approval") {
+- QWebElement el = m_webiew->page()->mainFrame()->findFirstElement("textarea");
+- if (el.isNull()) {
++ QString title = m_webiew->title();
++ QString token;
++
++ if (title.startsWith(QLatin1String("success"), Qt::CaseInsensitive)) {
++ int pos = title.indexOf(QLatin1String("code="));
++ /* Skip the 'code=' string as well */
++ token = title.mid (pos + 5);
++ } else {
+ emitError(KGoogle::AuthError, i18n("Parsing token page failed."));
+ return;
+ }
+
+- QString token = el.toInnerXml();
+ if (token.isEmpty()) {
+ emitError(KGoogle::AuthError, i18n("Failed to obtain token."));
+ return;