![]() |
|
Mod Options |
![]() |
|||||||||||
Simple vB User login and access control on non vB pages
![]() Developer Last Online: Nov 2011 ![]() ![]() ![]()
Hack Description
This is a cut down version of the user authentication and access control system I use on the non vB pages on my website. This uses the vB 4.0 login system to log you in and out. It allows you to move between your forums and other pages on your site while remaining logged in. It allows you to do things such as restrict pages by usergroup, display different content depending on a user being logged in or not. For example, you can have banner Adds displaying to non members only, and/or let members access to specific content. I've cut it down to the bare minimum that it needs to work, no fancy stuff such as avatars, PM's, or even formating. (That is in the Deluxe version - not yet released) This is not supported, but if any questions / issues are posted here (not PM'ed or emailed) I will try and answer them if I have time. This code is a mix of my own, and pieces I have used from other hacks that are floating around. This script has been confirmed as working on
Change log Version 4.00 (15th November 2009)
Click on Install If you have this script installed then please click on the install link because;
Download Now Only licensed members can download files, Click Here for more information. Screenshots Show Your Support
The following members like this post: mightyudis, Löcksch
|
![]() |
||||
Mod | Developer | Type | Replies | Last Post |
Integration with vBulletin Simple vB User login and access control on non vB pages | Billspaintball | vBulletin 3.6 Add-ons | 188 | 25 Jan 2013 16:40 |
Deluxe vB User login and access control on non vB pages | Billspaintball | vBulletin 3.5 Add-ons | 393 | 13 Jul 2011 21:50 |
Integration with vBulletin Deluxe vB User login and access control on non vB pages | Billspaintball | vBulletin 3.7 Add-ons | 76 | 06 Jun 2011 21:44 |
Integration with vBulletin Simple vB User login and access control on non vB pages | Billspaintball | vBulletin 3.7 Add-ons | 55 | 23 Apr 2011 14:52 |
Simple vB User login and access control on non vB pages | Billspaintball | vBulletin 3.5 Add-ons | 254 | 31 Jan 2009 10:57 |
Comments |
#2
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Note - The following troubleshooting tips work on vB 3.7 & 3.8, they have not yet been proven on vB 4.0
Usage The hack is pretty useless without some usage instructions so here they are. We can use conditionals to hide or display depending on a number of things such as Logged in or out status, or restrict to members of a specific usergroup. We do this by using conditionals in php tags where the normal content of a webpage would go. If you want something only accessable to a certain usergroup, use this code in your webpage. This example is only visible to members of usergroup 6.
You can use a simple variation of this to restrict entire pages to a certain usergroup. For example,
You can of course use multiple usergroups by just modifiying the if statement a little. For example:
Another use is to display different content to users depending on if they are logged in or not. For example
Another use is to restrict advertising to people who are not logged in. For example
Of course you can play around with conditionals to do a whole range of things, these are just brief example snippets. Troubleshooting If your reading this chances are you are having problems. Here are some common causes and fixes.
No members have liked this post.
Last edited by Billspaintball; 16 Nov 2009 at 10:15. |
#4
|
||||
|
||||
Reserved till i get my site up. I have been waiting for this. Glad it wasnt long!
![]()
__________________
No members have liked this post.
|
#5
|
||||||||
|
||||||||
Is this correct or a typo -
Do you mean login_inc.php? Where do we put the login_inc file included with this hack? Any special directory, or whichever directory we are running the script? Thanks. ![]() *Edit - Also, do these statements work with the new VB code?
__________________
No members have liked this post.
|
#6
|
||||||||
|
||||||||
Originally Posted by NittoMOD
The first is a typo, login_inc.php is what it is named (unless you change it)![]()
And the statements do work. However I do have an issue. I can't use the statements twice. Not sure what is going on but if I used the statement once, it doesn't work to use it again. No members have liked this post.
|
#7
|
||||
|
||||
Originally Posted by NittoMOD
Whoopsie ![]()
![]() Sorry about that, its just a typo. login_inc.php is correct. I will fix it.
I normally just put it under something like mywebside.com/includes/ No members have liked this post.
|
#8
|
||||||||
|
||||||||
Your example code:
In case a site has 14 or 51 usergroups they want to control, I think it might be an idea to use the array and check against it? untested:
__________________
My community; https://omgboards.com No members have liked this post.
|
#9
|
||||||||
|
||||||||
Originally Posted by Floris
If you want to allow a number of groups that would probably be a better way of doing it.![]()
Ive only ever used it to allow extra stuff for Admins and Mods so I never really had a need to optimise it for a large number of groups. No members have liked this post.
|
#10
|
||||
|
||||
Im getting this error -
My file paths are correct and there is no white space. Any idea's?
__________________
No members have liked this post.
|
#11
|
||||
|
||||
No members have liked this post.
Last edited by Dr.osamA; 04 Apr 2011 at 00:13. |
#12
|
||||
|
||||
Hiya Bill,
Do you think this could work as a wrapper in WordPress, where we use your authentication system to require people to authenticate against vB before they're allowed to post comments? I can easily extend WordPress' comment section and would like to do something like (pseudo code obviously):
Would it display the forum's username (if echoed correctly) or do we need the deluxe version for that? (which sounds like a better solution anyway, since I'd like to use the avatars as well). I don't care so much about all the other vB stuff, but would love to have this as a simple vB powered authentication system inside WordPress.
__________________
- highly ill, but always intelligent - - User Age in CP (together with the_sisko) No members have liked this post.
|
#13
|
||||
|
||||
Works on a standalone file, but won't work properly on my wordpress site.
The login boxes and what not appear, but after I am directed to the login.php file I am sent back to my wordpress page with the login boxes still showing. I tried all the steps with the cookie settings and login.php file. Moviecrematorium.com is my site. Any help would be appreciated. Great plugin btw ![]() No members have liked this post.
|
#14
|
||||
|
||||
Originally Posted by NittoMOD
Any help with this?
![]()
__________________
No members have liked this post.
|
#15
|
||||
|
||||
I too have the same issue as you =[
My Fix: well, I'm using this in the root of the site for a custom html page. I feel like a dumbass because i looked at the source and it had "<html>" twice. So my "custom.php" file that I made all I included in it was:
That seemed to work for me and fixed my issue. Hope this helps someone else. No members have liked this post.
Last edited by David Regimbal; 07 Dec 2009 at 00:55. |
![]() |
«
Previous Mod
|
Next Mod
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Mod Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 22:32.