},
srcdump_process_item => \&srcdump_process_item,
srcdump_vcs_dirs => [qw(.git .hg .bzr .svn)],
- srcdump_vcsscript => [git => "
+ srcdump_vcsscript => {git => "
git ls-files -z
git ls-files -z --others --exclude-from=.gitignore
find .git -print0
- "],
+ "},
srcdump_byvcs => \&srcdump_byvcs,
srcdump_novcs => \&srcdump_novcs,
srcdump_excludes => [qw(*~ *.bak *.tmp), '#*#'],
$verifier->{S}{$k} = $v;
}
$verifier->{S}{db_setup_stmts} //=
- ["CREATE TABLE $v->{S}{db_prefix}_assocs (".
+ ["CREATE TABLE $verifier->{S}{db_prefix}_assocs (".
" assochash VARCHAR PRIMARY KEY,".
" username VARCHAR NOT NULL,".
" last INTEGER NOT NULL".
")"
,
- "CREATE INDEX $v->{S}{db_prefix}_assocs_timeout_index".
- " ON $v->{S}{db_prefix}_assocs".
+ "CREATE INDEX $verifier->{S}{db_prefix}_assocs_timeout_index".
+ " ON $verifier->{S}{db_prefix}_assocs".
" (last)"
];
bless $verifier, $class;
die if $srcdump =~ m/\W/;
return ({ Kind => 'SRCDUMP-'.uc $srcdump,
Message => undef,
- CookieSecret => undef,
+ _CookieRaw => undef,
Params => { } });
}
if ($r->{S}{encrypted_only} && !$r->_ch('is_https')) {
return ({ Kind => 'REDIRECT-HTTPS',
Message => $r->_gt("Redirecting to secure server..."),
- CookieSecret => undef,
+ _CookieRaw => undef,
Params => { } });
}
$r->_db_revoke($parmh);
return ({ Kind => 'REDIRECT-LOGGEDOUT',
Message => $r->_gt("Logging out..."),
- CookieSecret => '',
- Params => { } });
+ _CookieRaw => '',
+ Params => {
+ $r->{S}{loggedout_param_names}[0] => [ 1 ],
+ } });
}
if ($r->_ch('is_loggedout')) {
die unless $meth eq 'GET';
die if $parmt;
return ({ Kind => 'SMALLPAGE-LOGGEDOUT',
Message => $r->_gt("You have been logged out."),
- CookieSecret => '',
+ _CookieRaw => '',
Params => { } });
}
if ($r->_ch('is_login')) {
Message => $r->_gt("You do not seem to have cookies".
" enabled. You must enable cookies".
" as we use them for login."),
- CookieSecret => $r->_fresh_secret(),
+ _CookieRaw => $r->_fresh_secret(),
Params => $r->_chain_params() })
}
if (!$cookt || $cookt eq 'n' || $cookh ne $parmh) {
return ({ Kind => 'LOGIN-STALE',
Message => $r->_gt("Stale session;".
" you need to log in again."),
- CookieSecret => $r->_fresh_secret(),
+ _CookieRaw => $r->_fresh_secret(),
Params => { } })
}
die unless $parmt eq 't' || $parmt eq 'y';
if !$login_errormessage;
return ({ Kind => 'LOGIN-BAD',
Message => $login_errormessage,
- CookieSecret => $cooks,
+ _CookieRaw => $cooks,
Params => $r->_chain_params() })
}
$r->_db_record_login_ok($parmh,$username);
return ({ Kind => 'REDIRECT-LOGGEDIN',
Message => $r->_gt("Logging in..."),
- CookieSecret => $cooks,
+ _CookieRaw => $cooks,
Params => $r->_chain_params() });
}
if ($cookt eq 't') {
if ($meth eq 'GET') {
return ({ Kind => 'LOGIN-INCOMINGLINK',
Message => $r->_gt("You need to log in."),
- CookieSecret => $news,
+ _CookieRaw => $news,
Params => $r->_chain_params() });
} else {
$r->_db_revoke($parmh);
return ({ Kind => 'LOGIN-FRESH',
Message => $r->_gt("You need to log in."),
- CookieSecret => $news,
+ _CookieRaw => $news,
Params => { } });
}
}
if ($meth ne 'POST') {
return ({ Kind => 'MAINPAGEONLY',
Message => $r->_gt('Entering via cross-site link.'),
- CookieSecret => $cooks,
+ _CookieRaw => $cooks,
Params => { } });
# NB caller must then ignore params & path!
# if this is too hard they can spit out a small form
my $dbh = $r->{Dbh};
$r->{Divert} = $r->_db_transaction(sub { $r->_check_divert_core(); });
$dbh->commit();
+
+ my $cookraw = $r->{_CookieRaw};
+ $r->{CookieSecret} = $$cookraw;
+ if ($cookraw) {
+ $r->{Params}{$r->{S}{assoc_param_name}} = [
+ $r->hash($cookraw)
+ ];
+ }
+
$r->_debug(Data::Dumper->Dump([$r->{Divert}],[qw(divert)]));
return $r->{Divert};
}
# for redirects, we honour stored Params and Cookie,
# as we would for non-divert
if ($kind eq 'REDIRECT-LOGGEDOUT') {
- $params->{$r->{S}{loggedout_param_names}[0]} = [ 1 ];
} elsif ($kind eq 'REDIRECT-LOGOUT') {
$params->{$r->{S}{logout_param_names}[0]} = [ 1 ];
} elsif ($kind =~ m/REDIRECT-(?:LOGGEDIN|HTTPS)/) {
return 0;
}
- if (defined $cookiesecret) {
- $params->{$r->{S}{assoc_param_name}} = [ $r->hash($cookiesecret) ];
- }
-
my ($title, @body);
if ($kind =~ m/^LOGIN-/) {
$title = $r->_gt('Login');