diffs (218 lines):

diff -r d79f9ac851e6 -r 19d002d29a82 .hgtags
--- a/.hgtags   Wed Jul 28 23:25:59 2010 -0700
+++ b/.hgtags   Thu Jul 29 09:50:18 2010 -0500
@@ -15,3 +15,4 @@ 9712d8733e4f644e00190bb81d53f1121948d223
 9712d8733e4f644e00190bb81d53f1121948d223 0.10.1
 b956808a3d76220d0cfdde742789e952606eda9c 0.11.0
 ca48892d3115f048c996663bf35fc8b0830c6b0d 0.11.1
+d1c9cbbd12cce61b281263d7c4e51b60de0c1144 0.12.0
diff -r d79f9ac851e6 -r 19d002d29a82 bin/upgrading/update-db-general.pl
--- a/bin/upgrading/update-db-general.pl        Wed Jul 28 23:25:59 2010 -0700
+++ b/bin/upgrading/update-db-general.pl        Thu Jul 29 09:50:18 2010 -0500
@@ -3746,7 +3746,7 @@ register_alter(sub {
                   q{ALTER TABLE syndicated_hubbub2 ADD COLUMN timespinged INT 
UNSIGNED NOT NULL DEFAULT '0'} );
     }
 
-    if ( table_relevant( "logkwsum" ) && ! check_dbnote( 
"logkwsum_fix_filtered_counts" ) ) {
+    if ( table_relevant( "logkwsum" ) && ! check_dbnote( 
"logkwsum_fix_filtered_counts_2010" ) ) {
         # this is a very, very racy situation ... we want to do an update of 
this data, but if anybody
         # else is actively using this table, they're going to be inserting bad 
data on top of us which
         # will leave SOMEONE in an inconsistent state.  let's warn the user 
that they should have the site
@@ -3781,6 +3781,7 @@ EOF
                   WHERE logtags.journalid = log2.journalid
                     AND logtags.jitemid = log2.jitemid
                     AND log2.security = 'usemask'
+                    AND log2.allowmask > 0
                   GROUP BY journalid, kwid, allowmask
             }
         );
@@ -3791,7 +3792,9 @@ EOF
                   FROM log2, logtags
                   WHERE logtags.journalid = log2.journalid
                     AND logtags.jitemid = log2.jitemid
-                    AND log2.security = 'private'
+                    AND ( log2.security = 'private'
+                          OR ( log2.security = 'usemask'
+                               AND log2.allowmask = 0 ) )
                   GROUP BY journalid, kwid
             }
         );
@@ -3808,7 +3811,7 @@ EOF
         );
 
         do_sql( 'UNLOCK TABLES' );
