|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Is there a way to prevent this other than removing links from the unregistered nav menu? People either click on a users name and view thier profiles or copy in the url for the who's online page and I would like to block them unless they are registered. TIA.
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
[6.3.2] online.php find: ----- // -----------------<br />// Get the user info<br /> $userob = new user;<br /> $user = $userob -> authenticate("U_TimeOffset,U_Groups"); insert after: ------------- // Limit access to registered users.<br /> if (!$user['U_Username']) {<br /> $html = new html;<br /> $html -> not_right('You must be registered and logged in to perform this function.',$Cat);<br /> } showprofile.php find: ----- $Username = $thisuser['U_Username'];<br /><br /> $html = new html; insert after: ------------- // Limit access to registered users.<br /> if (!$Username) {<br /> $html -> not_right('You must be registered and logged in to perform this function.',$Cat);<br /> }
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Thanks guys, works great!
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
A twist on this, can I make it to where a user has to be in a specific group to view these? I can see this as an incentive.
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
To require membership in group #5: For online.php, change (referencing my previous post): if (!$user['U_Username']) { to: if (!$user['U_Username'] or !strstr($user['U_Groups'], '-5-')) { For showprofile.php, add U_Groups to the $userob->authenticate() call, and change: to: if (!$Username or !strstr($user['U_Groups'], '-5-')) { ----- Edit: Fixed above code. It incorrectly used "and" instead of "or".
Last edited by Dave_L; 09/10/2003 9:25 AM.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
This line doesn't appear to work for my online.php?
if (!$user['U_Username'] and !strstr($user['U_Groups'], '-10-')) {
It still restricts access for unregistered users and that's it, I created a group and did a query, the new group number is 10.
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
My mistake. That should be "or", not "and". I've corrected my post above. By the way, is your version 6.3.2? When dealing with this level of detail, you should always specify what version you're using. Also, you didn't specify whether you want moderators and adminstrators to have access regardless of whether they're in group #10. If so, you'd have to add more stuff to the if-condition.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Okay, I am running 6.3.2 and yes I would like to allow mods and admins. Sorry for leaving that out.
|
|
|
|
Joined: Nov 2001
Posts: 126
Junior Member
|
Junior Member
Joined: Nov 2001
Posts: 126 |
Does this work for 6.4 as well?
|
|
|
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.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|