Began implementing GetLoggedInFirst(destination_url) path
authorArt Cancro <ajc@citadel.org>
Wed, 29 Dec 2010 16:00:53 +0000 (11:00 -0500)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 13:31:21 +0000 (13:31 +0000)
webcit/static/t/get_logged_in.html [new file with mode: 0644]
webcit/static/t/navbar.html
webcit/static/wclib.js

diff --git a/webcit/static/t/get_logged_in.html b/webcit/static/t/get_logged_in.html
new file mode 100644 (file)
index 0000000..f9e371e
--- /dev/null
@@ -0,0 +1,10 @@
+<html>
+<body>
+<center>
+FIXME
+You have to log in now<br>
+<a href="<?BSTR("destination_url")>">Proceed and fail</a><br>
+<a href="javascript:toggleModal(0);"><img src="static/closewindow.gif" border="0">&nbsp;<?_("Cancel")></a>
+</center>
+</body>
+</html>
index ef6d73a117374c0d31d2f70c7fec0b068b2879aa..645d258d3b0975eed9a77fa207f68fdc15de86e7 100644 (file)
@@ -20,7 +20,7 @@
                </a>
        </li>
        <li class="newmess">
-               <a href="display_enter">
+               <a href="javascript:GetLoggedInFirst('display_enter')">
                        <img  src="static/newmess3_24x.gif" alt="" width="24" height="24">
                        <span class="navbar_link"><?_("Enter a message")></span>
                </a>
index 7a85697ecaad8823adb72c62b049d2a84b09d563..889b068e70f11b1b96ebec0c632263bc52096771 100644 (file)
@@ -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);
+                       }
+                }
+        );
+}