chiark
/
gitweb
/
~ian
/
cgi-auth-flexible.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f3fce98
)
wip before oop
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 31 Aug 2012 19:58:40 +0000
(20:58 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 31 Aug 2012 19:58:40 +0000
(20:58 +0100)
cgi-auth-hybrid.pm
patch
|
blob
|
history
diff --git
a/cgi-auth-hybrid.pm
b/cgi-auth-hybrid.pm
index 9536ba726e8dc3507ec76d8b34a349db2addfe17..44058fc71cf93e80a7007b2c48396d101e59accb 100644
(file)
--- 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
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;
);
use DBI;
our $dbh;
-sub
setup
{
+sub
new
{
my ($k,$v);
while (($k,$v,@_) = @_) {
die "unknown setting $k" unless %_s{$k};
my ($k,$v);
while (($k,$v,@_) = @_) {
die "unknown setting $k" unless %_s{$k};
@@
-75,3
+79,8
@@
sub record_login ($) {
$username = $nusername;
$assoc = $nassoc;
}
$username = $nusername;
$assoc = $nassoc;
}
+
+sub check () {
+ my $passocid = $_s{param_get}();
+ my $cassocid = $_s{cookie_get}();
+ if (