Previous Thread
Next Thread
Print Thread
Rate Thread
#278319 08/18/2004 7:50 PM
Joined: May 2004
Posts: 31
User
User
Offline
Joined: May 2004
Posts: 31
Ok, so I'm trying to make it where in order to view a page outside the threads folder (same server, same domain) it needs to look at the threads database of users and authenticate them. I know that I've been asking a lot of questions lately and chance becoming known as the board "thorn in the side" but I was wondering if any of you kind folks could spell this out nice and simple for me. Remember, small words for the simpleton.

Oh yeah, version 6.4b1

Sponsored Links
CJ #278320 08/18/2004 8:38 PM
Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
I can't test this right now, but you would include something like so at the beginning of your script...

Code
   $threadspath = "/bla/bla/bla/ubbthreads"; // <---CONFIGURE YOUR THREADS PATH <br />   require ("$threadspath/main.inc.php"); <br />   $userob = new user; <br />   $user = $userob -> authenticate(); <br />      if (!$user['U_Username']) { <br />         die("<p>You are not authorized to view this page.</p>"); <br />      }  

Joined: May 2004
Posts: 31
User
User
Offline
Joined: May 2004
Posts: 31
mmmm, good stuff. Now would I need to put the php tags around this? I'm putting it your run-of-the-mill php page. Pardon my 'tardedness.

CJ #278322 08/19/2004 3:09 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes, you can look at the generic threads page for an example:
https://www.ubbdev.com/forum/showflat.php/Number/81311

CJ #278323 08/19/2004 7:07 AM
Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
Yeah it's just a regular php code snippet. Slap the tags around it and name the file with a PHP extension...that's all there is to it.

If you wish to use your messageboard theme for this page, then Josh's generic page is what you definitely want. I believe there's 2 versions of it actually, both template and non-template varieties.

Sponsored Links
Joined: May 2004
Posts: 31
User
User
Offline
Joined: May 2004
Posts: 31
Holy fishsticks! Josh, I didn't know something like this was available. I tried it and it doesn't seem to care whether I was logged in or not - it was showing me the test verbage that comes with the script. Is there a 'quick n dirty' to stop the info on this page from showing up except to those that are registered - or even better - of a certain usergroup?

I swear you guys are masterminds at this stuff!

CJ #278325 08/20/2004 11:22 AM
Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
1) For a specific usergroup...

CHANGE THIS:

Code
   $user = $userob -> authenticate();  


TO THIS:

Code
   $user = $userob -> authenticate(U_Groups); <br /> <br />      if ( (!$user['U_Username']) || (strstr(!$user['U_Groups'],"-X-") ) ) { <br />         die("<p>You are not authorized to view this page.</p>"); <br />      }  


...where X is the usergroup number.



2) For registered users only...

CHANGE THIS:

Code
   $user = $userob -> authenticate();  


TO THIS:

Code
   $user = $userob -> authenticate(); <br /> <br />      if (!$user['U_Username']) { <br />         die("<p>You are not authorized to view this page.</p>"); <br />      }  


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
isaac
isaac
California
Posts: 1,157
Joined: July 2001
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
WebGuy 2
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)