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
sp_PostIndexUserRank() reporting any user as "Admin"
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Jul 24, 2011 - 11:10 pm

I should of reported much earlier but I wrote it off as "might be working on it".

I noticed in topic view the user ranks of any user is admin. Though they don't have admin ability (I double checked). From within sp-topic-view-functions.php

I did a var_dump of $spThisPostUser and can see $spThisPostUser->rank[0]['name'] of every user is Admin. I tried tracking down but my brain went to mush too quickly.

Is this just me and a borked upgrade, or is anyone else seeing this?

Edit: I can't see this in the database. I can only see myself as admin. Unless this value is not in plain text.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 25, 2011 - 4:12 am

Sounds like a bug to me Lee. Thanks for the info. I will open up a ticket and take a look.

Although I will say not something I am seeing. But needs investigating all the same.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Jul 25, 2011 - 9:33 am

Just let me know how to assist.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 25, 2011 - 10:10 am

well as I said neither Steve or I get this issue so we should ask you to check your ranking settings - any special ranks - things like that.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Jul 25, 2011 - 4:17 pm

I've never made special ranks, set up badges or anything before, but I checked all the same.

If visiting as guest, or logged in as normal user or Moderator, all looks correct (Member, Moderator, Admin etc). Ranks are as expected. If logged in as Admin (WP), it shows all members as Admin rank.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 25, 2011 - 8:55 pm

how are you generating the topic view - assuming this is the topic view, right??  are you using the topic class and query?

no rank info is stored in the db...  generated on the fly...

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Jul 26, 2011 - 1:23 am

This occurs with the default unmodified theme. On topic pages. I've disabled all forum plugins and all WP plugins (MU as well). I've tried with WP's Twenty-Ten and Twenty-Eleven themes. No additional code in profile.php's, nor additional code in SP's themes at all.

The only thing I can think of that might have an effect is SP options, or a combination of them. I'll keep messing around.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 26, 2011 - 2:52 am

I will try and spend a little time with this today Lee - at least to try and work out what the questions might be 🙂

andy-signature.png
YELLOW
SWORDFISH
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Jul 27, 2011 - 9:15 pm

Progress!!!

This SP is being run on a multisite (blog 1 only) WP! That's why I'm the only one seeing this.

In sp-api-class-user.php around 175

            # check for super admins and make admin a moderator as well 
            if ($this->admin || (is_multisite() && is_super_admin())) {
                $this->admin = true; 
                $this->moderator = true; 
                $this->usertype = 'Admin'; 
            }

If I remove the check for multisite and super admin like so:

            # check for super admins and make admin a moderator as well 
            //if ($this->admin || (is_multisite() && is_super_admin())) {
            if ($this->admin) { 
                $this->admin = true; 
                $this->moderator = true; 
                $this->usertype = 'Admin'; 
            }

All ranks are displayed correctly. I don't know why, I haven't dug far enough… and I admit. Reading and understanding what's going on inside a class is very hard for me.

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Jul 27, 2011 - 11:22 pm

is_super_admin() if not passed a user ID will use current users ID. So it was using my ID for all posters. Passing the posters ID fixes this problem 🙂

            # check for super admins and make admin a moderator as well 
            if ($this->admin || (is_multisite() && is_super_admin($id))) { 
                $this->admin = true; 
                $this->moderator = true; 
                $this->usertype = 'Admin'; 
            }
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
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: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625