Last active
December 12, 2018 17:21
-
-
Save jonleverrier/358139ae1daa081710ca8f9bcf4b7399 to your computer and use it in GitHub Desktop.
isAdmin snippet for MODX. returns the value 1 if the user is an administrator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* isAdmin snippet | |
* returns the value 1 if the user is an administrator | |
* | |
* example usage: [[!isAdmin:is=`1`:then=`i'm an admin`:else=`i'm just a content editor`]] | |
* | |
* @author Jon Leverrier ([email protected]) | |
* @version 1.0 | |
* @since 10th December 2017 | |
*/ | |
// name of user group | |
if ($modx->user->isMember('Administrator') ) { | |
return true; | |
} else { | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment