We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    Marco had a great find: a little PHP (5?) class that integrates PHPbb or PUNbb with any user system, providing:


    • Create an user account with a given user name, password and e-mail address
    • Authenticate an user
    • Verify whether an user is already authenticated and whether he is an administrator
    • Logout an authenticated user
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 25663 MODX Staff
      • 12,272 Posts
      Very interesting news, SMF just announced RC2 of 1.1 that is supposed to make it easier to integrate with other software. I asked for some more details and here’s what was said:
      At several locations within the SMF code, it’s possible to integrate function calls. This can be done by inserting values to the settings table:
      • integrate_pre_include
      • integrate_pre_load
      • integrate_verify_user
      • integrate_validate_login
      • integrate_login
      • integrate_logout
      • integrate_activate
      • integrate_fix_url
      • integrate_verify_password
      • integrate_change_email
      • integrate_reset_pass
      • integrate_activate
      • integrate_delete_member
      • integrate_register
      • integrate_outgoing_email
      • integrate_change_member_data
      • integrate_redirect
      • integrate_buffer
      • integrate_exit

      Each of these variables can be set to a function name, that is called whenever the related event occurs.

      What should my next question be?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 32963
        • 1,732 Posts
        Ask them why not make then into event/callbacks so developers can add listeners/hooks into the SMF system rather than inserting functions inside a table:

        smf_registerEvent("integrate_verify_user","myCallBakFunction");

        function myCallBakFunction() {
        // do some stuff
        return true; // true on success false on failure.
        }
          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 25663 MODX Staff
          • 12,272 Posts
          At their pace of development, that would get done in about 2-3 years. In the meantime, here’s some more information:

          An overview of integrating registration with other systems -- a quick howto

          Exporting users from SMF with code similar to:
          <?php
          require('SSI.php');
          $request = db_query("
          	SELECT *
          	FROM {$db_prefix}members", __FILE__, __LINE__);
          etc.
          ?>


          I also asked:
          And one last question, where are these functions located in the code so we can start expirimenting to come up with a solution for integrating between our CMS and SMF?
          As the functions refer to different events, the’re located everywhere in the code. Use a search tool to look for lines containing $modSettings[’integrate_. That will show where they are used, how they are used and what parameters they get. SMF will also soon release a Mambo bridge using the hook functions.

          For example, suppose you want to intercept sending of emails (because you want the other software to handle it for instance). In Subs-Post.php, you can find:
          <?php
          	if (isset($modSettings['integrate_outgoing_email']) && function_exists($modSettings['integrate_outgoing_email']))
          	{
          		if ($modSettings['integrate_outgoing_email']($subject, $message, $headers) === false)
          			return false;
          	}
          ?>


          When a mail is sent by SMF and this function is set, it calls the integrate function with parameters $subject, $message, and $headers. At this point bridge software can take over and do the sending of the mail by itself. After that it should return false in order to prevent SMF sending the mail too.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 25663 MODX Staff
            • 12,272 Posts
            And the plot thickens... I wrote:
            Thanks so much for the pointers. Now wer’re headed in the right direction! Does the SMF team have any desire to distribute other bridges similar to the one for Mambo?

            One of their dev team members wrote:
            Quote from: Compuart at Dec 24, 2005, 09:14 AM

            I’d be lying if I’d answer that with ’no’  lipsrsealed

            Maybe we’ll get somewhere with getting the right APIs in after all. Regardless, looks like we might just have their attention.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 4673
              • 577 Posts
              Why bend over backwards to play happy with SMF?

              I really don’t understand the deep reliance on this forum.

              Could somebody explain all of this to me?
                Tangent-Warrior smiley
                • 25663 MODX Staff
                • 12,272 Posts
                The short version:
                13628 Posts
                1761 Topics
                3128 Members

                The extended version:
                As soon as you develop a conversion script to maintain all user attributes, forum structure, forum features and data as is currently in the MODx support forum, I’ll happily consider switching to another forum.

                Until such time as another fourm offers said features and is a clearly superior solution, we’re not even considering it.

                ;)
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 4673
                  • 577 Posts
                  ahhh, sheer numbers laugh
                    Tangent-Warrior smiley
                    • 25663 MODX Staff
                    • 12,272 Posts
                    And more interesting news:

                    From our fine friend at SMF who’s done every integration with Mambo, Xoops, PhpNuke, iGamingCMS:

                    <?php
                    function smf_LoginById($username){
                    
                         global $db_name, $db_prefix;
                    
                         $sql = 'SELECT *
                              FROM {$db_prefix}members
                              WHERE memberName = $username
                              LIMIT 1';
                         $request = mysql_query($sql);
                         $smf_user = mysql_fetch_assoc($request);
                         
                        //Now login
                    
                            setLoginCookie(time()+$cookietime, $smfuser['ID_MEMBER'], sha1($smf_user['passwd'] . $smf_user['passwordSalt']));
                    
                         return true;
                    }
                    ?>
                    


                    As long as that gets done AFTER authentication in the CMS.
                    Otherwise, anybody could login as anybody.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 32963
                      • 1,732 Posts
                      The problem here is what if the user was exported from MODx? IMO SMF will not know the password or be able to apply sha1
                        xWisdom
                        www.xwisdomhtml.com
                        The fear of the Lord is the beginning of wisdom:
                        MODx Co-Founder - Create and do more with less.