From owner-svn-ports-head@FreeBSD.ORG Wed Jul 18 22:56:36 2012 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60F4A106566C; Wed, 18 Jul 2012 22:56:36 +0000 (UTC) (envelope-from avilla@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 317658FC19; Wed, 18 Jul 2012 22:56:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6IMuaDR019443; Wed, 18 Jul 2012 22:56:36 GMT (envelope-from avilla@svn.freebsd.org) Received: (from avilla@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6IMuZiO019440; Wed, 18 Jul 2012 22:56:35 GMT (envelope-from avilla@svn.freebsd.org) Message-Id: <201207182256.q6IMuZiO019440@svn.freebsd.org> From: Alberto Villa Date: Wed, 18 Jul 2012 22:56:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r301131 - in head/databases/akonadi-google: . files X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 22:56:36 -0000 Author: avilla Date: Wed Jul 18 22:56:35 2012 New Revision: 301131 URL: http://svn.freebsd.org/changeset/ports/301131 Log: - Backport fix to an authentication bug which makes it impossible to authenticate to Google services. - Bump PORTREVISION. Submitted by: Mina R Waheeb via mailing list Added: head/databases/akonadi-google/files/ head/databases/akonadi-google/files/patch-git_a5ab37f (contents, props changed) Modified: head/databases/akonadi-google/Makefile (contents, props changed) Modified: head/databases/akonadi-google/Makefile ============================================================================== --- head/databases/akonadi-google/Makefile Wed Jul 18 21:39:17 2012 (r301130) +++ head/databases/akonadi-google/Makefile Wed Jul 18 22:56:35 2012 (r301131) @@ -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} Added: head/databases/akonadi-google/files/patch-git_a5ab37f ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/akonadi-google/files/patch-git_a5ab37f Wed Jul 18 22:56:35 2012 (r301131) @@ -0,0 +1,40 @@ +commit a5ab37f15f39217cf631f8d61b2ea21305b81490 +Author: Dan Vrátil +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 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;