Created
March 11, 2017 10:30
-
-
Save JonasEriksson/8e843287779422671834c93f0d9f0ac9 to your computer and use it in GitHub Desktop.
Mura Extended Attribute and check for management IP address
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
<!--- the "development" mode in Mura requires a logged in user to see the content, if this is an admin, the Mura Edit bar is part of the "preview" | |
sometimes it can be useful to see what the site would look like to a user without this, then a simple IP address check can solve this easily ---> | |
<!--- Add a Extended Attribute for Site/default named managementipaddress ---> | |
<!--- Add code below just after </head> in the html_head.cfm ---> | |
<cfif Len(m.siteConfig('managementipaddress'))> | |
<p class="red tiny text-center"> MGNTIP active.</p> | |
<cfif cgi.REMOTE_ADDR EQ "#m.siteConfig('managementipaddress')#"> | |
<cfelse> | |
<p class="red text-center">Maintenance mode - this page only works on another IP.</p> | |
<p class="red text-center">Please send any questions to support {AT} yourdomain {DOT} com.</p> | |
<cfabort/> | |
</cfif> | |
</cfif> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment