Quick moderation
Poll

What type of quick moderation do you use most?

What's quick moderation?
2 (8.7%)
Quick moderation as icons
2 (8.7%)
Quick moderation as checkboxes
19 (82.6%)
Total Members Voted: 20

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Quick moderation
« Reply #15, on February 12th, 2012, 06:34 PM »
Yes, it did run those extra queries, even if the action is markread, because even as one of the comments notes:

Code: [Select]
// !!! Maybe just do this on the actions people want to use?

I haven't gotten into rewriting quick moderation yet, since it clearly needs a rewrite (given that it sets up for people doing multiple actions at once but there is no interface I can see for doing this)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Quick moderation
« Reply #16, on February 12th, 2012, 06:41 PM »
Ah yes. I started a rewrite using classes but you said it wasn't the right approach IIRC.... after I get back I can upload it in the private area for you to look at if you'd like.
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Quick moderation
« Reply #17, on February 12th, 2012, 06:43 PM »
Well, I'm not sure what the right approach is, I just think that using classes isn't quite the way to go for that particular operation. (Given how little of Wedge uses classes elsewhere, that is.)

But certainly it needs some kind of kick up the backside.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Quick moderation
« Reply #18, on February 13th, 2012, 10:50 AM »
Re: latest revs -- haven't checked thoroughly, but are you sure $context['open_mod_reports'] is always available, Pete...? It's going to be accessed even when not logged in, etc, as far as I'm aware...? And it seems to be set only in ModerationCenter.php and Security.php...?

Other than that -- great to see you tackled this, thank you :)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Quick moderation
« Reply #19, on February 13th, 2012, 11:00 AM »
Yes it is. banPermissions() in Security.php currently sets it up regardless of the user.

But yeah, it was something that I figured might as well be done :)

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Quick moderation
« Reply #20, on February 13th, 2012, 11:34 AM »
Perfect then, thank you :)
Re: Quick moderation
« Reply #21, on March 21st, 2012, 02:16 PM »
Bump for this... As said before, $context['open_mod_reports'] isn't always set. I'm going to commit some of my changes, and this includes a test for emptiness for this, but please fix it another way if you can ;) (and if you can make it faster, obviously... Not that an empty() test is anywhere slow.)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Quick moderation
« Reply #22, on March 21st, 2012, 02:19 PM »
I did notice that but I have no idea why that should be. banPermissions() deals with that.

*penny drops*

Googlebot you say? That makes sense. is_not_banned() won't be called when BB is tripped, because it's just dealt with before even getting that far. empty() is sadly the best way here because for BB trips, there's no point in setting stuff like the mod cache up.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Quick moderation
« Reply #23, on March 21st, 2012, 02:38 PM »
Holy cow. I think your Member Options rewrite is buggy.
I just realized that the bug I was complaining about in Quick Reply was probably triggered by the fact that I'd just changed the default value for newest PMs... It seems that it reset *all* of the items to "No"!

As for Googlebot, then the problem would be fixed, right? I'll try to disable the thing.
However, we still need to get rid of the no_board errors. There are still tons of them. Just got 4 pages worth of pages from a bad bot called ZoomInfo (nextgensearchbot or something). In just a few minutes... And I think it'll plague the error log for a while.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Quick moderation
« Reply #24, on March 21st, 2012, 02:44 PM »
Quote
I just realized that the bug I was complaining about in Quick Reply was probably triggered by the fact that I'd just changed the default value for newest PMs... It seems that it reset *all* of the items to "No"!
Yes, it sounds like it.
Quote
As for Googlebot, then the problem would be fixed, right? I'll try to disable the thing.
Yes and no. It won't be Googlebot that causes it. It will still be tripped on any case that trips any of BB's settings if they're not admins.
Quote
Just got 4 pages worth of pages from a bad bot called ZoomInfo (nextgensearchbot or something)
That doesn't surprise me. I cleared out several pages last night of intrusion reports from them, and have reported the fact that their crawler is buggy to them.


