Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • 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
  • cecParseTemplate
  • CheckIfMetaTagExists
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: 
 3: /**
 4:  * CONTENIDO Chain.
 5:  * Category access feature.
 6:  *
 7:  * @package          Core
 8:  * @subpackage       Chain
 9:  * @version          SVN Revision $Rev:$
10:  *
11:  * @author           Unknown
12:  * @copyright        four for business AG <www.4fb.de>
13:  * @license          http://www.contenido.org/license/LIZENZ.txt
14:  * @link             http://www.4fb.de
15:  * @link             http://www.contenido.org
16:  */
17: 
18: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
19: 
20: /**
21:  *
22:  * @param int $idlang
23:  * @param int $idcat
24:  * @param int $idfrontenduser
25:  * @return boolean
26:  */
27: function cecFrontendCategoryAccess($idlang, $idcat, $idfrontenduser) {
28: 
29:     global $cfg;
30: 
31:     // get idcatlang from idcat & lang
32:     // TODO should use cApiCategoryLanguage::loadByCategoryIdAndLanguageId()
33:     $db = cRegistry::getDb();
34:     $db->query("
35:         SELECT
36:             idcatlang
37:         FROM
38:             " . $cfg["tab"]["cat_lang"] . "
39:         WHERE
40:             idcat = " . cSecurity::toInteger($idcat) . "
41:             AND idlang = " . cSecurity::toInteger($idlang));
42:     if ($db->nextRecord()) {
43:         $idcatlang = $db->f('idcatlang');
44:     } else {
45:         return false;
46:     }
47: 
48:     // get frontend user
49:     $frontendUser = new cApiFrontendUser();
50:     $frontendUser->loadByPrimaryKey($idfrontenduser);
51:     if (true !== $frontendUser->isLoaded()) {
52:         return false;
53:     }
54: 
55:     // check if frontend user has access through any group he belongs to
56:     $coll = new cApiFrontendPermissionCollection();
57:     foreach ($frontendUser->getGroupsForUser() as $group) {
58:         if ($coll->checkPerm($group, 'category', 'access', $idcatlang)) {
59:             return true;
60:         }
61:     }
62: 
63:     return false;
64: }
65: 
66: ?>
CMS CONTENIDO 4.9.8 API documentation generated by ApiGen 2.8.0