Return to Snippet

Revision: 53718
at December 1, 2011 21:50 by hotdiggity


Initial Code
<?php
if (!($mgrUserId = $modx->getLoginUserID('mgr'))) {
    $modx->sendUnauthorizedPage();
}

Initial URL

                                

Initial Description
Set up a basic template:

<html>
<head>
<title>[[++site_name]] - [[*pagetitle]]</title>
<base>
<meta>​
</head>
<body>
[[*content]]
</body>
</html>

Content:

<div>
<h4>The ACME web site is currently under development</h4>
<p>Please
<script>// <![CDATA[>' + 'email us' + '</a>' )
// ]]></script>
for all enquiries.</p>
</div>

..and set this page as the Unauthorised Page in system settings.


Put this snippet at top of every other template:

[[!UnauthorisedAccess]]

Now only web manager users logged in will be able to view the full site. Change to 'web' for web users.

Snippet code:

Initial Title
MODx hide development site

Initial Tags
php

Initial Language
PHP