Last active
December 12, 2018 17:21
-
-
Save jonleverrier/33151101bad819739ad9751cbc37f476 to your computer and use it in GitHub Desktop.
isAnon snippet for MODx. Returns the value 1 if the user is anonymous (not logged into the manager)
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 | |
/** | |
* isAnon snippet | |
* returns the value 1 if the user is anonymous (not logged into the manager) | |
* | |
* example usage: [[!isAnon:is=`1`:then=``:else=`i'm not logged in`]] | |
* | |
* @author Jon Leverrier ([email protected]) | |
* @version 1.0 | |
* @since 10th December 2017 | |
*/ | |
if ($modx->user->hasSessionContext('mgr') ) { | |
return true; | |
} else { | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment