X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fstatic%2Fauthmethods.js;h=57550687a0f177cd6a90f2dcd339337113e2a747;hb=d41fbd6833f588439fdc6f1fd61bd1f806242580;hp=2665351769404e5a6da0b07345dce72a64c506d8;hpb=56bd885c4461e270565c2b4bd07e691ec8633b84;p=citadel.git diff --git a/webcit/static/authmethods.js b/webcit/static/authmethods.js index 266535176..57550687a 100644 --- a/webcit/static/authmethods.js +++ b/webcit/static/authmethods.js @@ -6,13 +6,30 @@ */ +/* + * Are we logged in right now? + */ +function IsLoggedIn() { + if ($('is_logged_in').innerHTML == "yes") { + return 1; + } + else { + return 0; + } +} + + + /* * 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 (IsLoggedIn()) { + window.location = destination_url; + return; + } /* 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;