logout.c

ds2.10/lib/www/cgi/logout.c · 677 B

From the archive ds2.10.zip

Download the archive   « Back to the archive contents

#include <daemons.h>

varargs string gateway(mixed args){
    object ob = previous_object();
    mixed cookie = ob->GetCookie();
    string ret = "";

    if(!ENABLE_CREWEB){
        ret += "CreWeb is disabled.";
        ret += "<META http-equiv=\"refresh\" content=\"2;URL=login.html\">";
        return ret;
    }

    if(!cookie || !cookie["shib"] || !cookie["name"]){
        ret += "Not logged in.";
        ret += "<META http-equiv=\"refresh\" content=\"1;URL=login.html\">";
        return ret;
    }

    WEB_SESSIONS_D->EndSession(cookie["name"]);
    ret += "Logging out...";
    ret += "<META http-equiv=\"refresh\" content=\"2;URL=login.html\">";
    return ret;
}

Site Stats

Snippets: 1791
Codebases: 571