Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Functions

  • cecCreateBaseHref
  • cecCreateMetatags
  • cecFrontendCategoryAccess
  • cecFrontendCategoryAccess_Backend
  • cecIndexArticle
  • CheckIfMetaTagExists
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: /**
 3:  * CONTENIDO Chain.
 4:  * Category access feature.
 5:  *
 6:  * @package          Core
 7:  * @subpackage       Chain
 8:  * @version          SVN Revision $Rev:$
 9:  *
10:  * @author           Unknown
11:  * @copyright        four for business AG <www.4fb.de>
12:  * @license          http://www.contenido.org/license/LIZENZ.txt
13:  * @link             http://www.4fb.de
14:  * @link             http://www.contenido.org
15:  */
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17: 
18: 
19: function cecFrontendCategoryAccess($idlang, $idcat, $user)
20: {
21:     global $cfg;
22: 
23:     $db = cRegistry::getDb();
24: 
25:     $frontendUser = new cApiFrontendUser();
26:     $frontendUser->loadByPrimaryKey($user);
27: 
28:     if ($frontendUser->virgin) {
29:         return false;
30:     }
31: 
32:     $groups = $frontendUser->getGroupsForUser();
33: 
34:     $frontendPermissionCollection = new cApiFrontendPermissionCollection();
35: 
36:     $sql = "SELECT idcatlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat = " . cSecurity::toInteger($idcat) . " AND idlang = " . cSecurity::toInteger($idlang);
37:     $db->query($sql);
38: 
39:     if ($db->nextRecord()) {
40:         $idcatlang = $db->f("idcatlang");
41:     } else {
42:         return false;
43:     }
44: 
45:     foreach ($groups as $group) {
46:         $allow = $frontendPermissionCollection->checkPerm($group, "category", "access", $idcatlang);
47:         if ($allow == true) {
48:             return true;
49:         }
50:     }
51: 
52:     return false;
53: }
54: 
55: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0