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
    • 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

Classes

  • LinkcheckerRepair

Functions

  • cCatPerm
  • checkLinks
  • getGroupIDs
  • linksort
  • searchFrontContentLinks
  • searchLinks
  • url_is_image
  • url_is_uri
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: /**
 3:  * This file contains function to check user rights for the linkchecker plugin.
 4:  *
 5:  * @package    Plugin
 6:  * @subpackage Linkchecker
 7:  * @version    SVN Revision $Rev:$
 8:  *
 9:  * @author     Mario Diaz
10:  * @copyright  four for business AG <www.4fb.de>
11:  * @license    http://www.contenido.org/license/LIZENZ.txt
12:  * @link       http://www.4fb.de
13:  * @link       http://www.contenido.org
14:  */
15: 
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17: 
18: function cCatPerm($widcat, $db = NULL) {
19:     global $cfg, $sess, $auth, $group_id, $_arrCatIDs_cCP;
20: 
21:     if (strpos($auth->auth['perm'], 'admin') !== FALSE) {
22:         return true;
23:     }
24: 
25:     if (is_null($db) || !is_object($db)) {
26:         $db = cRegistry::getDb();
27:     }
28: 
29:     $group_ids = getGroupIDs($db);
30:     $group_ids[] = $db->escape($auth->auth['uid']);
31: 
32:     if (!is_array($_arrCatIDs_cCP)) {
33:         $_arrCatIDs_cCP = array();
34: 
35:         $sql_inc = " user_id='";
36:         $sql_inc .= implode("' OR user_id='", $group_ids) . "' ";
37:         $sql = "SELECT idcat FROM " . $cfg['tab']['rights'] . "
38:                 WHERE idarea=6 AND idaction=359 AND ($sql_inc)";
39: 
40:         $db->query($sql);
41: 
42:         while ($db->nextRecord()) {
43:             $_arrCatIDs_cCP[$db->f('idcat')] = '';
44:         }
45:     }
46: 
47:     return array_key_exists($widcat, $_arrCatIDs_cCP);
48: }
49: 
50: function getGroupIDs(&$db) {
51:     global $cfg, $sess, $auth, $group_id, $_arrGroupIDs_gGI;
52: 
53:     if (is_array($_arrGroupIDs_gGI)) {
54:         return $_arrGroupIDs_gGI;
55:     }
56: 
57:     $sql = "SELECT group_id FROM " . $cfg["tab"]["groupmembers"] . " WHERE user_id='" . $db->escape($auth->auth["uid"]) . "'";
58:     $db->query($sql);
59: 
60:     $_arrGroupIDs_gGI = array();
61: 
62:     while ($db->nextRecord())
63:         $_arrGroupIDs_gGI[] = $db->f('group_id');
64: 
65:     return $_arrGroupIDs_gGI;
66: }
67: 
68: ?>
CMS CONTENIDO 4.9.3 API documentation generated by ApiGen 2.8.0