From patchwork Mon May 14 00:40:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 8577 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 42DC123EAB for ; Mon, 14 May 2012 00:40:20 +0000 (UTC) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by fiordland.canonical.com (Postfix) with ESMTP id DCDE1A18458 for ; Mon, 14 May 2012 00:40:19 +0000 (UTC) Received: by obbun3 with SMTP id un3so4864957obb.11 for ; Sun, 13 May 2012 17:40:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=tNLKnB/+8/WaoEbJ4jNgKXm4GA+wf2/yq9ADUOlvQEg=; b=ECvzniS8Ejt0n3ghcQQPwshXmbOs5EH01ONOKQGaMKFsQUGqL3WTcK2FJ/Ge0RtufQ nDJhJCr55xrYR6gNkP2ij2cOzt4P8aegDBELQ4ZBveak6jj+p2yXNxyETkszl6nnezjm 9N1vtqer9TxRDfhPLu6uu/Ivkg1Te3GVK72XeVnC49mlx1vjQAfTGBWRvQMGSELO4zia H6CyQKidUnr+ycpFdj1006ONaGrF/slgfJVCvpG9Y+hFbGTSnoyj/PblLJbu5hY7jwPx /+bdpNHVhJfBBbbWUcInzvWjOFmY55u9GkKNf5I1H4m6AwiqPL+S8mbQlEIGEZHuO7YR f96Q== Received: by 10.50.154.169 with SMTP id vp9mr3117957igb.53.1336956019179; Sun, 13 May 2012 17:40:19 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.35.72 with SMTP id o8csp307898ibd; Sun, 13 May 2012 17:40:18 -0700 (PDT) Received: by 10.180.83.196 with SMTP id s4mr14943774wiy.15.1336956017459; Sun, 13 May 2012 17:40:17 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id m20si10210399wee.30.2012.05.13.17.40.17 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 May 2012 17:40:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1STjKi-0008LB-S4 for ; Mon, 14 May 2012 00:40:16 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id CA070E03E8 for ; Mon, 14 May 2012 00:40:16 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-server X-Launchpad-Branch: ~linaro-validation/lava-server/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 368 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: =?utf-8?q?=5BBranch_=7Elinaro-validation/lava-server/trunk=5D_Rev_?= =?utf-8?q?368=3A_Display_OpenID_login_forms_only_if_OpenID_auth_is_e?= =?utf-8?q?nabled_=28Jean-Fran=C3=A7ois_Fortin_Tam=29?= Message-Id: <20120514004016.3813.45032.launchpad@ackee.canonical.com> Date: Mon, 14 May 2012 00:40:16 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15225"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 3fdcb5509a12618e8c6daf3c2ec4d9586529681d X-Gm-Message-State: ALoCoQlu+r/glz6Be9dUrNLr4vWlHXeQgIJD2oI2wnTMxx5EnJ5g3gExrOReAw3xqQG7dlQ/UwMo Merge authors: Jean-François Fortin Tam (kiddo) Related merge proposals: https://code.launchpad.net/~kiddo/lava-server/optional-openid/+merge/105533 proposed by: Jean-François Fortin Tam (kiddo) review: Approve - Michael Hudson-Doyle (mwhudson) ------------------------------------------------------------ revno: 368 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Mon 2012-05-14 12:38:01 +1200 message: Display OpenID login forms only if OpenID auth is enabled (Jean-François Fortin Tam) modified: lava_server/context_processors.py lava_server/settings/common.py lava_server/templates/registration/login.html --- lp:lava-server https://code.launchpad.net/~linaro-validation/lava-server/trunk You are subscribed to branch lp:lava-server. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription === modified file 'lava_server/context_processors.py' --- lava_server/context_processors.py 2011-11-22 17:57:17 +0000 +++ lava_server/context_processors.py 2012-05-11 20:11:09 +0000 @@ -44,3 +44,7 @@ 'extension_list': loader.extensions, 'version': versiontools.format_version( lava_server.__version__, hint=lava_server)}} + +def openid_available(request): + openid_enabled = "django_openid_auth.auth.OpenIDBackend" in lava_server.settings.common.AUTHENTICATION_BACKENDS + return {"openid_available": openid_enabled} === modified file 'lava_server/settings/common.py' --- lava_server/settings/common.py 2012-05-07 03:45:39 +0000 +++ lava_server/settings/common.py 2012-05-11 20:11:09 +0000 @@ -130,6 +130,7 @@ "django.core.context_processors.request", "staticfiles.context_processors.static_url", "lava_server.context_processors.lava", + "lava_server.context_processors.openid_available", ] === modified file 'lava_server/templates/registration/login.html' --- lava_server/templates/registration/login.html 2011-03-14 14:03:42 +0000 +++ lava_server/templates/registration/login.html 2012-05-11 20:11:09 +0000 @@ -38,12 +38,15 @@
{% csrf_token %} + {% if openid_available %} + {% endif %} + {% if openid_available %} + {% endif %} + {% if openid_available %} + {% endif %}
{% trans "Use Launchpad.net account" %} {% trans "Use custom account" %}
{% blocktrans %}

Thanks to the {% endblocktrans %}

{% blocktrans %}

If you already have a local account you can sign-in with your user @@ -72,10 +76,12 @@

{% trans "Sign in with Launchpad.net" %}