So, to recap, open_mod_reports will require an empty() check on it before use because the way BB is set up, that won't be set up. Or, in the BB execution path in Security.php, set it to 0 there. (Come to think of it, $board and $board_info should be minimally initialised in that same branch, which should prevent the no_board issue, though they'll still trip BB's rules anyway. All that needs to be done is setting up $board and $board_info like they are in Load.php's loadBoard(), as if $_GET['board'], $_GET['topic'] and $_GET['action'] are all empty.)

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Quick moderation
« Reply #25, on March 21st, 2012, 02:58 PM »
Quote from Arantor on March 21st, 2012, 02:44 PM
Quote
I just realized that the bug I was complaining about in Quick Reply was probably triggered by the fact that I'd just changed the default value for newest PMs... It seems that it reset *all* of the items to "No"!
Yes, it sounds like it.
And it did it again...

I did some tests, and here's what I found: the only way to ensure a value isn't overwritten, is to simply click 'Change' next to it. Then it will show the select boxes... Which I don't touch, of course. This seems to be enough to guarantee that the value won't be reset by changing another option.
Quote
That doesn't surprise me. I cleared out several pages last night of intrusion reports from them, and have reported the fact that their crawler is buggy to them.
From what I could see online, they're not spammers but more likely they're in it for money and don't give a shit what their crawler does. So, basically -- everyone's screwed...
Quote
So, to recap, open_mod_reports will require an empty() check on it before use because the way BB is set up, that won't be set up. Or, in the BB execution path in Security.php, set it to 0 there.
Seems to me like the better solution.
Quote
(Come to think of it, $board and $board_info should be minimally initialised in that same branch, which should prevent the no_board issue, though they'll still trip BB's rules anyway. All that needs to be done is setting up $board and $board_info like they are in Load.php's loadBoard(), as if $_GET['board'], $_GET['topic'] and $_GET['action'] are all empty.)
'kay, I'll look into that... (Well, technically it'd be best if you did it. I'm going to commit before that anyway.)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Quick moderation
« Reply #26, on March 21st, 2012, 03:08 PM »
Quote
I did some tests, and here's what I found: the only way to ensure a value isn't overwritten, is to simply click 'Change' next to it. Then it will show the select boxes... Which I don't touch, of course. This seems to be enough to guarantee that the value won't be reset by changing another option.
Shit, that means the code's broken, it's not supposed to change anything unless it's reset in $_POST.
Quote
From what I could see online, they're not spammers but more likely they're in it for money and don't give a shit what their crawler does. So, basically -- everyone's screwed...
Well, if they don't fix it, it's going to be kicked back by BB. If we don't like what it does, we can block it entirely if we so choose ;)
Quote
'kay, I'll look into that... (Well, technically it'd be best if you did it. I'm going to commit before that anyway.)
Up to you. I'm busy with yet more packing. Every time I think I'm packed, I find more stuff to go through. >_>

What I will say is that fixing BB's codepath should be the better solution for the open-mod-reports case and it will be necessary to fix that path for the no_board stuff anyway.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Quick moderation
« Reply #27, on March 21st, 2012, 03:27 PM »
Quote from Arantor on March 21st, 2012, 03:08 PM
Shit, that means the code's broken, it's not supposed to change anything unless it's reset in $_POST.
It's just a bit too bad that it happened here... :^^;:
I'm considering taking the old list from the old Wedge.org and simply copying the data again.
Quote
Well, if they don't fix it, it's going to be kicked back by BB. If we don't like what it does, we can block it entirely if we so choose ;)
It's still a waste of CPU cycles...
I'd tend to ban these IPs before it even reaches index.php :P
Quote
Up to you. I'm busy with yet more packing. Every time I think I'm packed, I find more stuff to go through. >_>
When are you planning to leave?
Quote
What I will say is that fixing BB's codepath should be the better solution for the open-mod-reports case and it will be necessary to fix that path for the no_board stuff anyway.
Yep.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Quick moderation
« Reply #28, on March 21st, 2012, 03:43 PM »
Quote
I'm considering taking the old list from the old Wedge.org and simply copying the data again.
Fair call. Just remember that I changed the semantics very slightly in how they work. Theme id should be 1, then as per my comment:
Code: [Select]
// In the themes table, id_member = -1 is guest/new user option, 0 = theme option, any other = user id it applies to

There are times it wouldn't necessarily be like that, especially if there were other themes involved. But it's always those values and always theme id 1 now. (0 is for the cases where it is a theme option as indicated by Current Theme)
Quote
I'd tend to ban these IPs before it even reaches index.php
Go on then, the IPs are pretty consistent. Failing that, do it based on the contents of HTTP_USER_AGENT in the .htaccess file ;)
Quote
When are you planning to leave?
Saturday morning for the move.