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
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cApiAction
  • cApiActionCollection
  • cApiActionlog
  • cApiActionlogCollection
  • cApiArea
  • cApiAreaCollection
  • cApiArticle
  • cApiArticleCollection
  • cApiArticleLanguage
  • cApiArticleLanguageCollection
  • cApiArticleLanguageVersion
  • cApiArticleLanguageVersionCollection
  • cApiArticleSpecification
  • cApiArticleSpecificationCollection
  • cApiCategory
  • cApiCategoryArticle
  • cApiCategoryArticleCollection
  • cApiCategoryCollection
  • cApiCategoryLanguage
  • cApiCategoryLanguageCollection
  • cApiCategoryTree
  • cApiCategoryTreeCollection
  • cApiClient
  • cApiClientCollection
  • cApiClientLanguage
  • cApiClientLanguageCollection
  • cApiCommunication
  • cApiCommunicationCollection
  • cApiContainer
  • cApiContainerCollection
  • cApiContainerConfiguration
  • cApiContainerConfigurationCollection
  • cApiContent
  • cApiContentCollection
  • cApiContentVersion
  • cApiContentVersionCollection
  • cApiDbfs
  • cApiDbfsCollection
  • cApiFile
  • cApiFileCollection
  • cApiFileInformation
  • cApiFileInformationCollection
  • cApiFrameFile
  • cApiFrameFileCollection
  • cApiFrontendGroup
  • cApiFrontendGroupCollection
  • cApiFrontendGroupMember
  • cApiFrontendGroupMemberCollection
  • cApiFrontendPermission
  • cApiFrontendPermissionCollection
  • cApiFrontendUser
  • cApiFrontendUserCollection
  • cApiGroup
  • cApiGroupCollection
  • cApiGroupMember
  • cApiGroupMemberCollection
  • cApiGroupProperty
  • cApiGroupPropertyCollection
  • cApiInUse
  • cApiInUseCollection
  • cApiIso3166
  • cApiIso3166Collection
  • cApiIso6392
  • cApiIso6392Collection
  • cApiKeyword
  • cApiKeywordCollection
  • cApiLanguage
  • cApiLanguageCollection
  • cApiLayout
  • cApiLayoutCollection
  • cApiMailLog
  • cApiMailLogCollection
  • cApiMailLogSuccess
  • cApiMailLogSuccessCollection
  • cApiMetaTag
  • cApiMetaTagCollection
  • cApiMetaTagVersion
  • cApiMetaTagVersionCollection
  • cApiMetaType
  • cApiMetaTypeCollection
  • cApiModule
  • cApiModuleCollection
  • cApiNavMain
  • cApiNavMainCollection
  • cApiNavSub
  • cApiNavSubCollection
  • cApiOnlineUser
  • cApiOnlineUserCollection
  • cApiPathresolveCache
  • cApiPathresolveCacheCollection
  • cApiProperty
  • cApiPropertyCollection
  • cApiRight
  • cApiRightCollection
  • cApiSearchTracking
  • cApiSearchTrackingCollection
  • cApiStat
  • cApiStatCollection
  • cApiSystemProperty
  • cApiSystemPropertyCollection
  • cApiTemplate
  • cApiTemplateCollection
  • cApiTemplateConfiguration
  • cApiTemplateConfigurationCollection
  • cApiType
  • cApiTypeCollection
  • cApiUpload
  • cApiUploadCollection
  • cApiUploadMeta
  • cApiUploadMetaCollection
  • cApiUser
  • cApiUserCollection
  • cApiUserPasswordRequest
  • cApiUserPasswordRequestCollection
  • cApiUserProperty
  • cApiUserPropertyCollection
  • NoteCollection
  • NoteItem
  • TODOCollection
  • TODOItem
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the frontend group collection and item class.
  5:  *
  6:  * @package Core
  7:  * @subpackage GenericDB_Model
  8:  * @author Murat Purc <murat@purc.de>
  9:  * @copyright four for business AG <www.4fb.de>
 10:  * @license http://www.contenido.org/license/LIZENZ.txt
 11:  * @link http://www.4fb.de
 12:  * @link http://www.contenido.org
 13:  */
 14: 
 15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 16: 
 17: /**
 18:  * Frontend group collection
 19:  *
 20:  * @package Core
 21:  * @subpackage GenericDB_Model
 22:  */
 23: class cApiFrontendGroupCollection extends ItemCollection {
 24:     /**
 25:      * Constructor to create an instance of this class.
 26:      *
 27:      * @throws cInvalidArgumentException
 28:      */
 29:     public function __construct() {
 30:         global $cfg;
 31:         parent::__construct($cfg['tab']['frontendgroups'], 'idfrontendgroup');
 32:         $this->_setItemClass('cApiFrontendGroup');
 33: 
 34:         // set the join partners so that joins can be used via link() method
 35:         $this->_setJoinPartner('cApiClientCollection');
 36:     }
 37: 
 38:     /**
 39:      * Creates a new group
 40:      *
 41:      * @param string $groupname
 42:      *         Specifies the groupname
 43:      *
 44:      * @return cApiFrontendGroup
 45:      * @throws cDbException
 46:      * @throws cException
 47:      * @throws cInvalidArgumentException
 48:      */
 49:     public function create($groupname) {
 50:         global $client;
 51: 
 52:         $group = new cApiFrontendGroup();
 53: 
 54:         // _arrInFilters = array('urlencode', 'htmlspecialchars', 'addslashes');
 55: 
 56:         $mangledGroupName = $group->_inFilter($groupname);
 57:         $this->select("idclient = " . cSecurity::toInteger($client) . " AND groupname = '" . $mangledGroupName . "'");
 58: 
 59:         if (($obj = $this->next()) !== false) {
 60:             $groupname = $groupname . md5(rand());
 61:         }
 62: 
 63:         $item = $this->createNewItem();
 64:         $item->set('idclient', $client);
 65:         $item->set('groupname', $groupname);
 66:         $item->store();
 67: 
 68:         return $item;
 69:     }
 70: 
 71:     /**
 72:      * Overridden delete method to remove groups from groupmember table
 73:      * before deleting group
 74:      *
 75:      * @param int $itemID
 76:      *         specifies the frontend user group
 77:      *
 78:      * @return bool
 79:      * 
 80:      * @throws cDbException
 81:      * @throws cException
 82:      * @throws cInvalidArgumentException
 83:      */
 84:     public function delete($itemID) {
 85:         $associations = new cApiFrontendGroupMemberCollection();
 86:         $associations->select('idfrontendgroup = ' . (int) $itemID);
 87: 
 88:         while (($item = $associations->next()) !== false) {
 89:             $associations->delete($item->get('idfrontendgroupmember'));
 90:         }
 91: 
 92:         return parent::delete($itemID);
 93:     }
 94: }
 95: 
 96: /**
 97:  * Frontend group item
 98:  *
 99:  * @package Core
100:  * @subpackage GenericDB_Model
101:  */
102: class cApiFrontendGroup extends Item
103: {
104:     /**
105:      * Constructor to create an instance of this class.
106:      *
107:      * @param mixed $mId [optional]
108:      *                   Specifies the ID of item to load
109:      *
110:      * @throws cDbException
111:      * @throws cException
112:      */
113:     public function __construct($mId = false) {
114:         global $cfg;
115:         parent::__construct($cfg['tab']['frontendgroups'], 'idfrontendgroup');
116:         if ($mId !== false) {
117:             $this->loadByPrimaryKey($mId);
118:         }
119:     }
120: }
121: 
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0