We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13577
    • 302 Posts
    Howdy

    I asked a question about the privateweb/privatemgr fields of the content table in the public forum because I thought it might be interesting for public discussion. But I have other thoughts on the matter that probably merit a little more discretion. It’s a longish post that I don’t want to recreate here, so it might help to read it first.

    I’m pretty new around here and am likely to ask a lot of dumb questions regarding the direction of MODx. This may be a case in point. smiley

    It seems to me like the MODx manager could in fact, simply be a set of pages within a MODx site. By doing so, you can limit access to them, create custom menus etc. all while taking advantage of the MODx core parser. This would make some functions highly available that right now only exist in the manager or on the front end. Thus menus for the site would be "smart" based on who the user was.

    Hmm.. not sure I’m making my point. In the case of getting the newsPublishing snippet to do a permission check on the parent, I had to basically recreate a function that already exists in the manager. Then I found out about those 2 new fields. And sure enough, within the manager, there are 2 functions to handle the private and web access. So I could recreate those too. But all that recreation seems silly from a time and maintenance perspective.

    I’m at a disadvantage of having NO CLUE how the new parser and new manager are being planned out. So take this for what it’s worth. There are arguements for and against putting the MODx manager in as "content." But I thought I’d throw out the idea in the highly unlikely chance that it wasn’t thought of already. (Plus it would have the peripheral benefit of naming the manager, via alias, anything you wanted!)

    I guess if you didn’t want the manager to be IN the site as content, it could stand alone but draw on the same classes etc. I guess that would be like having a couple MODx sites side by side. Which again, to me seems a bit excessive, but I could probably be convinced otherwise. You guys have a LOT more experience than I do I reckon.
      Standard Disclaimer
      I could be totally wrong.
      • 25663 MODX Staff
      • 12,272 Posts
      I think its a great idea very much worth considering. Victor for one is a huge proponent of sticking as much as possible in the DB. I also think it makes sense to get a little Shakesperian on our own manager (a site within a site...).

      However, there may be other arguments for not doing it, such as DB size, etc. I’m also not certain the current Object model and abstraction methods we’re using would be very fast to port from a filesystem based approach to an all in the DB approach. We’ll know soon enough though!

        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 22303 MODX Staff
        • 10,725 Posts
        Just as a preview to the proof of concept demo I almost have completed with the new Propel object-relational infrastructure and user merge (should have something very solid to show off this week):

        In order to support legacy operations, I’ve basically left the data structures alone, except removing id’s from cross-reference tables and replacing them with compound primary keys for the foreign key relationships, and of course, merging web and manager user data into our new user data structures.

        The demo is running a little slow on this first pass, but there is still lot’s more to do to define the new object-based API’s, remove redundant code (there is an enormous amount of this), reduce the size of the codebase itself, and improve the efficiency of the parsing processes with this new OO backend.

        Re: recreating the functions, the new API’s will take care of this problem moving forward - I’m in the process of reviewing all the functionality in MODx and re-implementing the methods in the appropriate classes (e.g. User, UserGroup, Document, DocumentGroup, UserGroupDocumentGroup, TemplateVar, etc.) so we can do things like this to get the current authenticated User object:

        UserPeer :: getAuthenticatedUser()
        which would be aliased also as
        $modx->getAuthenticatedUser()
        no more checking $_SESSION[’mgrValidated’] or $_SESSION[’webValidated] in order to determine this stuff...

        OR to get a collection of UserGroupDocumentGroup objects (representing the relationship between UserGroup and DocumentGroup objects)...

        $memberships= $modx->user->getUserGroupMembershipsJoinUserGroup();
        foreach ($memberships as $membership) {
          $userGroupDocGroups[]= $membership->getUserGroup()->getUserGroupDocumentGroups();
        }
          • 25663 MODX Staff
          • 12,272 Posts
          Sounds good Jason. Can’t wait to experience personally ... particularly after it’s streamlined!

          We should go ahead and implement Raymond’s new parser in it while we’re at it.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 32963
            • 1,732 Posts
            Sounds good Jason!

            One small question...

            How would we know when the user is logged in as a web user differently from when he is logged is as a manager user if we where to use $modx->getAuthenticatedUser()?

            For example:

            Mary is a modx user that has access to both Manager and Web logins. When Mary logs into the Web (via WebLogin) mary’s web session should be different from that of her Manager session when she logs into the manager.

            Is that the case?





              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
              I think the authentication will be done via common APIs as I understand it, but I sure do hope we maintain separate front-end and manager sessions. Really helps in testing out sites.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 22303 MODX Staff
                • 10,725 Posts
                That’s not a problem, I’ll add a parameter to the authenticate() function to allow you to specify if you want a front-end or back-end session, as well as a way to logout of each individual session or both together.
                  • 13577
                  • 302 Posts
                  Quote from: xwisdom at Dec 13, 2005, 08:36 PM
                  For example:

                  Mary is a modx user that has access to both Manager and Web logins. When Mary logs into the Web (via WebLogin) mary’s web session should be different from that of her Manager session when she logs into the manager.

                  This confuses me. Probably because the direction I was developing in Etomite was different (for the next major release). The thinking was everyone was a user. Period. Even anonymous users, were users. One user, one login. Then permissions defined if they had acces to the front and/or back end. I don’t understand why I would want two logins. On the surface, that looks like it would be a real pain. With the thinking we were using, if you *needed* that option, you would just create a second user for yourself.

                  See this is where it shows that I’ve not been in this community too long. Go easy on me as I try to learn the philosophies behind the methods wink
                    Standard Disclaimer
                    I could be totally wrong.
                    • 25663 MODX Staff
                    • 12,272 Posts
                    The way I understand it, sessions are browser specific. So, if you’re logged in, to login as another user requires a second, probably different browser to be open. This gets to be a pain for testing.

                    The way Jason is implementing the user authentication and sessions however, is really pretty slick from what I gleaned this AM about 3:45... there will be one user, but you’ll have different session contexts. You can login and out of various contexts as you so desire.

                    This will be handy not only for testing "front-end/back-end" but also for multi-site, and multi-account (think basecamp) applications.
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me