Registration access without full 'member moderation'.

Started by smokester, November 07, 2009, 09:37:31 AM

Previous topic - Next topic

Arantor

Well, I'll build a package with these edits in, and try it myself on a fresh 2.0 RC1.2 (though it might work on 2.0 RC2 too) but I have some other stuff to do first.

smokester

Quote from: Arantor on November 14, 2009, 10:31:30 AM
Well, I'll build a package with these edits in, and try it myself on a fresh 2.0 RC1.2 (though it might work on 2.0 RC2 too) but I have some other stuff to do first.

Thank you Arantor, you are incredibly generous with your time and talent.

smokester

I wonder Arantor if you ever sussed the edits needed to make this work? as I realise that fully testing it and building a mod package would be work you may not have time for.

If you have any ideas I am more than willing to test them out on one of the many instances of 2.0 RC1.2 I have installed locally purely for testing purposes - and I will also install RC2 to further stress test them.

I know you're busy and maybe still under the weather, but if you do get a spare mo I will be very grateful.

Arantor

I haven't actually had chance to fix this up, other stuff came up in priority.

I'll look at this one next though.

Arantor

#24
Meh, I figured out what it was - something unexpected.

There's also an edit to Display.template.php to be made.

Attached is a packaged mod (which I'm about to throw over to the mod site) which covers 2.0 RC1.2 and 2.0 RC2, for all 4 themes bundled between the two (Curve, Core, Babylon and Classic)

Code (find) Select
if ($context['can_moderate_forum'] && !empty($message['member']['ip']))

Code (replace) Select
if ($context['can_moderate_forum'] && !empty($message['member']['ip']) && $message['can_see_ip'])


http://custom.simplemachines.org/mods/index.php?mod=2286 when it's approved.

smokester

Thanks Arantor.  I installed it and tested the various different options and it does seem to work well in the posts but unfortunately it still displays the IPs in the "who's online" view?  I have tried it a couple of times and checked the edits and it does seem to be a consistent quirk, but I'll try again to make sure.

Hope you are feeling better BTW, as if I said I felt ill last week, I positively feel like I'm on death's doorstep this week..

Arantor

#26
Argh, I forgot who's online! The edits never touch Who.php so no reason to assume it would work.

Yeah, feeling better thanks, just realised that was kind of stupid to forget that one. I will fix up the mod at the earliest opportunity.

EDIT: Fixed. One line change should be enough. Revised version attached.

smokester

I have messed around a little more and discovered that if you enable if for a membergroup with fairly basic privilages, it does not show IPs in posts or the who's online view, but it does display the IP of a member if you view their profile.  This is superfluous for me as I am essentially trying to turn the IP view off and not on, but they do seem to be further quirks for you to look at to perfect the mod.

Sorry for being a pain but I am only trying to help you understand.

Man I'm ill!!!  I need some of that sea breeze to clear my head.

Arantor

I'm not sure I follow. You can only see it in the profile if you have view_own (for your own profile) or view_any for any profile. This is actually cutting down what moderate_forum grants.

If a member does not have that permission, they can't see it, simple as that.

smokester

I originally tested it for a site moderator membergroup that naturally had "moderate forum members" turned on, and enabling and disabling your new mod allowed the moderator to see ips (or not) in a post next to the "report to moderator" option which is normal and your mod worked fine in hiding the ip in posts (and a member's profile) but not in the "who's online" as I have mentioned.

I then enabled it on a membergroup that was akin the a regular member that of course wouldn't have the "moderate forum members" permission, but the ip could not be seen in posts or the who's online view and could only be seen if a member's profile was viewed, then the ip was displayed or not depending on whether your new permission was set.  Is that what you intended?

Arantor

The view IP permission is literally what it says it is. It separates the ability to view IPs away from anything else (almost)

If a user has view_ip_address_own, they can see their own IP address in all the places a moderator would be able to - profile, who's online, modlog, and thread view. Irrespective of anything else, they'd be able to see it.

If a user has view_ip_address_any, they can see anyone's IP address in all the places a moderator would be able to - profile, who's online, modlog and thread view. Doesn't matter who it is either, if they can see any IPs, that's ANY IPs, including admin.

The only time any other permission is invoked in on the thread view, whether a user has moderate_forum or not. If they have view_any + moderate_forum, the link points to the IP tracking area, otherwise it points to help on why it's been logged.

You might want to check the permissions of users because it sounds like users have more permissions than they should, or you have multiple groups crossing over.

smokester

My apologies.  I quickly set it up on a fresh install and apart from the "who's online" view it does indeed work how it should.  I'm not sure what happened with the previous installation I tried it with as it is using a backup DB of my main forum, so I'll have to dig around to see what may have caused that quirk as of course I ultimately need this on my main board.  My DB is a year old and has been through the mill during the various upgrades - I just hope this isn't going to be a big problem for me after all your work.

Thanks

smokester

I wondered Arantor, if you ever pinpointed the edits needed in the who.php file for this to be complete?  I appreciate you probably have other things to attend to and I am not pushing, but I would be grateful if you found time for this at some point.

Thanks


Arantor


smokester


Arantor

The edit to Who.php should be, for the record.

Code (find) Select
'ip' => allowedTo('moderate_forum') ? $row['ip'] : '',

Code (replace) Select
'ip' => (allowedTo('view_ip_address_any') || ($row['member'] == $context['user']['id'] && allowedTo('view_ip_address_own'))) ? $row['ip'] : '',

smokester

That's got me all sorted out now and it works perfectly.

Much appreciated.

Arantor

Good to know it's all sorted; the official mod is just waiting on approval now.

smokester

Damn! I have just discovered another problem.  It seems that there is still a way for moderators to see IPs when the "moderate forum members" is on but your new mod has "View all ips" turned off - and that is from the "view all members" section in their admin.  This unfortunately shows all the members' IPs in a column including the admin's?

I did double check this in that clean install so as to be sure it wasn't a conflicting setting somewhere or anything rogue from my old database, and it was the same with IPs showing in the "view all members" section.

Any thoughts?

Arantor


Advertisement: