Jump to content

[SOLVED] Vbulletin login


drisate

Recommended Posts

Hey guys i have a vbulletin website 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 loged 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 ...

 

I am out of options.

Link to comment
Share on other sites

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

 

<?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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.