Merge lp:~canonical-isd-hackers/wordpress-launchpad-integration/ubuntu-sso into lp:wordpress-launchpad-integration

Proposed by Szilveszter Farkas
Status: Merged
Approved by: Stuart Metcalfe
Approved revision: 21
Merged at revision: 19
Proposed branch: lp:~canonical-isd-hackers/wordpress-launchpad-integration/ubuntu-sso
Merge into: lp:wordpress-launchpad-integration
Diff against target: 63 lines (+17/-5)
2 files modified
launchpad_login.php (+7/-1)
openid-launchpad.php (+10/-4)
To merge this branch: bzr merge lp:~canonical-isd-hackers/wordpress-launchpad-integration/ubuntu-sso
Reviewer Review Type Date Requested Status
Stuart Metcalfe (community) Approve
Review via email: mp+24127@code.launchpad.net

Description of the change

This branch adds the Ubuntu SSO service as an option to use for authentication.

To post a comment you must log in.
21. By Szilveszter Farkas

Fix spelling of the Ubuntu SSO service.

Revision history for this message
Stuart Metcalfe (stuartmetcalfe) wrote :

We discussed removing the hyphen from "Sign-On". Also, changing the constant name from LAUNCHPAD_SSO to UBUNTU_SSO but this will require more significant changes so we should hold off on this until we have better test coverage and more time. I notice the first change has already been done, and there's current no unit-test suite to build on, so this merge is approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launchpad_login.php'
2--- launchpad_login.php 2010-03-02 15:34:37 +0000
3+++ launchpad_login.php 2010-04-26 15:04:27 +0000
4@@ -89,13 +89,19 @@
5 echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
6 }
7 }
8+
9+if (strpos(openid_launchpad_get_server(), 'ubuntu') === false) {
10+ $login_button = __('Login with Launchpad');
11+} else {
12+ $login_button = __('Login with Ubuntu Single Sign On');
13+}
14 ?>
15 <form name="loginform" id="loginform"
16 action="<?php echo site_url('wp-login.php', 'login_post') ?>"
17 method="post">
18 <div class="submit">
19 <input type="submit" name="launchpad" value="<?php echo
20- __('Login with Launchpad', 'openid'); ?>" id="lplogin" />
21+ $login_button; ?>" id="lplogin" />
22 <input type="hidden" name="redirect_to"
23 value="<?php echo attribute_escape($redirect_to); ?>" />
24 <input type="hidden" name="testcookie" value="1" />
25
26=== modified file 'openid-launchpad.php'
27--- openid-launchpad.php 2010-03-02 15:34:37 +0000
28+++ openid-launchpad.php 2010-04-26 15:04:27 +0000
29@@ -31,6 +31,10 @@
30 define('LAUNCHPAD_TESTING_OP', LAUNCHPAD_TESTING_URL.'+openid');
31 define('LAUNCHPAD_STAGING_URL', 'https://login.staging.launchpad.net/');
32 define('LAUNCHPAD_STAGING_OP', LAUNCHPAD_STAGING_URL.'+openid');
33+define('LAUNCHPAD_SSO_PRODUCTION_URL', 'https://login.ubuntu.com/');
34+define('LAUNCHPAD_SSO_PRODUCTION_OP', LAUNCHPAD_SSO_PRODUCTION_URL.'+openid');
35+define('LAUNCHPAD_SSO_STAGING_URL', 'https://login.staging.ubuntu.com/');
36+define('LAUNCHPAD_SSO_STAGING_OP', LAUNCHPAD_SSO_STAGING_URL.'+openid');
37
38 define('LAUNCHPAD_USERPAGE_FORMAT', 'https://launchpad.net/~%s');
39
40@@ -78,9 +82,11 @@
41 <td>
42 <p><select name="launchpad_server"><?php
43 $options = array(
44- 'PRODUCTION' => __('Production', 'openid-launchpad'),
45- 'TESTING' => __('Testing', 'openid-launchpad'),
46- 'STAGING' => __('Staging', 'openid-launchpad'),
47+ 'PRODUCTION' => __('Production', 'openid-launchpad'),
48+ 'TESTING' => __('Testing', 'openid-launchpad'),
49+ 'STAGING' => __('Staging', 'openid-launchpad'),
50+ 'SSO_PRODUCTION' => __('Ubuntu SSO production', 'openid-launchpad'),
51+ 'SSO_STAGING' => __('Ubuntu SSO staging', 'openid-launchpad'),
52 );
53 foreach ($options as $key => $label) {
54 $selected = openid_launchpad_get_server();
55@@ -280,7 +286,7 @@
56 */
57 function is_current_launchpad_endpoint($endpoint) {
58 $current = openid_launchpad_get_server();
59- foreach (array('PRODUCTION', 'TESTING', 'STAGING') as $server) {
60+ foreach (array('PRODUCTION', 'TESTING', 'STAGING', 'SSO_PRODUCTION', 'SSO_STAGING') as $server) {
61 if (constant("LAUNCHPAD_{$server}_URL") == $current) {
62 return constant("LAUNCHPAD_{$server}_OP") == $endpoint;
63 }

Subscribers

People subscribed via source and target branches