From 8d5bb0b7d801a9fe8a237da3d4ad231c602f9746 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 5 Jan 2011 16:18:18 -0500 Subject: [PATCH] push/pop destination_url instead of passing it through the chain --- webcit/static/authmethods.js | 12 +++++----- webcit/static/t/get_logged_in.html | 2 +- webcit/webcit.c | 35 ++++++++++++++++++++++++++++++ webcit/webcit.h | 2 +- webcit/webserver.c | 28 ++++++++++++++++-------- 5 files changed, 63 insertions(+), 16 deletions(-) diff --git a/webcit/static/authmethods.js b/webcit/static/authmethods.js index 1fc45a03c..67018a7c2 100644 --- a/webcit/static/authmethods.js +++ b/webcit/static/authmethods.js @@ -31,14 +31,16 @@ function GetLoggedInFirst(destination_url) { return; } + p = 'push?url=' + destination_url; + new Ajax.Request(p, { method: 'get' } ); + /* If not logged in, go modal and ask the user to log in first. */ - p = 'do_template?template=get_logged_in?destination_url=' + destination_url; new Ajax.Updater( 'md-content', - p, + 'do_template?template=get_logged_in', { method: 'get', - onSuccess: function(cl_success) { + onSuccess: function() { toggleModal(1); } } @@ -49,13 +51,13 @@ function GetLoggedInFirst(destination_url) { /* * Attempt login with username/password, called from modal dialog */ -function ajax_try_username_and_password(destination_url) { +function ajax_try_username_and_password() { $('login_errmsg').innerHTML = ""; $('ajax_username_password_form').request({ onSuccess: function(ctdlresult) { if (ctdlresult.responseText.substr(0,1) == '2') { - window.location = decodeURIComponent(destination_url); + window.location = 'pop'; } else { $('login_errmsg').innerHTML = ctdlresult.responseText.substr(4) ; diff --git a/webcit/static/t/get_logged_in.html b/webcit/static/t/get_logged_in.html index 0b24ef3be..de071c3f1 100644 --- a/webcit/static/t/get_logged_in.html +++ b/webcit/static/t/get_logged_in.html @@ -45,7 +45,7 @@ FIXME login to continue

-
');">
+