We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22815
    • 1,097 Posts
    Quote from: silent at Aug 24, 2006, 12:35 PM

    ... I did think more of teaching a MODx-snippet or plugin to map than to hack Vanilla which already made half of the way. An "intermediate" table (EDIT: related to MODx user-tables) so to say, which is used by all functions (in a snippet or whatever) which provide the actual "integration".
    Reconsidering it, it would be not "integrating" but "interfacing".
    (I would say the SMF-bridge uses a similar approach, but I never looked at the details so far.)
    SMF bridge uses SMF users within MODx, so interfacing with the table is entirely appropriate for a snippet or plugin.
    The proposed Vanilla integration uses MODx users within Vanilla, so a snippet or MODx plugin is no use to Vanilla. Vanilla is looking for a table and field; you can tell it what they are called but that is it. Vanilla is not looking for an abstracted function.

    Ah sod it, there’s nowt on telly tonight anyway. Vanilla integration coming up in 1 programmer hour.
      No, I don't know what OpenGeek's saying half the time either.
      MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
      Forum: Where to post threads about add-ons | Forum Rules
      Like MODx? donate (and/or share your resources)
      Like me? See my Amazon wishlist
      MODx "Most Promising CMS" - so appropriate!
      • 22815
      • 1,097 Posts
      Those of you playing along at home:

      1) Back up your MODx db.
      2) Go download Vanilla:
      http://lussumo.com/download.php?Get=Vanilla
      3) Upload it to /vanilla (or /modx/vanilla etc depending on where your MODx install is).
      4) Set up Vanilla using the same DB as your MODx install.
        No, I don't know what OpenGeek's saying half the time either.
        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
        Forum: Where to post threads about add-ons | Forum Rules
        Like MODx? donate (and/or share your resources)
        Like me? See my Amazon wishlist
        MODx "Most Promising CMS" - so appropriate!
        • 27226
        • 186 Posts
        Quote from: PaulGregory at Aug 24, 2006, 01:16 PM

        SMF bridge uses SMF users within MODx, so interfacing with the table is entirely appropriate for a snippet or plugin.
        The proposed Vanilla integration uses MODx users within Vanilla, so a snippet or MODx plugin is no use to Vanilla. Vanilla is looking for a table and field; you can tell it what they are called but that is it. Vanilla is not looking for an abstracted function.
        Ah sod it, there’s nowt on telly tonight anyway. Vanilla integration coming up in 1 programmer hour.
        (lol) I see, but it can be done either way (using SMF/Vanilla users within MODx OR using MODx users within SMF/Vanilla), you could also ask not to integrate Vanilla into MODx, but MODx into Vanilla laugh
        As far as I can see Vanilla is more prepared to share users than MODx is (keyword: field-mapping, there is no such thing in MODx as far as I know)
        I really don’t know what happens if I pass the "bridge" from MODx-site to SMF (there is no login required other than to use the forums - do I remember that properly?)
        Left that aside: My assumption is, that "integration" means to use Vanilla as a MODx "extension" and as such take all the MODx user-data to access Vanilla-forums and - vice versa - make any new Vanilla-account a MODx account too - automagically.
        [EDIT: Mmm!
        - Maybe this is the critical point, since it has to use the Vanilla-view of things. So: creating new users will most likely only be possible in the MODx environment, not directly in Vanilla. Well: why not? The "register" button might point to a MODx-element..]
        Hey guys, you keep me away from my business! laugh
        I’ll check this out and come back with some questions or even some ideas for solutions!
        Thanks!

        EDIT: your last post interfered, Paul: What to do after step 4?
          • 22815
          • 1,097 Posts
          5) Hit a brick wall.

          Ah. Of course, MODx already keeps many usersettings away from the basic user table.
          modx_web_users itself only has username and password; everything else is in modx_web_user_attributes. So the very "but you can’t use two user tables with Vanilla" issue that I just explained has hit me even with the existing stuff. Gah.

          EDIT: I had the wrong table name in the first draft of this message, it is now right and I’m still at a brick wall.
            No, I don't know what OpenGeek's saying half the time either.
            MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
            Forum: Where to post threads about add-ons | Forum Rules
            Like MODx? donate (and/or share your resources)
            Like me? See my Amazon wishlist
            MODx "Most Promising CMS" - so appropriate!
            • 22815
            • 1,097 Posts
            Quote from: silent at Aug 24, 2006, 01:31 PM

            but it can be done either way (using SMF/Vanilla users within MODx OR using MODx users within SMF/Vanilla)
            Yes, that’s why I said "proposed Vanilla integration". A different Vanilla integration is entirely possible, but it is a vastly different thing.

            Quote from: silent at Aug 24, 2006, 01:31 PM

            As far as I can see Vanilla is more prepared to share users than MODx is (keyword: field-mapping, there is no such thing in MODx as far as I know)
            No, Vanilla is more prepared to use a different usertable, and is more prepared to use users from elsewhere. Vanilla’s field mapping does not help MODx use Vanilla’s users.

            Quote from: silent at Aug 24, 2006, 01:31 PM

            Left that aside: My assumption is, that "integration" means to use Vanilla as a MODx "extension" and as such take all the MODx user-data to access Vanilla-forums and - vice versa - make any new Vanilla-account a MODx account too - automagically.
            I think you’re thinking of ’parallel user info’, where each side is hacked to save things into both tables. Or maybe you’re not. I’m not sure.

            Anyway. This brick wall is pretty major. What drew me to the "speed integration" was the fact that Mr Lussumo made it look so easy. I forgot that MODx has *three* user tables, two of which could easily be merged. I’m going to write up the options and see what y’all think.
              No, I don't know what OpenGeek's saying half the time either.
              MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
              Forum: Where to post threads about add-ons | Forum Rules
              Like MODx? donate (and/or share your resources)
              Like me? See my Amazon wishlist
              MODx "Most Promising CMS" - so appropriate!
              • 22815
              • 1,097 Posts
              OK, my respect for Vanilla is increasing. There is a solution.

              I’m going to add all the fields to modx_web_user_attributes - including a duplicate of Username. The only missing field will be password; I’ll have to write custom registration classes so that Vanilla *can* handle the fact that this is in a different table. Obviously this unexpected hurdle is stretching my hour, but we’re back on track now.
                No, I don't know what OpenGeek's saying half the time either.
                MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                Forum: Where to post threads about add-ons | Forum Rules
                Like MODx? donate (and/or share your resources)
                Like me? See my Amazon wishlist
                MODx "Most Promising CMS" - so appropriate!
                • 22815
                • 1,097 Posts
                EDIT: Um, don’t seriously follow this step-by-step guide until I’ve reached the conclusion. I’m just adding in a new table reference now I know I need it.
                EDIT 2: You may now follow this, it works up to a point.

                And so,
                5) Edit vanilla\conf\database.php - note that this is created on the server and you may need to change the permissions to download/open it. Change the permissions back again right away. If someone can detail a secure method of doing this step, that would be very useful. If you do have issues, it’s probably slightly more secure to not download this file, but instead to put your details into this example file:

                All the stuff after the password etc needs to be in your vanilla\conf\database.php file one way or another.
                <?php
                // Database Configuration Settings
                $Configuration['DATABASE_HOST'] = 'localhost';
                $Configuration['DATABASE_NAME'] = 'your_db_name';
                $Configuration['DATABASE_USER'] = 'your_db_user';
                $Configuration['DATABASE_PASSWORD'] = 'your_db_password';
                
                $DatabaseTables['UserMain'] = '_web_users';
                // If you are using a different prefix, you must change 'modx' in line 32 of People.Class.MODxAuthenticator.php
                $DatabaseTables['User'] = 'modx_web_user_attributes';
                // If you are using a different prefix, you must change this here.
                
                $DatabaseColumns['UserMain']['UserID'] = 'id'; 
                $DatabaseColumns['UserMain']['Name'] = 'username'; 
                $DatabaseColumns['UserMain']['Password'] = 'password'; 
                
                // Reused fields:
                $DatabaseColumns['User']['UserID'] = 'internalKey'; 
                // That's the same number as the UserID but is not the UserID. You must use custom classes if you need to write to the MODx user table.
                $DatabaseColumns['User']['Email'] = 'email';
                // New fields:
                $DatabaseColumns['User']['Password'] = 'vanilla_dummypassword';
                $DatabaseColumns['User']['Name'] = 'vanilla_name';
                $DatabaseColumns['User']['RoleID'] = 'vanilla_RoleID'; 
                $DatabaseColumns['User']['StyleID'] = 'vanilla_StyleID';
                $DatabaseColumns['User']['CustomStyle'] = 'vanilla_CustomStyle';
                $DatabaseColumns['User']['FirstName'] = 'vanilla_FirstName';
                $DatabaseColumns['User']['LastName'] = 'vanilla_LastName';
                $DatabaseColumns['User']['VerificationKey'] = 'vanilla_VerificationKey';
                $DatabaseColumns['User']['EmailVerificationKey'] = 'vanilla_EmailVerificationKey';
                $DatabaseColumns['User']['UtilizeEmail'] = 'vanilla_UtilizeEmail';
                $DatabaseColumns['User']['ShowName'] = 'vanilla_ShowName';
                $DatabaseColumns['User']['Icon'] = 'vanilla_Icon';
                $DatabaseColumns['User']['Picture'] = 'vanilla_Picture';
                $DatabaseColumns['User']['Attributes'] = 'vanilla_Attributes';
                $DatabaseColumns['User']['CountVisit'] = 'vanilla_CountVisit';
                $DatabaseColumns['User']['CountDiscussions'] = 'vanilla_CountDiscussions';
                $DatabaseColumns['User']['CountComments'] = 'vanilla_CountComments';
                $DatabaseColumns['User']['DateFirstVisit'] = 'vanilla_DateFirstVisit';
                $DatabaseColumns['User']['DateLastActive'] = 'vanilla_DateLastActive';
                $DatabaseColumns['User']['RemoteIp'] = 'vanilla_RemoteIp';
                $DatabaseColumns['User']['LastDiscussionPost'] = 'vanilla_LastDiscussionPost';
                $DatabaseColumns['User']['DiscussionSpamCheck'] = 'vanilla_DiscussionSpamCheck';
                $DatabaseColumns['User']['LastCommentPost'] = 'vanilla_LastCommentPost';
                $DatabaseColumns['User']['CommentSpamCheck'] = 'vanilla_CommentSpamCheck';
                $DatabaseColumns['User']['UserBlocksCategories'] = 'vanilla_UserBlocksCategories';
                $DatabaseColumns['User']['DefaultFormatType'] = 'vanilla_DefaultFormatType';
                $DatabaseColumns['User']['Discovery'] = 'vanilla_Discovery';
                $DatabaseColumns['User']['Preferences'] = 'vanilla_Preferences';
                $DatabaseColumns['User']['SendNewApplicantNotifications'] = 'vanilla_SendNewApplicantNotifications';
                
                
                ?>
                


                6) Fire up phpMyAdmin and execute this SQL:

                ALTER TABLE modx_web_user_attributes
                  ADD `vanilla_name` varchar(255) DEFAULT NULL,
                  ADD `vanilla_dummypassword` varchar(255) DEFAULT NULL,
                  ADD `vanilla_RoleID` int(2) NOT NULL DEFAULT '3',
                  ADD `vanilla_StyleID` int(3) NOT NULL DEFAULT '1',
                  ADD `vanilla_CustomStyle` varchar(255) DEFAULT NULL,
                  ADD `vanilla_FirstName` varchar(50) NOT NULL DEFAULT '',
                  ADD `vanilla_LastName` varchar(50) NOT NULL DEFAULT '',
                  ADD `vanilla_VerificationKey` varchar(50) NOT NULL DEFAULT '',
                  ADD `vanilla_EmailVerificationKey` varchar(50) DEFAULT NULL,
                  ADD `vanilla_Email` varchar(200) NOT NULL DEFAULT '',
                  ADD `vanilla_UtilizeEmail` enum('1','0') NOT NULL DEFAULT '0',
                  ADD `vanilla_ShowName` enum('1','0') NOT NULL DEFAULT '1',
                  ADD `vanilla_Icon` varchar(255) DEFAULT NULL,
                  ADD `vanilla_Picture` varchar(255) DEFAULT NULL,
                  ADD `vanilla_Attributes` text NULL,
                  ADD `vanilla_CountVisit` int(8) NOT NULL DEFAULT '0',
                  ADD `vanilla_CountDiscussions` int(8) NOT NULL DEFAULT '0',
                  ADD `vanilla_CountComments` int(8) NOT NULL DEFAULT '0',
                  ADD `vanilla_DateFirstVisit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
                  ADD `vanilla_DateLastActive` datetime NOT NULL DEFAULT '2006-06-06 00:00:00',
                  ADD `vanilla_RemoteIp` varchar(100) NOT NULL DEFAULT '',
                  ADD `vanilla_LastDiscussionPost` datetime DEFAULT NULL,
                  ADD `vanilla_DiscussionSpamCheck` int(11) NOT NULL DEFAULT '0',
                  ADD `vanilla_LastCommentPost` datetime DEFAULT NULL,
                  ADD `vanilla_CommentSpamCheck` int(11) NOT NULL DEFAULT '0',
                  ADD `vanilla_UserBlocksCategories` enum('1','0') NOT NULL DEFAULT '0',
                  ADD `vanilla_DefaultFormatType` varchar(20) DEFAULT NULL,
                  ADD `vanilla_Discovery` text,
                  ADD `vanilla_Preferences` text,
                  ADD `vanilla_SendNewApplicantNotifications` enum('1','0') NOT NULL DEFAULT '0';

                Replace modx_ for your db prefix if it’s different.
                  No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
                  MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                  Forum: Where to post threads about add-ons | Forum Rules
                  Like MODx? donate (and/or share your resources)
                  Like me? See my Amazon wishlist
                  MODx "Most Promising CMS" - so appropriate!
                  • 22815
                  • 1,097 Posts
                  Respect for Vanilla decreases. I’ve had to add "UserMain" mapping to modx_web_users. I’ve got the next 3 stages done, I’ve quite easily added in an alternate authentication that looks like it should work with the second table. There’s a nice API. So what do I get when I try to log in?

                  I get ’modx.LUM_modx_web_users’ doesn’t exist!!

                  What the hecking helling fricking tossing point is a database table mapping feature, if the only table that doesn’t automatically get LUM_ added to it is the User table???

                  EDIT: To be fair, it does actually state this in the template. But still. GAAAH.

                  EDIT 2: I can specify a custom prefix! That’s.. well that’s just silly, really, but at least it’s there. This will mean a lot of edits for people who aren’t using modx_ as their prefix.
                    No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
                    MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                    Forum: Where to post threads about add-ons | Forum Rules
                    Like MODx? donate (and/or share your resources)
                    Like me? See my Amazon wishlist
                    MODx "Most Promising CMS" - so appropriate!
                    • 22815
                    • 1,097 Posts
                    So. I’ve edited step 5 above to reflect the need to not include the prefix.

                    7) Add the line
                    // MODx Authenticator
                    $Configuration['AUTHENTICATION_MODULE'] = 'People/People.Class.MODxAuthenticator.php';
                    

                    to vanilla/conf/settings.php

                    8) Upload the attached file to
                    vanilla/library/People/People.Class.MODxAuthenticator.php (it’s uploaded as a .txt file, rename it)

                    9) Hop into phpMyAdmin and change the vanilla_RoleID for whoever will be the admin to 4.

                    10) Go to /vanilla in your webbrowser and LOG INTO VANILLA WITH A MODx WEB USER NAME AND PASSWORD!!

                    --

                    OK. So I’ve hit three hours, and still to do:
                    A) Registration. Presently this will add a user to attributes, so don’t do it.
                    B) Actual usage of the same session between MODx and Vanilla. Yes, I know that’s rather the point of integration; I’ve not tested it yet.

                    Does anyone want me to continue?
                      No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
                      MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                      Forum: Where to post threads about add-ons | Forum Rules
                      Like MODx? donate (and/or share your resources)
                      Like me? See my Amazon wishlist
                      MODx "Most Promising CMS" - so appropriate!
                      • 4018
                      • 1,131 Posts
                      Keep going! Keep going! I’m very curious as to how this will turn out! If we can have a forum app that will natively link up seamlessly to MODx then we’ve got a serious hit on our hands! Looks to me like you’re on a roll, PaulGregory! laugh
                        Jeff Whitfield

                        "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."