We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    Quote from: sottwell at Feb 20, 2006, 09:30 PM
    This seems to do the job. Create a new snippet named CheckUser with this content (...)

    Thanks Susan very handy !!!

    Could it be used to have a login for SlimStats page ?
      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l'outil id
    • Create group "statviewers", and a document, View Stats, assign it to the "statviewers" group, put the CheckUser snippet at the beginning of the document’s content field, then add a snippet or TV redirecting it to the slimstats page after the CheckUser snippet has accepted the user into the page.

      I had a thought. Why not make the CheckUser into a plugin, which will do a $modx->runSnippet on the WebLogin snippet if the user isn’t logged in, thus avoiding the need of a separate dedicated login page. If the user isn’t logged in with the correct groups, the page processing is aborted and the login form is displayed on the page instead. If the user is properly logged in, the page processes normally.

      One question I have, though, is what if the user is logged in as a different web user that is not part of the required web group? He’ll get a logout link. Perhaps in that case there should be a message, that he’s not logged in as the required user and needs to log out and log in again as the correct user.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 4273
        • 356 Posts
        Quote from: sottwell at Feb 20, 2006, 09:30 PM

        This seems to do the job. Create a new snippet named CheckUser with this content:

        On the login page, call the WebLogin snippet like this:

        [!WebLogin?loginhomeid=`xx`!]


        where the xx is the ID of your Gallery2 document.


        Curious, why would you have the login page redirect to XX (document) what if you have more than one doc that you want to redirect user to

        what happens if a user simply logs in via the login page does it direct them to these pages ? or is this only if they entered form that page specifically



          SMF Bookmark Mod - check it out
          http://mods.simplemachines.org/index.php?mod=350