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);
}
}
/*
* 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) ;
<input type="password" name="pass" id="pname">
<br><br>
</form>
-<div class="buttons"><a href="javascript:ajax_try_username_and_password('<?BSTR("destination_url", "U")>');"><?_("Log in")></a></div>
+<div class="buttons"><a href="javascript:ajax_try_username_and_password();"><?_("Log in")></a></div>
</div>
<div class="authbox" id="authbox_openid" style="display: none">
}
+/*
+ * Save a URL destination so we can go to it later
+ */
+void push_destination(void) {
+ wcsession *WCC = WC;
+
+ if (!WCC) {
+ wc_printf("no session");
+ return;
+ }
+
+ FreeStrBuf(&WCC->PushedDestination);
+ WCC->PushedDestination = NewStrBufDup(SBSTR("url"));
+ lprintf(9, "Push: %s\n", ChrPtr(WCC->PushedDestination));
+ wc_printf("OK");
+}
+
+/*
+ * Go to the URL saved by push_destination()
+ */
+void pop_destination(void) {
+ wcsession *WCC = WC;
+
+ if (!WCC) {
+ do_welcome();
+ return;
+ }
+
+ lprintf(9, "Pop: %s\n", ChrPtr(WCC->PushedDestination));
+ http_redirect(ChrPtr(WCC->PushedDestination));
+}
+
+
int ReadPostData(void)
{
WebcitAddUrlHandler(HKEY("sslg"), "", 0, seconds_since_last_gexp, AJAX|LOGCHATTY);
WebcitAddUrlHandler(HKEY("ajax_servcmd"), "", 0, ajax_servcmd, 0);
WebcitAddUrlHandler(HKEY("webcit"), "", 0, blank_page, URLNAMESPACE);
+ WebcitAddUrlHandler(HKEY("push"), "", 0, push_destination, AJAX);
+ WebcitAddUrlHandler(HKEY("pop"), "", 0, pop_destination, 0);
WebcitAddUrlHandler(HKEY("401"), "", 0, authorization_required, ANONYMOUS|COOKIEUNNEEDED);
RegisterConditional(HKEY("COND:IMPMSG"), 0, ConditionalImportantMesage, CTX_NONE);
/*
- * Copyright (c) 1987-2010 by the citadel.org team
+ * Copyright (c) 1987-2011 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* waiting on the specified port for incoming HTTP connections. When a
* connection is established, it calls context_loop() from context_loop.c.
*
- * Copyright (c) 1996-2010 by the citadel.org developers.
+ * Copyright (c) 1996-2011 by the citadel.org developers.
* This program is released under the terms of the GNU General Public License v3.
*
*/
/* Tell 'em who's in da house */
lprintf(1, PACKAGE_STRING "\n");
- lprintf(1, "Copyright (C) 1996-2010 by the Citadel development team.\n"
- "This software is distributed under the terms of the "
- "GNU General Public License.\n\n"
- );
-
-
- /* initialize the International Bright Young Thing */
+ lprintf(1, "Copyright (C) 1996-2011 by the citadel.org team\n");
+ lprintf(1, "\n");
+ lprintf(1, "This program is open source software: you can redistribute it and/or\n");
+ lprintf(1, "modify it under the terms of the GNU General Public License as published\n");
+ lprintf(1, "by the Free Software Foundation, either version 3 of the License, or\n");
+ lprintf(1, "(at your option) any later version.\n");
+ lprintf(1, "\n");
+ lprintf(1, "This program is distributed in the hope that it will be useful,\n");
+ lprintf(1, "but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
+ lprintf(1, "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n");
+ lprintf(1, "GNU General Public License for more details.\n");
+ lprintf(1, "\n");
+ lprintf(1, "You should have received a copy of the GNU General Public License\n");
+ lprintf(1, "along with this program. If not, see <http://www.gnu.org/licenses/>.\n");
+ lprintf(1, "\n");
+
+
+ /* initialize various subsystems */
initialise_modules();
-
InitTemplateCache();
if (DumpTemplateI18NStrings) {
FILE *fd;