From f7986c28fa1e262fdbcdcee41605fa80edc3915b Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 29 Dec 2010 11:00:53 -0500 Subject: [PATCH] Began implementing GetLoggedInFirst(destination_url) path --- webcit/static/t/get_logged_in.html | 10 ++++++++++ webcit/static/t/navbar.html | 2 +- webcit/static/wclib.js | 23 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 webcit/static/t/get_logged_in.html diff --git a/webcit/static/t/get_logged_in.html b/webcit/static/t/get_logged_in.html new file mode 100644 index 000000000..f9e371e47 --- /dev/null +++ b/webcit/static/t/get_logged_in.html @@ -0,0 +1,10 @@ + + +
+FIXME +You have to log in now
+">Proceed and fail
+  +
+ + diff --git a/webcit/static/t/navbar.html b/webcit/static/t/navbar.html index ef6d73a11..645d258d3 100644 --- a/webcit/static/t/navbar.html +++ b/webcit/static/t/navbar.html @@ -20,7 +20,7 @@
  • - + diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 7a85697ec..889b068e7 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -875,3 +875,26 @@ function ConfirmLogoff() { } ); } + + +/* + * Wrapper script to require logging in before completing an action + */ +function GetLoggedInFirst(destination_url) { + + /* If logged in already, go directly to the destination. */ + /* FIXME implement this */ + + /* 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, + { + method: 'get', + onSuccess: function(cl_success) { + toggleModal(1); + } + } + ); +} -- 2.30.2