We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    There’s a handful of stuff in the MODx $_SESSION array... I’m wondering how I might tap that to ensure that a user is logged in with appropriate permissions.

    Here are some relevant portions of the $_SESSION array:

    Array
    (
        [usertype] => manager
        [mgrShortname] => me
        [mgrValidated] => 1
        [mgrInternalKey] => 1
    
        [mgrDocgroups] => 
    
        [ip] => 127.0.0.1
        [browser] => sf
        [browser_version] => 530.19
    
        [groups] => Array
            (
                [0] => Some Group
                [1] => Some other Group
            )
    
        [webShortname] => me
        [webFullname] => Full Name
        [webEmail] => [email protected]
        [webValidated] => 1
        [webInternalKey] => 1
    
        [webUserGroupNames] => 
        [webDocgroups] => Array
            (
                [0] => 1
            )
    
    )


    Anyone have some insights/tips/tricks on this? I think I can probably just check the value of webValidated and webDocgroups...
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Take a look at the MemberCheck snippet; it’s part of the default installation so you should have it.
        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