Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
dad7732
RavenNuke(tm) Development Team



Joined: Mar 18, 2007
Posts: 1242

PostPosted: Fri Mar 11, 2011 7:29 am Reply with quote

Is there any way to make the admin and moderator profiles non-viewable by any other regular user, registered or otherwise?
 
View user's profile Send private message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Tue Mar 15, 2011 7:21 am Reply with quote

Interesting!
I *think* a 'moderator' has a user level of 1 (main admin) or 2 (moderator) at least within core *nuke code (as against forums).
So you could retrive that data easily enough;
Code:


if(is_user($user)) {
$userdata = getusrinfo($user);
// username
$username = $userdata['username'];
// access level
$access_lvl = $userdata['user_level'];
// rank - forums?
$rank = $userdata['user_rank'];

// show all data for user
print_r($userdata);
}
 
View user's profile Send private message Send e-mail
dad7732







PostPosted: Tue Mar 15, 2011 9:39 am Reply with quote

Not the retrieve that I'm interested in but rather making it so that a registered user cannot VIEW the admin and/or moderator's profile.
 
Guardian2003







PostPosted: Tue Mar 15, 2011 2:12 pm Reply with quote

In that case, No, not easily.
Assuming that (in the above code) a $access_lvl of '1' is an admin and '2' is indeed a Moderator, you could use that in a function to determine if the user has access rights to that data.

Code:


function can_see($user){
if(is_user($user)) {
$userdata = getusrinfo($user);
$access_lvl = $userdata['user_level'];
if($access_lvl ==1 || $access_lvl ==2)
return true;
} else {
   return false;
   }
}

Example usage;
Code:


if(can_see($user)) {
// show data
// or do SQL retreive
}


However that would require modifications to the core code in a number of files where you are outputting data.

An alternative might be able to modify the actual SQL select where appropriate. For example in Members_List module index.php file around lines 167 - 170

The problem will be what you define as 'Moderator' as to where you'll need to make changes.
If it's a Forum moderator you'll need to do different things than a core system (RN/PHP-Nuke) Moderator since profile data is typically retrieved from the forum tables and the SELECT statement in (as above lines 167 - 170) are not going to help because 'ranks' or not retrieved, so you would need to add another loop to the statement.

I made some modifications to Members_List module a while ago to add no_follow links etc and had intended to re-write the whole thing to be Forum independent but just never got around to it.
 
dad7732







PostPosted: Tue Mar 15, 2011 2:30 pm Reply with quote

May be easier just to locate the info in the DB and add a bunch of non-related mumbo-jumbo!! Smile
 
dad7732







PostPosted: Fri Mar 18, 2011 8:07 am Reply with quote

Actually, the best thing I found to do is to simply leave all fields blank in the admin and moderator profiles. So let whomever look all they want .. Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©