We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29357
    • 35 Posts
    I have a large site with an smf forum and at least 80 different user groups. More of that in another post. Each one has to login and I like the features of WebloginPE. So you can imagine my consternation when logging in appeared to work...but didnt. I was logged in to the Modx side but not the SMF side where I was a blank. It took me a while to find this one..

    WebloginPE like weblogin invokes an OnWebLogin event. The SMF Connector uses it. Bit unlike WebloginPE that passed an array of arrays. SMF was expecting an array with username in it. I dont know why webloginPE is different but nomatter. I just tacked username onto the array like so. File is assets/snippets/webloginpe/webloginpe.class.php

    About 2996
    	function OnWebLogin()
    	{
    		global $modx;
    		$parameters = array('user' => $this->User,'username' => $this->User['username']);
    		$modx->invokeEvent('OnWebLogin', $parameters);
    	}



    Then came OnWebLogout...in this case WebloginPE got it completely wrong. It destroyed the session variables before trying to pass them in OnWebLogout.

    So I added this to function logout

    292

    	function Logout($type, $loHomeId = '')
    	{
    		$logoutparameters = array(
    			'username'		=> $_SESSION['webShortname'],
    			'internalKey'	=> $_SESSION['webInternalKey'],
    			'userid'		=> $_SESSION['webShortname']			
    			);
    	



    And this for the OnWebLogout function (old code commented out)

    about 3098

    	function OnWebLogout($logoutparameters)
    	{
    		global $modx;
    		//$paramaters = array(
    			//'userid'		=> $_SESSION['webInternalKey'],
    			//'internalKey'	=> $_SESSION['webInternalKey'],
    			//'username'		=> $_SESSION['webShortname']
    		//	);
    		$modx->invokeEvent('OnWebLogout', $logoutparameters);
    	}



    Good Luck

      • 3404
      • 3 Posts
      great work!
      thank u very much for this topic!!!


      [edit]
      if have seen one error on logout.

      i have to change one line in the function Logout:

      orginal code:
      $this->OnWebLogout;


      u have to change this to:
      $this->OnWebLogout($logoutparameters);

      and everythink works fine.

      smf version: 1.1.1.5
      webloginpe version: 1.3.0
      [/edit]

      Info: watch the "smf_api_1.1.php" for writting functions for creating forum users on webloginpe registration (function smf_registerMember) and for changing passwords with webloginpe(function smf_ChangePassword). so you dont have to click the synchronisation button in the manager and the users can loginto forum after registration ...



      greetings binary
        • 14668
        • 11 Posts
        first post, i’m new to these forums and to modx, but i love it so far... MUCH appreciation and thanks to all involved in developing modx!

        to the topic, i’ve got a simple machines forum and just ran through the integration process... had to update the file "smf_api_1.1.php" - found the link in one of the old posts on this forum. if anyone needs it i can dig it up and post the link... but as soon as i updated that file everything worked fine...

        the only minor issue so far is that if users were already created in modx before the integration, those users cannot see any boards or posts within SMF. old users imported to modx from SMF work just fine. also new users created within the Manager after the integration work fine as well.

        i’m not a heavy coder by any means but i am learning. modx, so far, seems to be the best CMS i’ve ever come across. again, big props to the developers!!

        - JR
          • 3133
          • 98 Posts
          Hi there!

          Got a trouble, may be you could easly fix it.

          I’m trying to run Modx 0.9.6.2/ Smf 114 / WebLoginPE 1.2.0.

          When I try fullfill ’path’ on SMF connector configuration (CMS base url) (Forum base path) I have put it on the path found on phpinfo from Manager -> Rapports -> Afficher infos système -> phpInfo() et afficher -> "Local Value"de "include_path".(btw homez.22/glooda/www/xxx/)

          So I can run the module but when I’m trying to log out from my admin account, the adresse on my browser looks that : http://mysite.com/homez.22/glooda/www/xxx/index.php?id=4&webloginmode=lo&smflogout=1.

          Please got u any clue

          thanks for ure time
            • 30023
            • 172 Posts
            You also need to change the following if using WebLoginPE for webuser sign ups.

            Looking at http://wiki.modxcms.com/index.php/API:Web_Access_Service_Events, there is no defined standard for what parameters are to be passed.

            -- Tim.

             
            function OnWebSaveUser($mode = 'new', $user = array())
                    {
                            global $modx;
            
                            $parameters = array(
                                    'mode'  => $mode,
                                    'user'  => $user,
                                    'username'=>$user['username']  // (TS) SMF connector fix
                                    );
                            $modx->invokeEvent('OnWebSaveUser', $parameters);
                    }
            
              • 8425
              • 159 Posts
              Hi,
              Users are being created in SMF via the bridge but email address are not passed along. Has anyone successfully port user info (user name, password, email..) over to SMF using the bridge?
              Thanks for your help...
                • 20911
                • 84 Posts
                Hi, i know this is a old thread, but how is it possible to integrate this with codes? i mean i allready have a SMF Forum installed before i installed Modx..
                  Mysql 5.1.52
                  Apache 2.2.17
                  PHP 5.2.12
                  Linux
                  • 35531
                  • 2 Posts
                  Does anyone know how to get SMF Connector to automatically sync users? It is all working fine but I have to go into the module to sync them. Obviously a hassle as users want to use the forum straight away after signing up.
                    • 30023
                    • 172 Posts
                    Manual synching is not normally required other than for pre-existing users when the connector is first installed.

                    If using webloginpe, then given you are posting here, I am assuming you’ve read this thread and implemented the fixes mentioned.

                    -- Tim.
                      • 35531
                      • 2 Posts
                      Quote from: TimGS at Aug 15, 2011, 08:54 AM

                      Manual synching is not normally required other than for pre-existing users when the connector is first installed.

                      If using webloginpe, then given you are posting here, I am assuming you’ve read this thread and implemented the fixes mentioned.

                      -- Tim.


                      Hi Tim

                      yes I implemented the first few. I tried to implement yours but wasn’t sure where to put the code. I’m familiar with html/css but i’m affraid my php knowledge is limited

                      My problem is that when a user is created that user cant log in to my SMF forum until the sync button is hit. I trying to put the site together urgently so any help you can give would be greatly appreciated.