|
|
Joined: May 2004
Posts: 31
User
|
User
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
|
|
|
|
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... $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
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.
|
|
|
|
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.
|
|
|
|
Joined: May 2004
Posts: 31
User
|
User
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!
|
|
|
|
Joined: Sep 2003
Posts: 488
Code Monkey
|
Code Monkey
Joined: Sep 2003
Posts: 488 |
1) For a specific usergroup... CHANGE THIS: $user = $userob -> authenticate(); TO THIS: $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: $user = $userob -> authenticate(); TO THIS: $user = $userob -> authenticate(); <br /> <br /> if (!$user['U_Username']) { <br /> die("<p>You are not authorized to view this page.</p>"); <br /> }
|
|
|
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.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|