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
=== modified file 'launchpad_login.php'
--- launchpad_login.php 2010-03-02 15:34:37 +0000
+++ launchpad_login.php 2010-04-26 15:04:27 +0000
@@ -89,13 +89,19 @@
89 echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";89 echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
90 }90 }
91}91}
92
93if (strpos(openid_launchpad_get_server(), 'ubuntu') === false) {
94 $login_button = __('Login with Launchpad');
95} else {
96 $login_button = __('Login with Ubuntu Single Sign On');
97}
92?>98?>
93<form name="loginform" id="loginform"99<form name="loginform" id="loginform"
94 action="<?php echo site_url('wp-login.php', 'login_post') ?>"100 action="<?php echo site_url('wp-login.php', 'login_post') ?>"
95 method="post">101 method="post">
96 <div class="submit">102 <div class="submit">
97 <input type="submit" name="launchpad" value="<?php echo103 <input type="submit" name="launchpad" value="<?php echo
98 __('Login with Launchpad', 'openid'); ?>" id="lplogin" />104 $login_button; ?>" id="lplogin" />
99 <input type="hidden" name="redirect_to"105 <input type="hidden" name="redirect_to"
100 value="<?php echo attribute_escape($redirect_to); ?>" />106 value="<?php echo attribute_escape($redirect_to); ?>" />
101 <input type="hidden" name="testcookie" value="1" />107 <input type="hidden" name="testcookie" value="1" />
102108
=== modified file 'openid-launchpad.php'
--- openid-launchpad.php 2010-03-02 15:34:37 +0000
+++ openid-launchpad.php 2010-04-26 15:04:27 +0000
@@ -31,6 +31,10 @@
31define('LAUNCHPAD_TESTING_OP', LAUNCHPAD_TESTING_URL.'+openid');31define('LAUNCHPAD_TESTING_OP', LAUNCHPAD_TESTING_URL.'+openid');
32define('LAUNCHPAD_STAGING_URL', 'https://login.staging.launchpad.net/');32define('LAUNCHPAD_STAGING_URL', 'https://login.staging.launchpad.net/');
33define('LAUNCHPAD_STAGING_OP', LAUNCHPAD_STAGING_URL.'+openid');33define('LAUNCHPAD_STAGING_OP', LAUNCHPAD_STAGING_URL.'+openid');
34define('LAUNCHPAD_SSO_PRODUCTION_URL', 'https://login.ubuntu.com/');
35define('LAUNCHPAD_SSO_PRODUCTION_OP', LAUNCHPAD_SSO_PRODUCTION_URL.'+openid');
36define('LAUNCHPAD_SSO_STAGING_URL', 'https://login.staging.ubuntu.com/');
37define('LAUNCHPAD_SSO_STAGING_OP', LAUNCHPAD_SSO_STAGING_URL.'+openid');
3438
35define('LAUNCHPAD_USERPAGE_FORMAT', 'https://launchpad.net/~%s');39define('LAUNCHPAD_USERPAGE_FORMAT', 'https://launchpad.net/~%s');
3640
@@ -78,9 +82,11 @@
78 <td>82 <td>
79 <p><select name="launchpad_server"><?php83 <p><select name="launchpad_server"><?php
80 $options = array(84 $options = array(
81 'PRODUCTION' => __('Production', 'openid-launchpad'),85 'PRODUCTION' => __('Production', 'openid-launchpad'),
82 'TESTING' => __('Testing', 'openid-launchpad'),86 'TESTING' => __('Testing', 'openid-launchpad'),
83 'STAGING' => __('Staging', 'openid-launchpad'),87 'STAGING' => __('Staging', 'openid-launchpad'),
88 'SSO_PRODUCTION' => __('Ubuntu SSO production', 'openid-launchpad'),
89 'SSO_STAGING' => __('Ubuntu SSO staging', 'openid-launchpad'),
84 );90 );
85 foreach ($options as $key => $label) {91 foreach ($options as $key => $label) {
86 $selected = openid_launchpad_get_server();92 $selected = openid_launchpad_get_server();
@@ -280,7 +286,7 @@
280 */286 */
281function is_current_launchpad_endpoint($endpoint) {287function is_current_launchpad_endpoint($endpoint) {
282 $current = openid_launchpad_get_server();288 $current = openid_launchpad_get_server();
283 foreach (array('PRODUCTION', 'TESTING', 'STAGING') as $server) {289 foreach (array('PRODUCTION', 'TESTING', 'STAGING', 'SSO_PRODUCTION', 'SSO_STAGING') as $server) {
284 if (constant("LAUNCHPAD_{$server}_URL") == $current) {290 if (constant("LAUNCHPAD_{$server}_URL") == $current) {
285 return constant("LAUNCHPAD_{$server}_OP") == $endpoint;291 return constant("LAUNCHPAD_{$server}_OP") == $endpoint;
286 }292 }

Subscribers

People subscribed via source and target branches