Changeset 14070
- Timestamp:
- 07/23/08 23:30:03 (5 years ago)
- Location:
- trunk
- Files:
-
- 27 modified
-
bin/upgrading/en.dat (modified) (3 diffs)
-
bin/upgrading/proplists.dat (modified) (2 diffs)
-
cgi-bin/Apache/LiveJournal.pm (modified) (1 diff)
-
cgi-bin/LJ/Comment.pm (modified) (1 diff)
-
cgi-bin/LJ/Console/Command/Suspend.pm (modified) (4 diffs)
-
cgi-bin/LJ/Console/Command/Unsuspend.pm (modified) (3 diffs)
-
cgi-bin/LJ/Entry.pm (modified) (3 diffs)
-
cgi-bin/LJ/S2/DayPage.pm (modified) (3 diffs)
-
cgi-bin/LJ/S2/EntryPage.pm (modified) (2 diffs)
-
cgi-bin/LJ/S2/FriendsPage.pm (modified) (3 diffs)
-
cgi-bin/LJ/S2/MonthPage.pm (modified) (2 diffs)
-
cgi-bin/LJ/S2/RecentPage.pm (modified) (3 diffs)
-
cgi-bin/LJ/S2/ReplyPage.pm (modified) (2 diffs)
-
cgi-bin/LJ/User.pm (modified) (1 diff)
-
cgi-bin/LJ/Vertical.pm (modified) (1 diff)
-
cgi-bin/cleanhtml.pl (modified) (4 diffs)
-
cgi-bin/ljfeed.pl (modified) (2 diffs)
-
cgi-bin/ljviews.pl (modified) (7 diffs)
-
cgi-bin/supportlib.pl (modified) (2 diffs)
-
cgi-bin/weblib.pl (modified) (1 diff)
-
htdocs/editjournal.bml (modified) (5 diffs)
-
htdocs/editjournal.bml.text (modified) (1 diff)
-
htdocs/talkpost.bml (modified) (3 diffs)
-
htdocs/talkpost.bml.text (modified) (1 diff)
-
htdocs/talkpost_do.bml (modified) (1 diff)
-
htdocs/talkread.bml (modified) (3 diffs)
-
htdocs/view/index.bml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/upgrading/en.dat
r14025 r14070 46 46 47 47 btn.search=Search 48 49 cleanhtml.suspend_msg=This is a suspended entry. 50 51 cleanhtml.suspend_msg_with_supportid=This is a suspended entry. <a [[aopts]]>An unsuspension request</a> has been opened, and your entry will be reviewed soon. 48 52 49 53 contentflag.viewingconcepts=You are about to view content that may not be appropriate for minors. … … 1482 1486 entryform.save=Save Entry 1483 1487 1488 entryform.saveandrequestunsuspend=Save Entry & Request Unsuspension 1489 1484 1490 entryform.security=Security: 1485 1491 … … 2173 2179 talk.error.suspended.title=Suspended 2174 2180 2181 talk.error.suspendedentry=This entry is suspended. You can visit the journal <a [[aopts]]>here</a>. 2182 2183 talk.error.suspendedentryreply=This entry is suspended. You cannot reply to it. You can visit the journal <a [[aopts]]>here</a>. 2184 2175 2185 talk.frozen=Replies frozen 2176 2186 -
trunk/bin/upgrading/proplists.dat
r13958 r14070 1302 1302 sortorder: 99 1303 1303 1304 logproplist.statusvis: 1305 datatype: char 1306 des: 'V' or undef for visible, 'S' for suspended 1307 prettyname: Visibility Status of an Entry 1308 sortorder: 99 1309 1304 1310 logproplist.syn_id: 1305 1311 datatype: char … … 1326 1332 sortorder: 99 1327 1333 1334 logproplist.unsuspend_supportid: 1335 datatype: num 1336 des: The support request ID of the unsuspension request submitted by a user whose entry was suspended. Undef or 0 if no request is currently open. 1337 prettyname: Support Request ID for Unsuspension Request 1338 sortorder: 99 1339 1328 1340 logproplist.used_rte: 1329 1341 datatype: bool -
trunk/cgi-bin/Apache/LiveJournal.pm
r13819 r14070 1387 1387 1388 1388 $generate_iejunk = 1; 1389 1390 } elsif ($opts->{'suspendedentry'}) { 1391 $status = "403 Entry suspended"; 1392 $html = "<h1>Suspended Entry</h1>" . 1393 "<p>The entry at this URL is suspended. You cannot reply to it.</p>"; 1394 1395 $generate_iejunk = 1; 1389 1396 } 1390 1397 -
trunk/cgi-bin/LJ/Comment.pm
r13866 r14070 903 903 return 0 if $u->underage; 904 904 return 0 unless $u->get_cap("edit_comments"); 905 906 # entry cannot be suspended 907 return 0 if $self->entry->is_suspended; 905 908 906 909 # user must be the poster of the comment -
trunk/cgi-bin/LJ/Console/Command/Suspend.pm
r13095 r14070 7 7 sub cmd { "suspend" } 8 8 9 sub desc { "Suspend an account ." }9 sub desc { "Suspend an account or entry." } 10 10 11 11 sub args_desc { [ 12 'username or email address ' => "The username of the account to suspend, or an email address to suspend all accounts at that address.",13 'reason' => "Why you're suspending the account .",12 'username or email address or entry url' => "The username of the account to suspend, or an email address to suspend all accounts at that address, or an entry URL to suspend a single entry within an account", 13 'reason' => "Why you're suspending the account or entry.", 14 14 ] } 15 15 16 sub usage { '<username or email address > <reason>' }16 sub usage { '<username or email address or entry url> <reason>' } 17 17 18 18 sub can_execute { … … 26 26 return $self->error("This command takes two arguments. Consult the reference.") 27 27 unless $user && $reason && scalar(@args) == 0; 28 29 my $remote = LJ::get_remote(); 30 my $entry = LJ::Entry->new_from_url($user); 31 if ($entry) { 32 my $poster = $entry->poster; 33 my $journal = $entry->journal; 34 35 return $self->error("Invalid entry.") 36 unless $entry->valid; 37 38 return $self->error("Journal and/or poster is purged; cannot suspend entry.") 39 if $poster->is_expunged || $journal->is_expunged; 40 41 return $self->error("Entry is already suspended.") 42 if $entry->is_suspended; 43 44 $entry->set_prop( statusvis => "S" ); 45 46 $reason = "entry: " . $entry->url . "; reason: $reason"; 47 LJ::statushistory_add($journal, $remote, "suspend", $reason); 48 LJ::statushistory_add($poster, $remote, "suspend", $reason) 49 unless $journal->equals($poster); 50 51 return $self->print("Entry " . $entry->url . " suspended."); 52 } 28 53 29 54 my @users; … … 76 101 $u->{statusvis} = 'S'; 77 102 78 my $remote = LJ::get_remote();79 103 LJ::statushistory_add($u, $remote, "suspend", $reason); 80 104 … … 89 113 } 90 114 91 $self-> info("User '$username' suspended.");115 $self->print("User '$username' suspended."); 92 116 } 93 117 -
trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm
r12444 r14070 7 7 sub cmd { "unsuspend" } 8 8 9 sub desc { "Unsuspend an account ." }9 sub desc { "Unsuspend an account or entry." } 10 10 11 11 sub args_desc { [ 12 'username or email address ' => "The username of the account to unsuspend, or an email address to unsuspend all accounts at that address.",13 'reason' => "Why you're unsuspending the account .",12 'username or email address or entry url' => "The username of the account to unsuspend, or an email address to unsuspend all accounts at that address, or an entry URL to unsuspend a single entry within an account", 13 'reason' => "Why you're unsuspending the account or entry", 14 14 ] } 15 15 16 sub usage { '<username or email address > <reason>' }16 sub usage { '<username or email address or entry url> <reason>' } 17 17 18 18 sub can_execute { … … 26 26 return $self->error("This command takes two arguments. Consult the reference.") 27 27 unless $user && $reason && scalar(@args) == 0; 28 29 my $remote = LJ::get_remote(); 30 my $entry = LJ::Entry->new_from_url($user); 31 if ($entry) { 32 my $poster = $entry->poster; 33 my $journal = $entry->journal; 34 35 return $self->error("Invalid entry.") 36 unless $entry->valid; 37 38 return $self->error("Journal and/or poster is purged; cannot unsuspend entry.") 39 if $poster->is_expunged || $journal->is_expunged; 40 41 return $self->error("Entry is not currently suspended.") 42 if $entry->is_visible; 43 44 $entry->set_prop( statusvis => "V" ); 45 $entry->set_prop( unsuspend_supportid => 0 ) 46 if $entry->prop("unsuspend_supportid"); 47 48 $reason = "entry: " . $entry->url . "; reason: $reason"; 49 LJ::statushistory_add($journal, $remote, "unsuspend", $reason); 50 LJ::statushistory_add($poster, $remote, "unsuspend", $reason) 51 unless $journal->equals($poster); 52 53 return $self->print("Entry " . $entry->url . " unsuspended."); 54 } 28 55 29 56 my @users; … … 72 99 $u->{statusvis} = 'V'; 73 100 74 my $remote = LJ::get_remote();75 101 LJ::statushistory_add($u, $remote, "unsuspend", $reason); 76 102 eval { $u->fb_push }; 77 103 warn "Error running fb_push: $@\n" if $@ && $LJ::IS_DEV_SERVER; 78 104 79 $self-> info("User '$username' unsuspended.");105 $self->print("User '$username' unsuspended."); 80 106 } 81 107 -
trunk/cgi-bin/LJ/Entry.pm
r13952 r14070 769 769 } 770 770 771 my $remote = LJ::get_remote(); 772 my $suspend_msg = $self->should_show_suspend_msg_to($remote) ? 1 : 0; 773 $opts->{suspend_msg} = $suspend_msg; 774 $opts->{unsuspend_supportid} = $suspend_msg ? $self->prop("unsuspend_supportid") : 0; 775 771 776 $self->_load_text unless $self->{_loaded_text}; 772 777 my $event = $self->{event}; … … 843 848 # can't see anything by suspended users 844 849 return 0 if $self->poster->{statusvis} eq 'S'; 850 851 # can't see suspended entries 852 return 0 if $self->is_suspended_for($remote); 845 853 } 846 854 … … 1162 1170 1163 1171 return ""; 1172 } 1173 1174 sub statusvis { 1175 my $self = shift; 1176 1177 return $self->prop("statusvis") eq "S" ? "S" : "V"; 1178 } 1179 1180 sub is_visible { 1181 my $self = shift; 1182 1183 return $self->statusvis eq "V" ? 1 : 0; 1184 } 1185 1186 sub is_suspended { 1187 my $self = shift; 1188 1189 return $self->statusvis eq "S" ? 1 : 0; 1190 } 1191 1192 # same as is_suspended, except that it returns 0 if the given user can see the suspended entry 1193 sub is_suspended_for { 1194 my $self = shift; 1195 my $u = shift; 1196 1197 return 0 unless $self->is_suspended; 1198 return 0 if LJ::check_priv($u, 'canview', 'suspended'); 1199 return 0 if LJ::isu($u) && $u->equals($self->poster); 1200 return 1; 1201 } 1202 1203 sub should_show_suspend_msg_to { 1204 my $self = shift; 1205 my $u = shift; 1206 1207 return $self->is_suspended && !$self->is_suspended_for($u) ? 1 : 0; 1164 1208 } 1165 1209 -
trunk/cgi-bin/LJ/S2/DayPage.pm
r13993 r14070 116 116 map { $item->{$_} } qw(posterid itemid security allowmask alldatepart anum); 117 117 118 my $ditemid = $itemid*256 + $anum; 119 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid); 120 118 121 my $replycount = $logprops{$itemid}->{'replycount'}; 119 122 my $subject = $logtext->{$itemid}->[0]; … … 125 128 } 126 129 127 # don't show posts from suspended users 130 # don't show posts from suspended users or suspended posts 128 131 next ENTRY if $apu{$posterid} && $apu{$posterid}->{'statusvis'} eq 'S' && ! $viewsome; 132 next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); 129 133 130 134 if ($LJ::UNICODE && $logprops{$itemid}->{'unknown8bit'}) { … … 134 138 LJ::CleanHTML::clean_subject(\$subject) if $subject; 135 139 136 my $ditemid = $itemid*256 + $anum; 137 140 my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to($remote) ? 1 : 0; 138 141 LJ::CleanHTML::clean_event(\$text, { 'preformatted' => $logprops{$itemid}->{'opt_preformatted'}, 139 142 'cuturl' => LJ::item_link($u, $itemid, $anum), 140 'ljcut_disable' => $remote->{'opt_ljcut_disable_lastn'}, }); 143 'ljcut_disable' => $remote->{'opt_ljcut_disable_lastn'}, 144 'suspend_msg' => $suspend_msg, 145 'unsuspend_supportid' => $suspend_msg ? $entry_obj->prop("unsuspend_supportid") : 0, }); 141 146 LJ::expand_embedded($u, $ditemid, $remote, \$text); 142 147 143 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid);144 148 $text = LJ::ContentFlag->transform_post(post => $text, journal => $u, 145 149 remote => $remote, entry => $entry_obj); -
trunk/cgi-bin/LJ/S2/EntryPage.pm
r13799 r14070 29 29 my ($entry, $s2entry) = EntryPage_entry($u, $remote, $opts); 30 30 return if $opts->{'suspendeduser'}; 31 return if $opts->{'suspendedentry'}; 31 32 return if $opts->{'handler_return'}; 32 33 return if $opts->{'redir'}; … … 414 415 } 415 416 417 if ($entry && $entry->is_suspended_for($remote)) { 418 $opts->{'suspendedentry'} = 1; 419 return; 420 } 421 416 422 my $replycount = $entry->prop("replycount"); 417 423 my $nc = ""; -
trunk/cgi-bin/LJ/S2/FriendsPage.pm
r13546 r14070 210 210 211 211 my $ditemid = $itemid * 256 + $item->{'anum'}; 212 my $entry_obj = LJ::Entry->new($friends{$friendid}, ditemid => $ditemid); 212 213 213 214 my $stylemine = ""; … … 215 216 $remote->{'userid'} != $friendid; 216 217 218 my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to($remote) ? 1 : 0; 217 219 LJ::CleanHTML::clean_event(\$text, { 'preformatted' => $logprops{$datakey}->{'opt_preformatted'}, 218 220 'cuturl' => LJ::item_link($friends{$friendid}, $itemid, $item->{'anum'}, $stylemine), 219 221 'maximgwidth' => $maximgwidth, 220 222 'maximgheight' => $maximgheight, 221 'ljcut_disable' => $remote->{'opt_ljcut_disable_friends'}, }); 223 'ljcut_disable' => $remote->{'opt_ljcut_disable_friends'}, 224 'suspend_msg' => $suspend_msg, 225 'unsuspend_supportid' => $suspend_msg ? $entry_obj->prop("unsuspend_supportid") : 0, }); 222 226 LJ::expand_embedded($friends{$friendid}, $ditemid, $remote, \$text); 223 227 224 my $entry_obj = LJ::Entry->new($friends{$friendid}, ditemid => $ditemid);225 228 $text = LJ::ContentFlag->transform_post(post => $text, journal => $friends{$friendid}, 226 229 remote => $remote, entry => $entry_obj); … … 232 235 my $po = $posters{$posterid} || $friends{$posterid}; 233 236 234 # don't allow posts from suspended users 235 if ($po->{'statusvis'} eq 'S' ) {237 # don't allow posts from suspended users or suspended posts 238 if ($po->{'statusvis'} eq 'S' || ($entry_obj && $entry_obj->is_suspended_for($remote))) { 236 239 $hiddenentries++; # Remember how many we've skipped for later 237 240 next ENTRY; -
trunk/cgi-bin/LJ/S2/MonthPage.pm
r13614 r14070 105 105 my $day = $item->{'day'}; 106 106 107 # don't show posts from suspended users 107 my $ditemid = $itemid*256 + $anum; 108 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid); 109 110 # don't show posts from suspended users or suspended posts 108 111 next unless $pu{$posterid}; 109 112 next ENTRY if $pu{$posterid}->{'statusvis'} eq 'S' && !$viewsome; 113 next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); 110 114 111 115 if ($LJ::UNICODE && $logprops{$itemid}->{'unknown8bit'}) { … … 120 124 } 121 125 122 my $ditemid = $itemid*256 + $anum;123 126 my $nc = ""; 124 127 $nc .= "nc=$replycount" if $replycount && $remote && $remote->{'opt_nctalklinks'}; -
trunk/cgi-bin/LJ/S2/RecentPage.pm
r13546 r14070 137 137 map { $item->{$_} } qw(posterid itemid security allowmask alldatepart); 138 138 139 my $ditemid = $itemid * 256 + $item->{'anum'}; 140 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid); 141 139 142 my $replycount = $logprops{$itemid}->{'replycount'}; 140 143 my $subject = $logtext->{$itemid}->[0]; … … 148 151 $itemnum++; 149 152 150 # don't show posts from suspended users unless the user doing the viewing says to (and is allowed)153 # don't show posts from suspended users or suspended posts unless the user doing the viewing says to (and is allowed) 151 154 next ENTRY if $apu{$posterid} && $apu{$posterid}->{'statusvis'} eq 'S' && !$viewsome; 155 next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); 152 156 153 157 if ($LJ::UNICODE && $logprops{$itemid}->{'unknown8bit'}) { … … 165 169 LJ::CleanHTML::clean_subject(\$subject) if $subject; 166 170 167 my $ ditemid = $itemid * 256 + $item->{'anum'};171 my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to($remote) ? 1 : 0; 168 172 LJ::CleanHTML::clean_event(\$text, { 'preformatted' => $logprops{$itemid}->{'opt_preformatted'}, 169 173 'cuturl' => LJ::item_link($u, $itemid, $item->{'anum'}), 170 'ljcut_disable' => $remote->{"opt_ljcut_disable_lastn"}, }); 174 'ljcut_disable' => $remote->{"opt_ljcut_disable_lastn"}, 175 'suspend_msg' => $suspend_msg, 176 'unsuspend_supportid' => $suspend_msg ? $entry_obj->prop("unsuspend_supportid") : 0, }); 171 177 LJ::expand_embedded($u, $ditemid, $remote, \$text); 172 178 173 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid);174 179 $text = LJ::ContentFlag->transform_post(post => $text, journal => $u, 175 180 remote => $remote, entry => $entry_obj); -
trunk/cgi-bin/LJ/S2/ReplyPage.pm
r13142 r14070 21 21 my ($entry, $s2entry) = EntryPage_entry($u, $remote, $opts); 22 22 return if $opts->{'suspendeduser'}; 23 24 # reply page of suspended entry cannot be accessed by anyone, even entry poster 25 if ($entry && $entry->is_suspended) { 26 $opts->{suspendedentry} = 1; 27 return; 28 } 29 23 30 return if $opts->{'handler_return'}; 24 31 return if $opts->{'redir'}; … … 111 118 $opts->{status} = "403 Forbidden"; 112 119 return "<p>This thread has been frozen; no more replies are allowed.</p>"; 120 } 121 if ($entry->is_suspended) { 122 $opts->{status} = "403 Forbidden"; 123 return "<p>This entry has been suspended; you cannot reply to it.</p>"; 113 124 } 114 125 -
trunk/cgi-bin/LJ/User.pm
r14041 r14070 7935 7935 return $error->("Journal has been deleted. If you are <b>$user</b>, you have a period of 30 days to decide to undelete your journal.", "404 Not Found") if ($u->is_deleted); 7936 7936 return $error->("This journal has been suspended.", "403 Forbidden") if ($u->is_suspended); 7937 7938 my $entry = $opts->{ljentry}; 7939 return $error->("This entry has been suspended. You can visit the journal <a href='" . $u->journal_base . "/'>here</a>.", "403 Forbidden") 7940 if $entry && $entry->is_suspended_for($remote); 7937 7941 } 7938 7942 return $error->("This journal has been deleted and purged.", "410 Gone") if ($u->is_expunged); -
trunk/cgi-bin/LJ/Vertical.pm
r13685 r14070 104 104 return 0 unless $entry->security eq "public"; 105 105 106 # poster and journalmust be visible106 # poster, journal, and entry must be visible 107 107 return 0 unless $poster->is_visible; 108 108 return 0 unless $journal->is_visible; 109 return 0 unless $entry->is_visible; 109 110 110 111 my $hook_rv = LJ::run_hook("entry_should_be_in_verticals", $entry); -
trunk/cgi-bin/cleanhtml.pl
r13722 r14070 135 135 (exists $opts->{'blocked_link_substitute'}) ? $opts->{'blocked_link_substitute'} : 136 136 ($LJ::BLOCKED_LINK_SUBSTITUTE) ? $LJ::BLOCKED_LINK_SUBSTITUTE : '#'; 137 137 my $suspend_msg = $opts->{'suspend_msg'} || 0; 138 my $unsuspend_supportid = $opts->{'unsuspend_supportid'} || 0; 139 138 140 my @canonical_urls; # extracted links 139 141 my %action = (); … … 1012 1014 $$data = $newdata; 1013 1015 $$data .= $extra_text if $extra_text; # invalid markup error 1016 1017 if ($suspend_msg) { 1018 my $msg = qq{<div style="color: #000; font: 12px Verdana, Arial, Sans-Serif; background-color: #ffeeee; background-repeat: repeat-x; border: 1px solid #ff9999; padding: 8px; margin: 5px auto; width: auto; text-align: left; background-image: url('$LJ::IMGPREFIX/message-error.gif');">}; 1019 1020 if ($unsuspend_supportid) { 1021 $msg .= LJ::Lang::ml('cleanhtml.suspend_msg_with_supportid', { aopts => "href='$LJ::SITEROOT/support/see_request.bml?id=$unsuspend_supportid'" }); 1022 } else { 1023 $msg .= LJ::Lang::ml('cleanhtml.suspend_msg', { aopts => "href='$LJ::SITEROOT/abuse/report.bml'" }); 1024 } 1025 1026 $msg .= "</div>"; 1027 1028 $$data = $msg . $$data; 1029 } 1014 1030 1015 1031 return 0; … … 1258 1274 my $wordlength = defined $opts->{'wordlength'} ? $opts->{'wordlength'} : 40; 1259 1275 1260 # fast path: no markup or URLs to linkify 1261 if ($$ref !~ /\<|\>|http/ && ! $opts->{preformatted} ) {1276 # fast path: no markup or URLs to linkify, and no suspend message needed 1277 if ($$ref !~ /\<|\>|http/ && ! $opts->{preformatted} && !$opts->{suspend_msg}) { 1262 1278 $$ref =~ s/\S{$wordlength,}/break_word($&,$wordlength)/eg if $wordlength; 1263 1279 $$ref =~ s/\r?\n/<br \/>/g; … … 1290 1306 'transform_embed_nocheck' => $opts->{'transform_embed_nocheck'} ? 1 : 0, 1291 1307 'transform_embed_wmode' => $opts->{'transform_embed_wmode'}, 1308 'suspend_msg' => $opts->{'suspend_msg'} ? 1 : 0, 1309 'unsuspend_supportid' => $opts->{'unsuspend_supportid'}, 1292 1310 }); 1293 1311 } -
trunk/cgi-bin/ljfeed.pl
r14037 r14070 172 172 my $itemid = $it->{'itemid'}; 173 173 my $ditemid = $itemid*256 + $it->{'anum'}; 174 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid); 174 175 175 176 next ENTRY if $posteru{$it->{'posterid'}} && $posteru{$it->{'posterid'}}->{'statusvis'} eq 'S'; 177 next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); 176 178 177 179 if ($LJ::UNICODE && $logprops{$itemid}->{'unknown8bit'}) { … … 262 264 }; 263 265 push @cleanitems, $cleanitem; 264 push @entries, LJ::Entry->new($u, ditemid => $ditemid);266 push @entries, $entry_obj; 265 267 } 266 268 -
trunk/cgi-bin/ljviews.pl
r13849 r14070 1262 1262 map { $item->{$_} } qw(posterid itemid security alldatepart); 1263 1263 1264 my $ditemid = $itemid * 256 + $item->{'anum'}; 1265 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid); 1266 1264 1267 my $pu = $posteru{$posterid}; 1265 1268 next ENTRY if $pu && $pu->{'statusvis'} eq 'S' && !$viewsome; 1269 next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); 1266 1270 1267 1271 my $replycount = $logprops{$itemid}->{'replycount'}; … … 1311 1315 } 1312 1316 1313 my $ditemid = $itemid * 256 + $item->{'anum'};1314 1317 my $itemargs = "journal=$user&itemid=$ditemid"; 1315 1318 $lastn_event{'itemargs'} = $itemargs; 1316 1319 1320 my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to($remote) ? 1 : 0; 1317 1321 LJ::CleanHTML::clean_event(\$event, { 'preformatted' => $logprops{$itemid}->{'opt_preformatted'}, 1318 1322 'cuturl' => LJ::item_link($u, $itemid, $item->{'anum'}), 1319 'ljcut_disable' => $remote->{'opt_ljcut_disable_lastn'}, }); 1323 'ljcut_disable' => $remote->{'opt_ljcut_disable_lastn'}, 1324 'suspend_msg' => $suspend_msg, 1325 'unsuspend_supportid' => $suspend_msg ? $entry_obj->prop("unsuspend_supportid") : 0, }); 1320 1326 LJ::expand_embedded($u, $ditemid, $remote, \$event); 1321 1327 1322 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid);1323 1328 $event = LJ::ContentFlag->transform_post(post => $event, journal => $u, 1324 1329 remote => $remote, entry => $entry_obj); … … 1723 1728 map { $item->{$_} } qw(ownerid posterid itemid security alldatepart); 1724 1729 1730 my $ditemid = $itemid * 256 + $item->{'anum'}; 1731 my $entry_obj = LJ::Entry->new($friends{$friendid}, ditemid => $ditemid); 1732 1725 1733 my $pu = $friends{$posterid} || $aposter{$posterid}; 1726 1734 next ENTRY if $pu && $pu->{'statusvis'} eq 'S'; 1735 next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); 1727 1736 1728 1737 # counting excludes skipped entries … … 1781 1790 } 1782 1791 1783 my $ditemid = $itemid * 256 + $item->{'anum'};1784 1792 my $itemargs = "journal=$friend&itemid=$ditemid"; 1785 1793 $friends_event{'itemargs'} = $itemargs; … … 1789 1797 $remote->{'userid'} != $friendid; 1790 1798 1799 my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to($remote) ? 1 : 0; 1791 1800 LJ::CleanHTML::clean_event(\$event, { 'preformatted' => $logprops{$datakey}->{'opt_preformatted'}, 1792 1801 'cuturl' => LJ::item_link($friends{$friendid}, $itemid, $item->{'anum'}, $stylemine), 1793 1802 'maximgwidth' => $maximgwidth, 1794 1803 'maximgheight' => $maximgheight, 1795 'ljcut_disable' => $remote->{'opt_ljcut_disable_friends'}, }); 1804 'ljcut_disable' => $remote->{'opt_ljcut_disable_friends'}, 1805 'suspend_msg' => $suspend_msg, 1806 'unsuspend_supportid' => $suspend_msg ? $entry_obj->prop("unsuspend_supportid") : 0, }); 1796 1807 LJ::expand_embedded($friends{$friendid}, $ditemid, $remote, \$event); 1797 1808 1798 my $entry_obj = LJ::Entry->new($friends{$friendid}, ditemid => $ditemid);1799 1809 $event = LJ::ContentFlag->transform_post(post => $event, journal => $friends{$friendid}, 1800 1810 remote => $remote, entry => $entry_obj); … … 2469 2479 map { $item->{$_} } qw(itemid posterid security alldatepart anum); 2470 2480 2481 my $ditemid = $itemid*256 + $anum; 2482 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid); 2483 2471 2484 next ENTRY if $posteru{$posterid} && $posteru{$posterid}->{'statusvis'} eq 'S' && !$viewsome; 2485 next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); 2472 2486 2473 2487 my $replycount = $logprops{$itemid}->{'replycount'}; … … 2497 2511 } 2498 2512 2499 my $ditemid = $itemid*256 + $anum;2500 2513 my $itemargs = "journal=$user&itemid=$ditemid"; 2501 2514 $day_event{'itemargs'} = $itemargs; 2502 2515 2516 my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to($remote) ? 1 : 0; 2503 2517 LJ::CleanHTML::clean_event(\$event, { 'preformatted' => $logprops{$itemid}->{'opt_preformatted'}, 2504 2518 'cuturl' => LJ::item_link($u, $itemid, $anum), 2505 'ljcut_disable' => $remote->{'opt_ljcut_disable_lastn'}, }); 2519 'ljcut_disable' => $remote->{'opt_ljcut_disable_lastn'}, 2520 'suspend_msg' => $suspend_msg, 2521 'unsuspend_supportid' => $suspend_msg ? $entry_obj->prop("unsuspend_supportid") : 0, }); 2506 2522 LJ::expand_embedded($u, $ditemid, $remote, \$event); 2507 2523 2508 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid);2509 2524 $event = LJ::ContentFlag->transform_post(post => $event, journal => $u, 2510 2525 remote => $remote, entry => $entry_obj); -
trunk/cgi-bin/supportlib.pl
r13671 r14070 534 534 535 535 $dbh->do("LOCK TABLES support WRITE, duplock WRITE"); 536 $sth = $dbh->prepare("SELECT dupid FROM duplock WHERE realm='support' AND reid=0 AND userid=$qrequserid AND digest='$md5'"); 537 $sth->execute; 538 ($dup_id) = $sth->fetchrow_array; 539 if ($dup_id) { 540 $dbh->do("UNLOCK TABLES"); 541 return $dup_id; 536 537 unless ($o->{ignore_dup_check}) { 538 $sth = $dbh->prepare("SELECT dupid FROM duplock WHERE realm='support' AND reid=0 AND userid=$qrequserid AND digest='$md5'"); 539 $sth->execute; 540 ($dup_id) = $sth->fetchrow_array; 541 if ($dup_id) { 542 $dbh->do("UNLOCK TABLES"); 543 return $dup_id; 544 } 542 545 } 543 546 … … 556 559 $spid = $dbh->{'mysql_insertid'}; 557 560 558 $dbh->do("INSERT INTO duplock (realm, reid, userid, digest, dupid, instime) VALUES ('support', 0, $qrequserid, '$md5', $spid, NOW())"); 561 $dbh->do("INSERT INTO duplock (realm, reid, userid, digest, dupid, instime) VALUES ('support', 0, $qrequserid, '$md5', $spid, NOW())") 562 unless $o->{ignore_dup_check}; 559 563 $dbh->do("UNLOCK TABLES"); 560 564 -
trunk/cgi-bin/weblib.pl
r14040 r14070 1641 1641 { 'onclick' => $onclick, 'disabled' => $opts->{'disabled_save'}, 1642 1642 'tabindex' => $tabindex->() }) . " \n"; 1643 1644 if ($opts->{suspended} && !$opts->{unsuspend_supportid}) { 1645 $out .= LJ::html_submit('action:saveunsuspend', BML::ml('entryform.saveandrequestunsuspend'), 1646 { 'onclick' => $onclick, 'disabled' => $opts->{'disabled_save'}, 1647 'tabindex' => $tabindex->() }) . " \n"; 1648 } 1649 1643 1650 $out .= LJ::html_submit('action:delete', BML::ml('entryform.delete'), { 1644 1651 'disabled' => $opts->{'disabled_delete'}, -
trunk/htdocs/editjournal.bml
r14038 r14070 133 133 my $anum = $ditemid % 256; 134 134 my $itemid = $ditemid >> 8; 135 my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid); 135 136 136 137 # do getevents request … … 182 183 183 184 # they clicked the save or delete button 184 if (!$spellcheck_html && ($POST{'action:save'} || $POST{'action: delete'} || $POST{'action:deletespam'})) {185 if (!$spellcheck_html && ($POST{'action:save'} || $POST{'action:saveunsuspend'} || $POST{'action:delete'} || $POST{'action:deletespam'})) { 185 186 return LJ::bad_input($ML{'error.invalidform'}) unless LJ::check_form_auth(); 186 187 … … 233 234 } else { 234 235 $result .= "<?p $ML{'.success.edited'} p?>"; 236 237 # open a request about the unsuspension if one doesn't already exist 238 if ($POST{'action:saveunsuspend'} && !$entry_obj->prop("unsuspend_supportid") && $LJ::UNSUSPENSION_REQUEST_SPCATID) { 239 my %req; 240 $req{reqtype} = "user"; 241 $req{requserid} = $remote->id; 242 $req{uniq} = LJ::UniqCookie->current_uniq; 243 $req{spcatid} = $LJ::UNSUSPENSION_REQUEST_SPCATID; 244 $req{ignore_dup_check} = 1; # can't have dup checking in case a particular entry gets re-suspended after unsuspension 245 $req{subject} = "Unsuspension Request from " . $remote->user; 246 $req{body} = "The suspended entry at " . $entry_obj->url . " has been edited and the poster requests unsuspension."; 247 248 my @errors; 249 my $spid = LJ::Support::file_request(\@errors, \%req); 250 251 if ($spid) { 252 $entry_obj->set_prop( unsuspend_supportid => $spid ); 253 my $url = "$LJ::SITEROOT/support/see_request.bml?id=$spid"; 254 $result .= "<?p " . BML::ml('.success.editedunsuspend', { url => "<a href='$url'>$url</a>" }) . " p?>"; 255 } 256 } 235 257 } 236 258 … … 297 319 $event = LJ::eurl($event); 298 320 321 my $suspend_msg = $entry_obj && $entry_obj->should_show_suspend_msg_to($remote) ? 1 : 0; 299 322 my $entry = { 300 323 'mode' => "edit", … … 314 337 'disabled_delete' => $disabled_delete, 315 338 'disabled_spamdelete' => $disabled_spamdelete, 339 'suspended' => $suspend_msg, 340 'unsuspend_supportid' => $suspend_msg ? $entry_obj->prop("unsuspend_supportid") : 0, 316 341 }; 317 342 for (my $i = 1; $i <= $res{'prop_count'}; $i++) { -
trunk/htdocs/editjournal.bml.text
r13999 r14070 20 20 .success.edited=Journal entry was edited. 21 21 22 .success.editedunsuspend=Additionally, an unsuspension request has been opened at [[url]], and your entry will be reviewed soon. 23 22 24 .success.fromhere=From here you can: 23 25 -
trunk/htdocs/talkpost.bml
r13621 r14070 152 152 } 153 153 154 # check suspended 154 # check suspended user 155 155 return "<?h1 $ML{'talk.error.suspended.title'} h1?><?p $ML{'talk.error.suspended'} p?>" 156 156 if $u->is_suspended || $up->is_suspended || … … 160 160 return "<?h1 $ML{'talk.error.deleted.title'} h1?><?p $ML{'talk.error.deleted'} p?>" 161 161 if ($u->is_deleted); 162 163 # check suspended entry 164 # reply page of suspended entry cannot be accessed by anyone, even entry poster 165 return "<?h1 $ML{'talk.error.suspended.title'} h1?><?p " . BML::ml('talk.error.suspendedentryreply', { aopts => "href='" . $u->journal_base . "/'" }) . " p?>" 166 if $entry && $entry->is_suspended; 162 167 163 168 # checked screened post … … 184 189 my $preformatted = $FORM{'replyto'} eq "" ? $props->{'opt_preformatted'} : $parpost->{'opt_preformatted'}; 185 190 186 LJ::CleanHTML::clean_event(\$event, $preformatted); 191 my $suspend_msg = $entry && $entry->should_show_suspend_msg_to($remote) ? 1 : 0; 192 LJ::CleanHTML::clean_event(\$event, { 'preformatted' => $preformatted, 193 'suspend_msg' => $suspend_msg, 194 'unsuspend_supportid' => $suspend_msg ? $entry->prop("unsuspend_supportid") : 0, }); 187 195 LJ::expand_embedded($u, $ditemid, $remote, \$event); 188 196 BML::ebml(\$event); -
trunk/htdocs/talkpost.bml.text
r12954 r14070 17 17 18 18 .error.noreply_screened=This comment is screened and you have no permissions to see it or reply to it. 19 20 .error.noreply_suspended=This entry is suspended. You cannot reply to it. 19 21 20 22 .label.picturetouse2=<a [[aopts]]>Picture</a> to use: -
trunk/htdocs/talkpost_do.bml
r12974 r14070 193 193 if $parent->{state} eq 'F'; 194 194 195 # no replying to suspended entries, even by entry poster 196 my $entry = LJ::Entry->new($journalu, jitemid => $item->{jitemid}); 197 return LJ::bad_input($ML{'/talkpost.bml.error.noreply_suspended'}) 198 if $entry && $entry->is_suspended; 199 195 200 ## insertion or editing 196 201 my $wasscreened = ($parent->{state} eq 'S'); -
trunk/htdocs/talkread.bml
r14032 r14070 150 150 # check for deleted/suspended/security 151 151 unless ($viewsome) { 152 # check suspended 152 # check suspended user 153 153 return "<?h1 $ML{'talk.error.suspended.title'} h1?><?p $ML{'talk.error.suspended'} p?>" 154 154 if ($u->is_suspended || $up->is_suspended); … … 157 157 return "<?h1 $ML{'talk.error.deleted.title'} h1?><?p $ML{'talk.error.deleted'} p?>" 158 158 if ($u->is_deleted); 159 160 # check suspended entry 161 return "<?h1 $ML{'talk.error.suspended.title'} h1?><?p " . BML::ml('talk.error.suspendedentry', { aopts => "href='" . $u->journal_base . "/'" }) . " p?>" 162 if $entry && $entry->is_suspended_for($remote); 159 163 } 160 164 … … 211 215 my $event = $item->{'event'}; 212 216 213 LJ::CleanHTML::clean_event(\$event, $props->{'opt_preformatted'}); 217 my $suspend_msg = $entry && $entry->should_show_suspend_msg_to($remote) ? 1 : 0; 218 LJ::CleanHTML::clean_event(\$event, { 'preformatted' => $props->{'opt_preformatted'}, 219 'suspend_msg' => $suspend_msg, 220 'unsuspend_supportid' => $suspend_msg ? $entry->prop("unsuspend_supportid") : 0, }); 214 221 LJ::expand_embedded($u, $ditemid, $remote, \$event); 215 222 BML::ebml(\$event); -
trunk/htdocs/view/index.bml
r13621 r14070 172 172 { 173 173 my ($itemid, $anum, $day, $eventtime, $posterid, $replycount, $security, $allowmask) = @$it; 174 175 my $entry = LJ::Entry->new($u, jitemid => $itemid); 174 176 next if $u{$posterid}->is_suspended && !$viewsome; 177 next if $entry && $entry->is_suspended_for($remote); 175 178 176 179 my $subject = $lt->{$itemid}->[0];
