The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Force All Guests to a Custom Login
I see this question asked many times for vBulletin4.x, but I can't find clear answers.
We're building a site that is a totally closed community. All guests must login through a page with ONLY the login fields. The login page cannot display the regular site navigation. It's OK if the error handling goes to the regular login, but it would be preferred if we could do that on a screen without the navigation as well. So I need three things: 1) How to force all guests to the custom login screen. I tried this into global_start: Code:
if ($vbulletin->userinfo['usergroupid'] == 1) { $templater = vB_Template::create('my_custom_login'); print_output( $templater->render()); } I also tried a version that does a Location (also on global_start) Code:
$vbulletin->url = $thisserverprotocol.$_SERVER['SERVER_NAME'].'/xlogin.html'; 1a) What's the best way to check for non-logged in users? 1b) If I want to do location:, where should I hook? 2) How to submit that login form to vBulletin I got a form to work by copying the rendered html from the cpanel login, and modifying the paths. But that's bringing in a bunch of JavaScript seems like overkill. Is there a simple way to have a form submit to login? 3) An abbreviated custom registration form. The email address will be passed in the URL, so I'll just have them fill in a handle and password. I can write a record to the DB myself, but i"m sure there's a nice call I can make to create a user. Could someone point me in the right direction? These are the final features needed for this site, and need to be resolved ASAP. Any help is appreciated. |
#2
|
|||
|
|||
I don't know if this is the best way, but you might try using your global_start plugin but surround the code with:
Code:
if (!defined('SKIP_SESSIONCREATE')) { // code here } I think a form like this should work: Code:
<form action="login.php" method="post"> <input type="hidden" name="do" value="login"> <input type="text" name="vb_login_username"> <input type="text" name="vb_login_password"> </form> (obviously that's simplified and you'd want some formatting). If you want to send the password as an md5 hash (which vb noramally does) then you'd need to include some javascript. |
#3
|
|||
|
|||
Thanks so much kh99.
The simplified login form worked fine. Just had to add a hidden field to prevent it from coming back to the login form: Code:
<input type="hidden" name="url" value="/homepage.php"> Moving the hook to global_state_check solved my problem with the vanishing CSS. Moving the form from the external HTML page to the template is causing some wackiness in that I think we're intercepting the processing at login.php and showing the login template. I tried incorporating the SKIP_SESSIONCREATE, but that didn't seem to help. Anyone have further thoughts? |
#4
|
|||
|
|||
I'm oh so close.
Created a plugin hooked on global_state_check Code:
if ($vbulletin->userinfo['usergroupid'] == 1) { if ((THIS_SCRIPT == 'login') or ($_POST['do'] == 'login')) { } else { $templater = vB_Template::create('custom_login'); print_output( $templater->render()); } } Youtube videos aren't rendering on Chrome. Don't understand how that could be related, but there it is.... Thoughts? --------------- Added [DATE]1339079659[/DATE] at [TIME]1339079659[/TIME] --------------- Nevermind. Just had to relaunch Chrome. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|