Merge lp:~whosdaz/ubuntu-qa-website/fix1194770 into lp:ubuntu-qa-website

Proposed by Matthew Allen on 2016-01-09
Status: Merged
Merged at revision: 416
Proposed branch: lp:~whosdaz/ubuntu-qa-website/fix1194770
Merge into: lp:ubuntu-qa-website
Diff against target: 33 lines (+25/-0)
1 file modified
modules/qawebsite/qawebsite.module (+25/-0)
To merge this branch: bzr merge lp:~whosdaz/ubuntu-qa-website/fix1194770
Reviewer Review Type Date Requested Status
Nicholas Skaggs 2016-01-09 Approve on 2016-01-12
Review via email: mp+282091@code.launchpad.net

Description of the Change

I've set up redirects so if the path is '/user' it redirects to https://login.ubuntu.com/ (is that what SSO was referring to?).

Just be aware the implementation isn't perfect but it was the best I could do with redirects on the server side.

Furthermore, be aware that from what I can determine the link itself cannot be and changed as it is a limitation of drupal (as the User module is mandatory)

To post a comment you must log in.
Nicholas Skaggs (nskaggs) wrote :

Nice; provided this works out a-ok with SSO, this is a great workaround.

Nicholas Skaggs (nskaggs) wrote :

Can you redirect user/*?

For instance, http://localhost/?q=user/login still shows me the page, so does http://localhost/?q=user/register, http://localhost/?q=user/password, etc.

review: Needs Fixing
416. By Matthew Allen on 2016-01-12

Added redirects for missing urls

Matthew Allen (whosdaz) wrote :

Committing a fix as we speak, if there are further issues - message me here or by email. Won't be on IRC until tomorrow.

Nicholas Skaggs (nskaggs) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/qawebsite/qawebsite.module'
2--- modules/qawebsite/qawebsite.module 2016-01-05 17:23:40 +0000
3+++ modules/qawebsite/qawebsite.module 2016-01-12 16:08:48 +0000
4@@ -16,4 +16,29 @@
5 along with this program; if not, write to the Free Software
6 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
7 */
8+
9+
10+//Work around to fix lp:1194770
11+
12+$path = drupal_get_path_alias($_GET['q']);
13+echo $path;
14+
15+
16+if($path == 'user' || $path == 'user/login' || $path == 'user/register' || $path == 'user/password'){
17+ $redirect = array(
18+ '#tag' => 'meta', // The #tag is the html tag - <link />
19+ '#attributes' => array( // Set up an array of attributes inside the tag
20+ 'http-equiv' => 'refresh',
21+ 'content' => '0; url=https://login.ubuntu.com/',
22+ ),
23+ );
24+
25+ // Please note: this fix is purely a work around as a meta refresh is not reccomended by the W3C, so redirects should
26+ // implemented on the server side however this work around provides the functionality neccesary.
27+
28+ drupal_add_html_head($redirect, 'redirect');
29+}
30+
31+//
32+
33 ?>

Subscribers

People subscribed via source and target branches