We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26799
    • 177 Posts
    The point of this plug-in is to give a certain User-Role permission to use the front-end Quickedit module but deny them access to the manager.

    At this time the plugin is not very flexible, I’d like to redirect the user to their "start page" if they attempt to enter the manager after they are logged in. I don’t know how to do this is friendly-URLs is on. I was wondering if there was a particular function available in $modx that made this conversion automatically.

    Another issue I’m having is I’m not sure what event to invoke the plug-in on. I’ve looked through the wiki but pretty much all the event pages contain no documentation. I was thinking about using; OnWebPagePrerender or OnManagerAuthentication.

    Any direction would be helpful.

    And it’s a pretty cool name.
      • 15987
      • 786 Posts
      to create the url just use

      $modx->makeUrl(docid);

      for the event I think you would need to use OnManagerAuthentication, although I don’t have the list in front of me to see if there are any others.
        • 7923
        • 4,213 Posts
        I think that you should put the plugin to OnManagerPageInit event. Then in the plugin, see what’s the current users role and if he has rights to use quickedit. If he has rights, check that is $modx->manager->action one of the page id’s that quickedit uses (you have to find out what they are). If it is, allow access, if it’s not, use $modx->sendRedirect($modx->makeUrl($modx->getUserInfo($_SESSION[’mgrInternalKey’])[’manager_login_startup’])); to redirect the user to his startup page. I’m not sure if the setting is in manager_login_startup key, to see what is available in userinfo, use print_r($modx->getUserInfo($_SESSION[’mgrInternalKey’]))


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 26799
          • 177 Posts
          wouldn’t onManagerPageinit() run the plugin three times due to the frames page in the manager?

          I ran a print_r command on the seesion from that event and it printed in all three frames...

          and I still think it’s a cool name
            • 27376
            • 576 Posts
            Quote from: seventhapex at Jan 25, 2007, 06:04 PM

            wouldn’t onManagerPageinit() run the plugin three times due to the frames page in the manager?
            You are correct, the OnManagerPageInit event is called AFTER the frameset request is sent.

            Soooo.... what you can do is have your plugin check that [tt]$action != ’1’[/tt] (1 is a frame request), then do your processing. If it is 1, then stop processing.

            Your plugin code would look like this...
            <?php
            if ($action == 1) return; // Don't run on frame request
            
            // Put all your M.A.D. testing code here...
            ?>

            By the way, I’ve been slowly working on the Event System Documentation for the wiki, but haven’t had time to do all the research. The great part is: anyone can edit the wiki. So any info you find out, feel free to post it to the wiki wink

            Also, I look forward to this plugin being developed, I have a use for it...
              • 26799
              • 177 Posts
              thanks, I’ll document my findings as I learn.
                • 27376
                • 576 Posts
                UPDATE: This plugin is in development at this thread.
                  • 26799
                  • 177 Posts
                  yeah, sorry about that.