]> code.citadel.org Git - citadel.git/blobdiff - webcit/static/wclib.js
Began implementing GetLoggedInFirst(destination_url) path
[citadel.git] / webcit / static / wclib.js
index 73dd400392d33ce4379ef0a9af382d6ce8081c30..889b068e70f11b1b96ebec0c632263bc52096771 100644 (file)
@@ -1,10 +1,8 @@
 /*
- * $Id$
- * Copyright 2005 - 2009 The Citadel Team
+ * Copyright 2005 - 2010 The Citadel Team
  * Licensed under the GPL V3
  *
  * JavaScript function library for WebCit.
- *
  */
 
 
@@ -863,3 +861,40 @@ function DeleteSMTPqueueMsg(msgnum1, msgnum2) {
                }
        );
 }
+
+
+function ConfirmLogoff() {
+       new Ajax.Updater(
+               'md-content',
+               'do_template?template=confirmlogoff',
+                {
+                        method: 'get',
+                       onSuccess: function(cl_success) {
+                               toggleModal(1);
+                       }
+                }
+        );
+}
+
+
+/*
+ * 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);
+                       }
+                }
+        );
+}