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,

    Which file controls and handles the login authentication that occurs when logging in through the [[!Login]] snippet.

    I mean, where and in what file can i find the variables that are passed against the database on a login?
      IntoVPS - VPS hosting service with super-fast response.
      If MODx does not suit your needs then you have a lack of imagination.
      • 1778
      • 659 Posts
      Hello
      Do you mean when you use the Login Add-on or when you log to the manager ?
      Cheers
        • 37393
        • 68 Posts
        Hi anso,

        No, i mean in general, the default processor handler for user login functions which takes action in the frontend.

        The reason i am wondering is because i want to hack the file and insert another user variable from another software to be passed once the user logs in.
          IntoVPS - VPS hosting service with super-fast response.
          If MODx does not suit your needs then you have a lack of imagination.
          • 3749
          • 24,544 Posts
          Depending on what you're trying to do, you may be able to just use a plugin connected to one of the Login events.

          OnBeforeWebLogin fires before the authentication of the user.

          OnWebAuthentication fires after the user has been authenticated, but before the check for access to any front-end context.

          OnWebLogin fires after the user has been found to be authorized for the web context (or other front-end context).

          If you hack the code, your work will be lost every time you upgrade MODX. Using a plugin would avoid that.



          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 37393
            • 68 Posts
            Quote from: BobRay at Jul 01, 2012, 01:21 AM
            Depending on what you're trying to do, you may be able to just use a plugin connected to one of the Login events.

            OnBeforeWebLogin fires before the authentication of the user.

            OnWebAuthentication fires after the user has been authenticated, but before the check for access to any front-end context.

            OnWebLogin fires after the user has been found to be authorized for the web context (or other front-end context).

            If you hack the code, your work will be lost every time you upgrade MODX. Using a plugin would avoid that.



            ------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using.
            MODX info for everyone: http://bobsguides.com/modx.html

            Hi Bob,

            Basically, i am wanting to automaticly login a mybb user while logging into Modx by passing the username and password variables in a hook or plugin.

            I tried creating a hook to be used within this snippet call
            [[!Login? &postHook=`MyBB`]]
            , but it never fired the variables as it should, i do not know why but when i try a external php file in my html root it works fantastic, it automaticly authenticates the username and password from the variables into the mybb authentication function.

            This is my code:
            <?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;
            
            $login_status = $MyBBI->login($MyBBI->mybb->input['name'], $MyBBI->mybb->input['password']);
             
            ?>
            [ed. note: bowkilled last edited this post 14 years, 3 months ago.]
              IntoVPS - VPS hosting service with super-fast response.
              If MODx does not suit your needs then you have a lack of imagination.
              • 3749
              • 24,544 Posts
              Is the echo statement working at all? I wouldn't expect it to work inside a postHook.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting