vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Vbulletin login (https://vborg.vbsupport.ru/showthread.php?t=227454)

ctlatino 11-05-2009 04:14 PM

Vbulletin login
 
Hey guys i have a vbulletin board and i wanted to use the member systeme for my website. So fare it's not looking to good. I have been cheking the web for solutions but nothing ...

I tryed 2 things so fare ...

1. Include the global.php file and added a form to login to the board from my homepage. When i log i get the welcome message then i am redirected back to the home page but i am not logged in. I made a print_r($vbulletin) and the userid stays to 0 so the login did not save. If i take out the global.php file and try to log in i get the same message but when i go back on the board i am logged in. kind of weird ...

2. I tryed to tweek the login.php file and insert sessions. I added the session_start to the global.php file and in my homepage then added $_SESSION['username'] = $vbulletin->GPC['vb_login_username']; after the log in but for some reason the session is not created ...

--------------- Added [DATE]1257448824[/DATE] at [TIME]1257448824[/TIME] ---------------

Ok i finaly got this to work ... It's not hars ... it's just porly explained

PHP Code:

<?php

chdir
("board/"); 
require(
'./global.php');   
chdir("../"); 

    
$vboptions['homeurl'] = $vbulletin->options['homeurl'];
    
$vboptions['bburl'] = $vbulletin->options['bburl'];
    
$vboptions['bbtitle'] = $vbulletin->options['bbtitle'];
    
$vboptions['forumhome'] = $vbulletin->options['forumhome'];
    
$vboptions['contactuslink'] = $vbulletin->options['contactuslink'];
    
$bbuserinfo['userid'] = $vbulletin->userinfo['userid'];
    
$bbuserinfo['usergroupid'] = $vbulletin->userinfo['usergroupid'];
    
$bbuserinfo['username'] = $vbulletin->userinfo['username'];
    
$bbuserinfo['email'] = $vbulletin->userinfo['email'];
    
$session['sessionurl'] = $vbulletin->session->vars['sessionurl'];
    
$session['sessionhash'] = $vbulletin->session->vars['sessionhash']; 
?>
              <table border="0" cellspacing="5" cellpadding="0" align="center"> 
                <tr> 
                  <form action='/board/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'> 
                  <SCRIPT type=text/javascript src="http://dramis.info/board/clientscript/vbulletin_md5.js?v=384"></SCRIPT>  <td> 
                    
<?php
if ($bbuserinfo['userid']!=0){
    echo 
"<center>Welcome back ".$bbuserinfo['username']."!<br><a href='index.php?log=fermer'>Logout</a><center>";
}else{
    print (
'<table border="0" cellSpacing="3" cellPadding="0">
                        <tr>
                            <td colSpan="2">
                            <input accessKey="u" onblur="clickrecall(this,\'Username\')" id="navbar_username" class="search" onfocus="if (this.value == \'User Name\') this.value = \'\';" tabIndex="101" onclick="clickclear(this, \'Username\')" value="Username" size="19" name="vb_login_username"></td>
                            <td class="smallfont" noWrap>
                            <label for="cb_cookieuser_navbar">
                            <input accessKey="c" id="cb_cookieuser_navbar" tabIndex="103" value="1" type="checkbox" name="cookieuser"></label></td>
                        </tr>
                        <tr>
                            <td colSpan="2">
                            <input id="navbar_password" class="search" tabIndex="102" size="19" type="password" name="vb_login_password"></td>
                            <td>
                            <input accessKey="s" class="search" title="Enter your username and password in the boxes provided to login, or click the \'register\' button to create a profile for yourself." tabIndex="104" value="Log in" src="http://dramis.info/images/ok.jpg" type="image" name="I1"></td>
                        </tr>
                    </table>
                    <input type="hidden" name="s">
                    <input value="guest" type="hidden" name="securitytoken">
                    <input value="login" type="hidden" name="do">
                    <input type="hidden" name="vb_login_md5password">
                    <input type="hidden" name="vb_login_md5password_utf">'
);
}
?>         
                      
                    </td> 
                    </form> 
                  </tr> 
              </table>

Works like a charme


All times are GMT. The time now is 03:36 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01049 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete