Protected frontend categories
|
Author | Timo A. Hummel |
Created | 20th May 2005 |
Audience |
Site Integrators, Module Developers |
Applies to |
Contenido 4.6 or later |
Download the plugin "Frontend Category Permissions" from the Contenido website. Extract the archive to your plugins directory. Open (or create) the file config.plugin.php in the directory contenido/plugins/chains/includes/ and add the necessary includes and chain entries (see below). Afterwards, open the file config.local.php in your contenido/includes directory (create the file if it doesn't exist) and add the following line at the end:
$cfg['plugins']['frontendlogic'][] = "category";
Example config.plugin.php:
<?php
global $_cecRegistry;
cInclude("plugins", "chains/includes/include.chain.frontend.cat_backendaccess.php");
cInclude("plugins", "chains/includes/include.chain.frontend.cat_access.php");
$_cecRegistry->addChainFunction("Contenido.Frontend.CategoryAccess", "cecFrontendCategoryAccess");
$_cecRegistry->addChainFunction("Contenido.Frontend.CategoryAccess", "cecFrontendCategoryAccess_Backend");
?>
The chain Contenido.Frontend.CategoryAccess is called everytime a protected category is accessed. If the chain functions return true, access is granted. The function cecFrontendCategoryAccess validates frontend users and their permissions, and cecFrontendCategoryAccess_Backend does the same for the backend user counterparts. If you wish to disable backend users for access frontend categories, remove the line which contains cecFrontendCategoryAccess_Backend. You can also define chains for more custom checks, please refer to the chains documentation for more information.