Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Mod Name / Version: Restrict Viewing User Profiles By Group 1.1

Description: This mod will disallow viewing of User profiles except by Admins, Mods, and a specified user group.

See installation instructions below



Working Under: UBB.Threads 6.5

Mod Status: Beta

Any pre-requisites: N/A

Author(s): Zackary

Date: 10/27/04

Credits: UnixSpot for requesting it

Files Altered: threads > showprofile.php
threads > languages > showprofile.php
threads > includes > config.inc.php

New Files: None

Database Altered: NO

Info/Instructions: Friendly reminder, BACKUP your files prior to modifying them!

Go to your board, configure your groups to use the one you want to have access to member profiles. Remember if a user is an Admin or Moderator they'll see the profile regardless of group membership.

If you don't know the number of the group you want to allow to view profiles, go into your Control Panel. Click on Group Management under the Forums Menu. Find the group you want to use and make note of the group number listed to the left of the name. (Just to the left of the Delete check box)

IMPORTANT!!! In the first step, you'll replace the XXX with the number of the group you want to use.

If you want to use multiple groups, place a | between the numbers. (i.e. 5|9)

Open threads > includes > config.inc.php

ADD to the end of the file right before the ?>

Code
 <br />$config['view_profiles'] = "XXX"; <br />


Open threads > showprofile.php

FIND:

Code
 <br />$thisuser = $userob -> authenticate("U_PictureView,U_Number,U_TimeOffset,U_TimeFormat,U_Ignored,U_OC_Userid"); <br />


REPLACE WITH:

Code
 <br />$thisuser = $userob -> authenticate("U_PictureView,U_Number,U_TimeOffset,U_TimeFormat,U_Ignored,U_OC_Userid,U_Groups,U_Status"); <br />


FIND:

Code
 <br />if ($User == 1) { <br />	$html -> not_right($ubbt_lang['NO_LONGER'],$Cat); <br />} <br />


ADD AFTER:

Code
 <br />if ((!preg_match("/$config[view_profiles]/",$thisuser['U_Groups'])) && ($thisuser['U_Status'] != "Administrator") && ($thisuser['U_Status'] != "Moderator"))  { <br />   	$html -> not_right($ubbt_lang['NO_VIEW_PROFILE'],$Cat); <br />} <br /> <br />else { <br />


FIND:

Code
 <br />if (!$debug) { <br />	include("$thispath/templates/$tempstyle/showprofile.tmpl"); <br />} <br />


ADD AFTER:

Code
 <br />} <br />


Open threads > languages > showprofile.php

ADD to the end of the file right before the ?>

Code
 <br />$ubbt_lang['NO_VIEW_PROFILE'] = "I'm sorry you do not have permissions to view user profiles. If you feel this is in error, please contact an Administrator."; <br />


You can edit this string to say what you want.

You are done!

----
[EDIT: 10/27/2004 - I was unhappy with hard coding this right into the showprofile.php, so I went ahead with my original plan to add it to the config file. In my mind this makes more sense.

Instructions have been updated to reflect this change. This is now version 1.1. ]

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.

Last edited by Zackary; 10/27/2004 11:10 PM.
Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
-thanks!!!

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
Just installed this.

Very nice mod, thanks a lot!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)