X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=cgi-auth-flexible.git;a=blobdiff_plain;f=cgi-auth-hybrid.pm;h=44058fc71cf93e80a7007b2c48396d101e59accb;hp=9536ba726e8dc3507ec76d8b34a349db2addfe17;hb=e0b5d2156bf63b93189ce95ca70467300059c6e9;hpb=f3fce9867ccbb9b591c682d699009af6ceb1c341 diff --git a/cgi-auth-hybrid.pm b/cgi-auth-hybrid.pm index 9536ba7..44058fc 100644 --- a/cgi-auth-hybrid.pm +++ b/cgi-auth-hybrid.pm @@ -21,13 +21,17 @@ our %_s = ( assocdb_table => 'assocs', random_source => '/dev/urandom', associdlen => 128, # bits + param_name => 'cah_associd', + cookie_name => 'cah_associd', # make undef to disable cookie + param_get => sub { _c()->param($s_{param_name}) }, + cookie_get => sub { $_s{cookie_name} ? _c()->param($s_{cookie_name}) : '' }, ); use DBI; our $dbh; -sub setup { +sub new { my ($k,$v); while (($k,$v,@_) = @_) { die "unknown setting $k" unless %_s{$k}; @@ -75,3 +79,8 @@ sub record_login ($) { $username = $nusername; $assoc = $nassoc; } + +sub check () { + my $passocid = $_s{param_get}(); + my $cassocid = $_s{cookie_get}(); + if (