Roxen.git / server / modules / security / auth_httpcookie.pike

version» Context lines:

Roxen.git/server/modules/security/auth_httpcookie.pike:1:   constant cvs_version = -  "$Id: auth_httpcookie.pike,v 1.1 2001/01/19 16:35:47 per Exp $"; +  "$Id: auth_httpcookie.pike,v 1.2 2001/01/19 18:34:45 per Exp $";   inherit AuthModule;   inherit "module";      #define COOKIE "_roxen_cookie_auth"    - constant name = "httpcookie"; + constant name = "cookie";      //<locale-token project="mod_auth_httpcookie">_</locale-token>   #define _(X,Y) _DEF_LOCALE("mod_auth_httpcookie",X,Y)      #include <module.h>      LocaleString module_name_locale =    _(0,"HTTP Cookie authentication");      LocaleString module_doc_locale =
Roxen.git/server/modules/security/auth_httpcookie.pike:77:   //! configuration are searched in order, then the configuration user   //! database.   //!   //! The return value is the autenticated user.   {    string password;    string user;       if( !id->cookies[ COOKIE ] )    return 0; -  +     [password,user] = lookup_cookie( id->cookies[ COOKIE ] );       if( !user || !password )    return 0;    -  +  NOCACHE();    User res;    if( !db )    {    foreach( id->conf->user_databases(), UserDB db )    if( res = low_authenticate( id, user, password, db ) )    return res;    Roxen.remove_cookie( id, COOKIE, "", 0, "/" );    return 0;    }    res = low_authenticate( id, user, password, db );
Roxen.git/server/modules/security/auth_httpcookie.pike:106:   }         mapping authenticate_throw( RequestID id, string realm, UserDB db )   //! Returns a reply mapping, similar to @[Roxen.http_rxml_reply] with   //! friends. If no @[db] is specified, all datbases in the current   //! configuration are searched in order, then the configuration user   //! database.   {    string u, p; +  NOCACHE();    if( (u=id->variables->_cookie_username) &&    (p=id->variables->_cookie_password) )    {    Roxen.set_cookie( id, COOKIE, create_cookie( u, p ), -1, 0, "/");    return Roxen.http_redirect( id->not_query+"?"+    "netscape=needsthis&"+id->query, id );    }       return Roxen.http_rxml_answer(    replace( query("user_form"),
Roxen.git/server/modules/security/auth_httpcookie.pike:134:   void start()   {    sql = get_my_sql();    table = get_my_table(    "cookie varchar(40) PRIMARY KEY NOT NULL, "    "password varchar(40) NOT NULL, "    "name varchar(40) NOT NULL"    );   }    - void create() + static void create()   {    defvar( "user_form", Variable.Text(   #"   <title>Authentication required for REALM</title>   <body alink=\"#000000\" bgcolor=\"#ffffff\" text=\"#000000\">    <form method='POST'>    Username: UNINPUT<br />    Password: PWINPUT<br />    <input type=submit value=' Ok ' />   </form></body>",0,    _(0,"User form"),_(0,"The user/password request form shown to the user")));   }