"Fossies" - the Fresh Open Source Software archive

Member "docs/techref/frontend/frontend.protectedcategories.html" of archive CONTENIDO_4.9.3.zip:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted source code. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.

Author Timo A. Hummel
Created 20th May 2005
Audience Site Integrators, Module Developers
Applies to CONTENIDO 4.6 or later

Introduction

CONTENIDO 4.6 introduces a updated concept for protecting frontend categories and enabling access to them.

Installation and configuration

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:

NOTE: Since CONTENIDO 4.9 this file has been moved to data/config/{environment}/ directory.

$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.