-        set_dbnote( "logkwsum_fix_filtered_counts", 1 );
+        set_dbnote( "logkwsum_fix_filtered_counts_2010", 1 );
     }
 
     unless ( column_type( 'clustertrack2', 'accountlevel' ) ) {
diff -r d79f9ac851e6 -r 19d002d29a82 cgi-bin/DW/Captcha.pm
--- a/cgi-bin/DW/Captcha.pm     Wed Jul 28 23:25:59 2010 -0700
+++ b/cgi-bin/DW/Captcha.pm     Thu Jul 29 09:50:18 2010 -0500
@@ -86,7 +86,9 @@ sub print {
 
 sub validate { 
     my ( $self, %opts ) = @_;
-    return unless $self->enabled;
+
+    # if disabled, then it's always valid to allow the post to go through
+    return 1 unless $self->enabled;
 
     $self->init_opts( %opts );
 
diff -r d79f9ac851e6 -r 19d002d29a82 cgi-bin/DW/Controller/Latest/Mood.pm
--- a/cgi-bin/DW/Controller/Latest/Mood.pm      Wed Jul 28 23:25:59 2010 -0700
+++ b/cgi-bin/DW/Controller/Latest/Mood.pm      Thu Jul 29 09:50:18 2010 -0500
@@ -44,11 +44,13 @@ sub mood_handler {
 
     my $moods = LJ::MemCache::get( "latest_moods" ) || [];
     my $out = {};
+    my $num_top = 5;
+    my $count = scalar @$moods;
 
-    if ( scalar @$moods ) {
+    if ( $count ) {
         my %counts;
         my $score = 0;
-        my $count = scalar @$moods;
+        my $to_show = $count > $num_top ? $num_top : $count;
 
         my $metadata = DW::Mood->get_moods;
 
@@ -58,7 +60,8 @@ sub mood_handler {
         }
 
         my @names = sort { $counts{$b} <=> $counts{$a} || $a cmp $b } keys 
%counts;
-        my %top_counts = map { ($_,$counts{$_}) } @names[0..5];
+        my @highest = @names[0..( $to_show - 1)];
+        my %top_counts = map { ($_,$counts{$_}) } @highest;
         my @top_mood;
         foreach my $mood ( @names ) {
             if ( $counts{$mood} == $counts{$names[0]} ) {
@@ -71,7 +74,7 @@ sub mood_handler {
         $out->{counts} = \%top_counts;
         $out->{score} = int($score / $count);
         $out->{score} = $r->get_args->{score} if defined $r->get_args->{score};
-        $out->{highest} = [ @names[0..5] ];
+        $out->{highest} = \...@highest;
         $out->{top_mood} = \...@top_mood;
     } else {
         $out->{no_data} = 1;
diff -r d79f9ac851e6 -r 19d002d29a82 cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm       Wed Jul 28 23:25:59 2010 -0700
+++ b/cgi-bin/LJ/Entry.pm       Thu Jul 29 09:50:18 2010 -0500
@@ -2154,7 +2154,7 @@ sub item_link
     # XXX: should have an option of returning a url with escaped (&amp;)
     #      or non-escaped (&) arguments.  a new link object would be best.
     my $args = @args ? "?" . join("&amp;", @args) : "";
-    return $u->journal_base . "/$ditemid.html$args";
+    return LJ::journal_base( $u ) . "/$ditemid.html$args";
 }
 
 # <LJFUNC>
diff -r d79f9ac851e6 -r 19d002d29a82 cvs/multicvs.conf
--- a/cvs/multicvs.conf Wed Jul 28 23:25:59 2010 -0700
+++ b/cvs/multicvs.conf Thu Jul 29 09:50:18 2010 -0500
@@ -33,7 +33,7 @@ SVN(miscperl)             = http://code.
 SVN(miscperl)             = http://code.livejournal.org/svn/miscperl/trunk/
 SVN(Test-FakeApache)      = 
http://code.livejournal.org/svn/Test-FakeApache/trunk/
 SVN(LJ-UserSearch)        = 
http://code.livejournal.org/svn/LJ-UserSearch/trunk/
-SVN(TheSchwartz-Worker-SendEmail) = 
http://code.livejournal.org/svn/TheSchwartz-Worker-SendEmail/trunk/
+SVN(TheSchwartz-Worker-SendEmail) = 
http://code.sixapart.com/svn/TheSchwartz-Worker-SendEmail/trunk/
 SVN(hubbub)               = 
http://pubsubhubbub.googlecode.com/svn/trunk/publisher_clients/
 
 dw-free                                   .
diff -r d79f9ac851e6 -r 19d002d29a82 htdocs/admin/invites/distribute.bml
--- a/htdocs/admin/invites/distribute.bml       Wed Jul 28 23:25:59 2010 -0700
+++ b/htdocs/admin/invites/distribute.bml       Thu Jul 29 09:50:18 2010 -0500
@@ -45,6 +45,17 @@ body<=
         my $selected_user_class = $POST{user_class};
         my $reason = $POST{reason};
 
+        # sanitize the number of invites
+        $num_invites_requested =~ s/[^0-9]//g;
+        $num_invites_requested += 0;
+
+        return LJ::error_list( $ML{ '.error.noinvites' } ) unless 
$num_invites_requested;
+
+        # sanitize selected user class
+        my $class_names = DW::BusinessRules::InviteCodes::user_classes();
+        return LJ::error_list( LJ::Lang::ml( '.error.nosuchclass', { class => 
$selected_user_class } ) )
+            unless exists $class_names->{$selected_user_class};
+
         my $sclient = LJ::theschwartz()
             or return LJ::error_list( $ML{'error.noschwartz'} );
         $sclient->insert('DW::Worker::DistributeInvites',
diff -r d79f9ac851e6 -r 19d002d29a82 htdocs/admin/invites/distribute.bml.text
--- a/htdocs/admin/invites/distribute.bml.text  Wed Jul 28 23:25:59 2010 -0700
+++ b/htdocs/admin/invites/distribute.bml.text  Thu Jul 29 09:50:18 2010 -0500
@@ -1,6 +1,10 @@
 .btn.distribute=Distribute
 
 .error.cantinsertjob=Unable to start TheSchwartz job for invite codes 
distribution.
+
+.error.nosuchclass=The selection class "[[class]]" does not exist.
+
+.error.noinvites=Cannot distribute 0 invites!
 
 .field.distribute.label=Distribute to:
 
diff -r d79f9ac851e6 -r 19d002d29a82 htdocs/search.bml
--- a/htdocs/search.bml Wed Jul 28 23:25:59 2010 -0700
+++ b/htdocs/search.bml Thu Jul 29 09:50:18 2010 -0500
@@ -166,10 +166,10 @@ body<=
             if $match->{security} eq 'usemask' && ! $mu->equals( $remote );
 
         my $icon = {
-                public => '',
-                private => LJ::img( "security-private",   "" );
-                usemask => LJ::img( "security-groups",    "" );
-                access  => LJ::img( "security-protected", "" );
+                public  => '',
+                private => LJ::img( "security-private",   "" ),
+                usemask => LJ::img( "security-groups",    "" ),
+                access  => LJ::img( "security-protected", "" ),
             }->{$match->{security}};
 
         my $tags = join( ', ', map { "<strong>" . $match->{tags}->{$_} . 
"</strong>" } keys %{ $match->{tags} } );
diff -r d79f9ac851e6 -r 19d002d29a82 htdocs/support/see_request.bml
--- a/htdocs/support/see_request.bml    Wed Jul 28 23:25:59 2010 -0700
+++ b/htdocs/support/see_request.bml    Thu Jul 29 09:50:18 2010 -0500
@@ -371,7 +371,7 @@ body<=
     $ret .= LJ::name_caps($u->{'caps'}) || "<i>$ML{'.unknown'}</i>";
     $ret .= "</td></tr>\n";
 
-    if ( $u->userid ) {
+    if ($u->{'userid'}) {
         $ret .= "<tr valign='top'><td 
align='right'><b>$LJ::SITENAMESHORT:</b></td><td>";
 
         if ($u->is_expunged) {
@@ -552,18 +552,19 @@ body<=
             $most_recent_tier = $le->{tier};
         }
 
-        my $up = LJ::load_userid( $le->{userid} );
-        my $remote_is_up = $remote && $remote->equals( $up );
+        next if ($le->{'type'} eq "internal" && ! 
(LJ::Support::can_read_internal($sp, $remote) ||
+                                                   ($remote && 
$remote->{'userid'} == $le->{'userid'} )));
+        next if ($le->{'type'} eq "screened" && ! 
(LJ::Support::can_read_screened($sp, $remote) ||
+                                                   ($remote && 
$remote->{'userid'} == $le->{'userid'} )));
 
-        next if $le->{type} eq "internal" && ! ( 
LJ::Support::can_read_internal( $sp, $remote )
-                                                 || $remote_is_up );
-        next if $le->{type} eq "screened" && ! ( 
LJ::Support::can_read_screened( $sp, $remote )
-                                                 || $remote_is_up );
-        next if $le->{type} eq "screened" && $up && !$up->is_visible;
+        my $up = LJ::load_userid($le->{'userid'});
+        next if ($le->{'type'} eq "screened") && $up && !$up->is_visible;
 
-        push @screened, $le if $le->{type} eq "screened";
+        if ($le->{'type'} eq "screened") {
+            push @screened, $le;
+        }
 
-        my $message = $le->{message};
+        my $message = $le->{'message'};
         my %url;
         my $urlN = 0;
 
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to