Update of /cvs/scoop/scoop/lib/Scoop
In directory lithium.sabren.com:/tmp/cvs-serv16346/lib/Scoop
Modified Files:
Comments.pm Stories.pm Tags.pm Utility.pm
Log Message:
Committing rusty's formkey fix, along with the "All Tags" page control
stuff. -ct
Index: Stories.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Stories.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** Stories.pm 10 Sep 2005 01:13:45 -0000 1.49
--- Stories.pm 16 Aug 2006 23:44:06 -0000 1.50
***************
*** 271,275 ****
# Check the formkey, to prevent duplicate postings
! unless ($S->check_formkey()) {
$error = "Invalid form key. This is probably because you clicked 'Post' or 'Preview' more than once. DO NOT HIT 'BACK'! Make sure you haven't already posted this once, then go ahead and post or preview from this screen.";
$save = 0;
--- 271,275 ----
# Check the formkey, to prevent duplicate postings
! if ($save && !$S->check_formkey()) {
$error = "Invalid form key. This is probably because you clicked 'Post' or 'Preview' more than once. DO NOT HIT 'BACK'! Make sure you haven't already posted this once, then go ahead and post or preview from this screen.";
$save = 0;
Index: Utility.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Utility.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** Utility.pm 6 Aug 2006 04:22:45 -0000 1.37
--- Utility.pm 16 Aug 2006 23:44:06 -0000 1.38
***************
*** 768,772 ****
# Get the key sent in by the form
my $input_key = $S->{CGI}->param('formkey');
! return 1 unless $input_key;
# get the list of formkeys
--- 768,773 ----
# Get the key sent in by the form
my $input_key = $S->{CGI}->param('formkey');
!
! return 0 unless $input_key;
# get the list of formkeys
Index: Comments.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Comments.pm,v
retrieving revision 1.135
retrieving revision 1.136
diff -C2 -d -r1.135 -r1.136
*** Comments.pm 6 Aug 2006 04:22:45 -0000 1.135
--- Comments.pm 16 Aug 2006 23:44:06 -0000 1.136
***************
*** 26,29 ****
--- 26,32 ----
# some variables for use in the plethora of conditionals below
my $section = $S->_get_story_section($sid);
+ # Run a hook here for when the poll is viewed.
+ $S->run_hook('comment_view', $cid, $sid, $section);
+
my $sect_post_perm;
my $sect_read_perm;
***************
*** 88,92 ****
# Check formkey
! unless ($S->check_formkey()) {
$S->{UI}->{BLOCKS}->{COMM_ERR} = qq|
<table cellpadding="1" cellspacing="0" border="0" width="100%">
--- 91,95 ----
# Check formkey
! if (($tool eq 'post' && $post || $preview) && !$S->check_formkey()) {
$S->{UI}->{BLOCKS}->{COMM_ERR} = qq|
<table cellpadding="1" cellspacing="0" border="0" width="100%">
Index: Tags.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Tags.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Tags.pm 6 Aug 2006 04:22:45 -0000 1.3
--- Tags.pm 16 Aug 2006 23:44:06 -0000 1.4
***************
*** 319,323 ****
}else{
$S->{UI}{BLOCKS}{subtitle} = qq{All Tags};
! return $S->all_tags_page({displaystatus => [0,1]});
}
}
--- 319,330 ----
}else{
$S->{UI}{BLOCKS}{subtitle} = qq{All Tags};
! my $p = {displaystatus => [0,1]};
! my $cut = $S->var('all_tags_cutoff');
! my $limit = $S->var('all_tags_limit');
!
! $p->{cutoff} = $cut if ($cut);
! $p->{limit} = $limit if ($limit);
!
! return $S->all_tags_page($p);
}
}