<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dae’s blog &#187; modx</title>
	<atom:link href="http://dae.cyberic.eu/blog/tags/modx/feed/" rel="self" type="application/rss+xml" />
	<link>http://dae.cyberic.eu</link>
	<description></description>
	<lastBuildDate>Sun, 11 Jul 2010 16:03:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Restrict page access to authorized MODx managers only</title>
		<link>http://dae.cyberic.eu/blog/restrict-page-access-to-authorized-modx-managers-only/</link>
		<comments>http://dae.cyberic.eu/blog/restrict-page-access-to-authorized-modx-managers-only/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 17:50:57 +0000</pubDate>
		<dc:creator>Dae</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[modx]]></category>

		<guid isPermaLink="false">http://dae.cyberic.eu/?p=27</guid>
		<description><![CDATA[A while ago I needed to create a private zone with documentation, accessible only by the MODx managers. In order to restrict access I wrote a simple snippet, which you can now use as well. Snippet name: ManagersOnly Description: Restrict &#8230; <a href="http://dae.cyberic.eu/blog/restrict-page-access-to-authorized-modx-managers-only/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A while ago I needed to create a private zone with documentation, accessible only by the MODx managers. In order to restrict access I wrote a simple snippet, which you can now use as well.<br />
<span id="more-27"></span><br />
<strong>Snippet name:</strong> ManagersOnly<br />
<strong>Description:</strong> Restrict access to managers only.</p>
<pre><code>if (!isset($_SESSION['mgrValidated']))
{
	header('Location: '.$modx->makeUrl($modx->config['unauthorized_page']));
	exit;
}
else
{
	$modx->setPlaceholder('manager_name', $_SESSION['mgrShortname']);
}</code></pre>
<p><strong>Usage:</strong> add <code>[[ManagersOnly]]</code> in the beginning of the page or in a template. In case the visitor is authorized as a manager, the snippet will also return the placeholder <code>[+manager_name+]</code> (MODx manager&#8217;s “short name”), so you can greet them. Please note that the placeholder will not work correctly with cached pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://dae.cyberic.eu/blog/restrict-page-access-to-authorized-modx-managers-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
