Login and session problem integration

  • Time
  • Show
Clear All
new posts
  • badi3
    New Member
    • Dec 2005
    • 2
    • 3.5.0 Pre-Release

    Login and session problem integration


    I installed vbulletin lately (I am initial), my problem it is that I want integrated the forum in my web portal so that the registered voters with will not have 2 identified (in the site and the forum), has what I included/understood Vbulletin uses the cookies or the sessions thus I integrated a script in the index page of the forum which makes the test; if the user is already authenticated anything does not do if not I initialize the sessions used by the forum with the data of the user already authenticated, above my script:



    $vbulletin->GPC['username'] = $row['username'];
    $vbulletin->GPC['password'] = $row['password'];

    $vbulletin->userinfo['password'] = $row['password'];
    $vbulletin->userinfo['userid'] = $row["userid"];
    $vbulletin->userinfo['username'] = $row["username"];

    $vbulletin->session->vars['styleid'] = 2;
    $vbulletin->session->vars['userid'] = 2;

    $vbulletin->db->query_write("DELETE FROM vb_cpsession WHERE id = '".$vbulletin->userinfo['userid'] ."'");

    $vbulletin->session->vars = $vbulletin->session->fetch_session($vbulletin->userinfo['username']);
    INSERT INTO vb_session
    (sessionhash, userid, host, idhash, lastactivity, styleid, loggedin, bypass, useragent)
    ('" . $db->escape_string($vbulletin->session->vars['sessionhash']) . "', " . $vbulletin->session->vars['username'] . ", '" . $db->escape_string($vbulletin->session->vars['host']) . "', '" . $db->escape_string($vbulletin->session->vars['idhash']) . "', " . TIMENOW . ", " . $vbulletin->session->vars['styleid'] . ", 1, " . iif ($logintype === 'cplogin', 1, 0) . ", '" . $db->escape_string($vbulletin->session->vars['useragent']) . "')");

    $newsession =& new vB_Session($vbulletin, '', $vbulletin->userinfo['username'], '', $vbulletin->session->vars['styleid']);

    $newsession->set('userid', $vbulletin->userinfo['userid']);
    $newsession->set('loggedin', 1);
    $newsession->set('bypass', 1);
    $vbulletin->session =& $newsession;

    $cpsession = $vbulletin->session->fetch_sessionhash($vbulletin->userinfo['userid']);

    $vbulletin->db->query_write("INSERT INTO vb_cpsession (id, hash, dateline) VALUES (" . $vbulletin->userinfo['userid'] . ", '" . $vbulletin->db->escape_string($cpsession) . "', " . TIMENOW . ")");

    echo "<script language=\"javascript\">window.location='".fetch_replaced_session_url('index.php?')."';</script>";


    My problem it is that with the first connection to the forum and when I try to enter importation which heading (calendar, message of the day) I am automatically redirect to the home of the forum and this action occurs especially when I try to reach the control panel user, I have all to check, can be that I have lapse of memory some parameters but Ca exceeds me especially that I am initial in Vbulletin. http://www.vbulletin.org/forum/image...sappointed.gif

    Thank you
    Last edited by badi3; Fri 16 Dec '05, 2:48pm.
  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    Integrating vBulletin with a non-vB member system would require a rather extensive modification of the code. Of course, we cannot provide official support for code modifications. What most people do is modify their current system to use the vB member system.

    Either way the place for help with this would be over at the mod site: http://www.vbulletin.org/
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography

    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    • badi3
      New Member
      • Dec 2005
      • 2
      • 3.5.0 Pre-Release

      precisely it is what I did, I have think that integrated my site Vbulletin has simpler than were integrated Vbulletin into the site
      thus I have carry out the modification on the levels of the codes on my site and all is well my it remains to me right how to make the authentification automatic to the forum when a utilistor is connected to the site


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.