Here is a simple bit of code you can use to authorize users:
<?php if (! User::require_login ()) { $page->title = i18n_get ('Members'); echo $this->run ('user/login'); return; } // members-only stuff goes here ?>
To do the same for admin pages, you would use:
<?php // use the admin layout (optional) $page->layout = 'admin'; if (! User::require_admin ()) { $this->redirect ('/admin'); } // admin-only stuff goes here ?>
There was an error while loading. Please reload this page.