Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Hiding Admin User Profile from Forums Admins Member List
Avatar
Angela Bowman
Boulder, Colorado
Member
Free Members
sp_UserOfflineSmall Offline
Sep 25, 2012 - 11:43 am

I'm the administrator for a site that has Simple:Press. However, I don't want my profile to display on the Members page. I tried to delete my name from the forum member list and it totally screwed up my site -- it didn't delete the WordPress user, thank goodness, but it did trash ALL of my posts, pages, uploaded images, custom post types (not recoverable) -- pretty much everything. So, this is a harsh bug to deal with. You shouldn't allow one-click, no warning deletion of a forum member and have that effect EVERYTHING that admin has done on the site as if the WP user were being deleted. At least WordPress will ASSIGN all of the posts, etc., to a different user rather than mess up the ENTIRE database. Not good.

Avatar
Angela Bowman
Boulder, Colorado
Member
Free Members
sp_UserOfflineSmall Offline
Sep 25, 2012 - 11:57 am

I should add that I'm not talking about SimplePress deleting forum posts, but that SimplePress deleted ALL WordPress posts, pages, images, custom posts, etc. Everything that user created in WordPress (not in SimplePress), it deleted and/or trashed in the database without warning. The WordPress user still existed, but SimplePress deleted all of the content in WordPress associated with the user.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 25, 2012 - 12:02 pm

Well the first thing to say is that the SP user IS exactly the same thing as the WP user - SP is a WP plugin - and we do not actually delete anything to do with forum posts.

So perhaps you can tell me exactly what you did and where...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Angela Bowman
Boulder, Colorado
Member
Free Members
sp_UserOfflineSmall Offline
Sep 25, 2012 - 1:09 pm

Then, I think you have a bug in your plugin. I'm a WordPress developer, so not a novice user. I went to Forums > Users. A list of users for the forums displays. I clicked the trashcan to the right of my user, and this action IMMEDIATELY put into the trash ALL WordPress posts and WordPress pages and deleted from the wp-content folder and database all images I had uploaded to any WordPress pages and posts. So, I think Simple:Press has some issues with how it is handling User IDs and is causing a big database purge when an admin user is deleted from the Forums > Users interface. The user was NOT deleted under the WordPress users interface. I restored the Trashed posts and pages but could not restore the images removed from the Media Library. users-1.pngImage Enlarger

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 25, 2012 - 3:32 pm

I think if we are at fault anywhere here it is allowing you to delete yourself - assuming you were logged in as that user at the time. And that is something we can and will correct by removing the delete button for that entry.

This is, after all, first and foremost an administrative tool intended for the forum administrator to remove members.

The button makes a call to the wp_delete_user() function. Again, assuming you were logged in as that user at the time, then I am truly amazed that WordPress will actually go ahead and delete the current user of the system without performing any checks but I can see by the code that it does indeed do so. And I am sorry that I was unaware of that although this is the first time anyone has done this in the 6 years SP has been available.

I have no idea why your wp user record should still exist however as this WP routine clearly removes it. Unless WishList has some mechanism for restoring it - which I doubt - then that I can not explain as the code should have deleted that as well.

There is no evidence from the WP code that images are removed although it might be buried deeper in some sub-function I have not yet looked at. I suspect the attachments records were removed which is just another good reason for disliking the way the WP team implemented them.

I am truly sorry this has happened to you but I wouldn't call this a bug. It did what it says it will do - delete the user and as I said before there is no distinction between a WP user and an SP user - which is rather the point of it being a WP plugin.

As I said above - we will ensure that user can not delete themselves now that we are aware that WP allows you to do it.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 25, 2012 - 8:20 pm

quite odd... we used to redirect to the wp admin panel that let you reassign any wp posts/pages too...  so will have to investigate why that stopped working...   wp change?

and agree, there should definitely be a confirmation there...

Avatar
Angela Bowman
Boulder, Colorado
Member
Free Members
sp_UserOfflineSmall Offline
Sep 26, 2012 - 10:58 am

Hi, yes, I was logged in as the user I was trying to remove from the forums. So, here are the issues/questions:

1 - I would like to continue to be an "admin" in WordPress in order to do plugin and WP updates and add content to the WP posts and pages. However, I simply do NOT want my profile to show up in the Members area. My role with my client is to maintain the WordPress site. They do not want the forum participants to see my picture and profile on the Members list. So, do you have any ability to allow people to be administrators in WordPress and NOT have their profile show on the Members page? I will be setting up Simple:Press on several other sites for CLIENTS, not for myself personally, so it seems that there should be a way of "hiding" an purely admin person from the Members list.

2 - yes, the issue with Simple:Press seems to be that there is no indication that removing someone from the forum list will also delete all of their WordPress content. From the SP interface, it simply seems that you are trying to remove them as a member of the forums (not their user ID in WordPress). And there is no warning about the dire consequences of doing so.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 26, 2012 - 12:58 pm

Open up the SP theme file spFunctions.php which you will find in the themes /templates folder. Then add the following code:

add_filter('sph_members_list_query', 'hide_myself');
function hide_myself($sql) {
    $sql->where.= ' AND '.SFMEMBERS.'.user_id !=XX';
    return $sql;
}

has to be exact! Replace the XX with your user ID. That will remove you from the members list on the front end.

As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/)

andy-signature.png
YELLOW
SWORDFISH
Avatar
Angela Bowman
Boulder, Colorado
Member
Free Members
sp_UserOfflineSmall Offline
Sep 26, 2012 - 1:48 pm

Excellent. Thanks.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 26, 2012 - 2:37 pm

You're welcome

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625