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

version» Context lines:

Roxen.git/server/modules/security/auth_httpcookie.pike:1:   // This is a roxen module. Copyright © 2001 - 2004, Roxen IS.      constant cvs_version = -  "$Id: auth_httpcookie.pike,v 1.12 2008/08/15 12:33:55 mast Exp $"; +  "$Id$";   inherit AuthModule;   inherit "module";      #define COOKIE "_roxen_cookie_auth"      constant name = "cookie";      //<locale-token project="mod_auth_httpcookie">_</locale-token>   #define _(X,Y) _DEF_LOCALE("mod_auth_httpcookie",X,Y)   
Roxen.git/server/modules/security/auth_httpcookie.pike:26:   {    if( User u = db->find_user( user ) )    if( u->password_authenticate( password ) )    return u;   }      protected string table;      protected string encode_pw(string p)   { -  return Gmp.mpz( ~p, 256 )->digits( 9 ); +  return Gmp.mpz( ~p, 256 )->digits( 36 );   }      protected string decode_pw( string p )   { -  return ~Gmp.mpz( p, 9 )->digits( 256 ); +  return ~Gmp.mpz( p, 36 )->digits( 256 );   }      protected array(string) low_lookup_cookie( string cookie )   {    array r =    get_my_sql()->query( "SELECT name,password FROM "+    table+" WHERE cookie=%s", cookie );    if( !sizeof( r ) )    return ({0,0});    return ({ decode_pw(r[0]->password), decode_pw( r[0]->name ) });