latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

fix for multisite subsite-admin user edit

Home Forums Community Forum fix for multisite subsite-admin user edit

This topic contains 2 replies, has 2 voices. Last updated by  Sven Lohuis 4 years, 6 months ago.

Topic Author Topic
Posted: Wednesday Jul 11th, 2012 at 6:58 am #18907
Sven Lohuis
Username: mortydot

Again a new topic.
Those auto close function is quit anoying…

This is the original topic: http://www.s2member.com/forums/topic/diferences-between-multisite-and-free-version/
This the follow up: http://www.s2member.com/forums/topic/continuing-closed-topic/

The bugg is still there as descriped in the first topic.
I have made a small fix but it is not clean/compleetly secure.
This works when creating a new plugin file in the plugin folder.
Site admins are now able to edit there own subsite users.

One importand bug (missing feature) remains:
The script does NOT check if the edited-user is a member of the subsite!
This meens that you can edit the superadmin when you are a subadmin user…
Anyone knowing how to check if edited user is member of subsite, please let me know!

———————————————————————————————————-

/*
Plugin Name: Subsite admin user edit abillitty
Plugin URI: http://www.mortydot.nl
Description: Makes it for subsite admins possible to edit there own members
Version: 1.0
Author: MortyDot
License: GPL2
*/

function mc_admin_users_caps( $caps, $cap, $user_id, $args ){
	foreach( $caps as $key => $capability ){

		if( $capability != 'do_not_allow' )
			continue;

		switch( $cap ) {
			case 'edit_user':
			case 'edit_users':
				$caps[$key] = 'edit_users';
				break;
			case 'delete_user':
			case 'delete_users':
				$caps[$key] = 'delete_users';
				break;
			case 'create_users':
				$caps[$key] = $cap;
				break;
		}		
	}

	return $caps;
}

add_filter( 'map_meta_cap', 'mc_admin_users_caps', 10, 4 );
add_filter( 'enable_edit_any_user_configuration', '__return_true');
?>
  • This topic was modified 4 years, 6 months ago by  Raam Dev. Reason: Moved to Community Forum (not Pre-sale question)
  • This topic was modified 3 years, 4 months ago by  Sven Lohuis.

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Thursday Jul 12th, 2012 at 2:15 am #18989
Raam Dev
Username: Raam
Staff Member
Technical support question, not Pre-Sale (wrong forum).

Moving this thread into Community Forum so you have a chance to receive assistance from other site owners. If you’d like priority support from s2Member®, please re-post this topic in our Customer Support Forum and we’ll take a closer look for you.

For further details, please read our Support Policy.

Posted: Thursday Jul 12th, 2012 at 3:41 am #19001
Sven Lohuis
Username: mortydot

Hi @raam,

This post is a result of a still open support ticket.
But thank you for moving.

Kinds regards,
Looking forward to a support replay

Viewing 2 replies - 1 through 2 (of 2 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.