We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37393
    • 68 Posts
    Hi,

    To begin with, please note that i am using Revolution 2.2.4 and MyBB 1.6.8


    Does anyone know how to integrate the modx user functions with mybb´s user functions?

    Currently i am trying a external login to authenticate a existing user with mybb:

    <?php
    
    define("IN_MYBB", NULL);
    
    require_once "/xx/xx/xx/path_to_mybb_forum/global.php";
    require_once "/xx/xx/xx/class.MyBBIntegrator.php";
    
    $MyBBI = new MyBBIntegrator($mybb, $db, $cache, $plugins, $lang, $config);
    
    echo ($MyBBI->isLoggedIn()) ? '
    MyBBI->isLoggedIn(): You are logged in' : '
    MyBBI->isLoggedIn(): You are not logged in';
    
    $username = "username";
    $password = "password";
    
    $MyBBI->mybb->input['name']= $username;
    $MyBBI->mybb->input['password']= $password;
    echo '
    Attempting to login';
    $login_status = $MyBBI->login($MyBBI->mybb->input['name'], $MyBBI->mybb->input['password']);
    
    echo ($login_status == true ? '
    login_status: You are logged in' : 'login_status: You are not logged in');
    
    echo ($MyBBI->isLoggedIn()) ? '
    MyBBI->isLoggedIn(): You are logged in' : '
    MyBBI->isLoggedIn(): You are not logged in';
    
    ?>


    I am now asking: What are the correct variables that Modx uses for logins? If i remember right the username variable is webShortname? or is it username?

    How can i do so that mybb recognizes if my modx user has logged in and vice versa? May i use a prehook for Modx to pass mybb login variables? [ed. note: bowkilled last edited this post 11 years, 9 months ago.]
      IntoVPS - VPS hosting service with super-fast response.
      If MODx does not suit your needs then you have a lack of imagination.