The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#2
|
|||
|
|||
This is great! I think I would incorporate this onto my own site! Thanks krucifyx
|
#3
|
|||
|
|||
Thanks for the code. It's given me a good start on password protecting other pages on my site.
However, I'm having some problems. I need secure pages to check if there's a vb cookie, and if there's not they can sign in using their vb username and password. Then they would see the protected pages. This code posts login information to the vb index.php file, but after logging in it dumps the user at the forum. I need to have the user dumped at the page they were trying to view. Also, if an incorrect login is used the user is just dumped at the forum. Any help would be greatly appreciated. |
#4
|
|||
|
|||
I've been out of the vb coding scene for a while but perhaps I can help you out.
What do you mean by it dumping you back to the screen? did you try putting this on all viewed scripts, not just forumdisplay.php? |
#5
|
|||
|
|||
Sorry about my previous post being a little vague.
I'm trying to create a file upload section to my website, but I only want registerd users from my forum to be able to upload. So I'm trying to password protect those upload pages using the vb login and cookies system. If a vb cookie is already present the user should see the upload page. However, if they aren't logged in, the user should see a page that says, "You need to be a registered user to upload files. Enter username and password or register here." After they login on that screen they should see the upload page. However, using the code at the top of this thread, the user doesn't see the upload page after logging in -- they are dumped at my forum's index page. An incorrect login has the same result (user is dumped at the forum index page). In short, if the user is logging in from the forum, they should end up at the forum. If the user is logging in from the upload page, they should end up at the upload page. Does that make sense? Sorry for the long post. [Edited by mferrell on 10-15-2000 at 11:05 AM] |
#6
|
|||
|
|||
Anyone got any pointers for the above post?
|
#7
|
|||
|
|||
Code:
<? require("global.php"); if ($bbuserid == 0) { eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nopermission")."\");"); exit; } if ($bbusername == "" || (isset($bbusername))==0) { $getusername=$DB_site->query_first("SELECT username FROM user WHERE userid=$bbuserid"); $username=$getusername[username]; $bbusername = $username; } else { $username = $bbusername; } // Your Code to ul goes here |
#8
|
|||
|
|||
Thanks! That works but I'm having one problem. When I login with the following code, I'm dumped at my websites index page. How do I get it so that it shows the page that's trying to be viewed?
Here's what I've got now: __________________________________ <? chdir($DOCUMENT_ROOT . "/bulletinboard"); require($DOCUMENT_ROOT . "/bulletinboard/global.php3"); if ($bbuserid == 0) { eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nop ermission")."\");"); exit; } if ($bbusername == "" || (isset($bbusername))==0) { $getusername=$DB_site->query_first("SELECT username FROM user WHERE userid=$bbuserid"); $username=$getusername[username]; $bbusername = $username; } else { $username = $bbusername; } // Your Code to ul goes here ?> <html> <title>Secure Area</title> <body><font face=verdana,arial,sans-serif size=2>You should only be able to see this if you're logged in.<p> </font> </body> </html> ____________________________ Thanks again for the help. |
#9
|
|||
|
|||
Well that is supposed to send you to whatever page you were trying to access after logging in.. hmm..
|
#10
|
|||
|
|||
Does this file have to be located in the bulletinboard directory? My forum resides in bulletinboard, but the file I'm trying to protect is in the root directory.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|