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

  • cAjaxRequest
  • cAutoload
  • cBackend
  • cEffectiveSetting
  • cGuiScrollListAlltranslations
  • cHTMLValidator
  • cMailer
  • cModuleFileTranslation
  • cModuleHandler
  • cModuleSearch
  • cModuleSynchronizer
  • cModuleTemplateHandler
  • CodeMirror
  • cPasswordRequest
  • cPermission
  • cRegistry
  • cSystemPurge
  • cSystemtest
  • cTinymce4Configuration
  • cTinyMCE4Editor
  • cTinyMCEEditor
  • cWYSIWYGEditor
  • FrontendList
  • HtmlParser
  • TODOBackendList
  • TreeItem
  • UploadList
  • UploadSearchResultList

Functions

  • addArtspec
  • addSortImages
  • backToMainArea
  • buildArticleSelect
  • buildCategorySelect
  • buildCategorySelectRights
  • buildHeapTable
  • buildStackString
  • buildTree
  • buildUserOrGroupPermsFromRequest
  • callPluginStore
  • cApiCatGetLevelNode
  • cApiImageCheckCachedImageValidity
  • cApiImageCheckImageEditingPosibility
  • cApiImageCheckImageEditingPossibility
  • cApiImageGetCacheFileName
  • cApiImageGetTargetDimensions
  • cApiImageIsAnimGif
  • cApiImgScale
  • cApiImgScaleGetMD5CacheFile
  • cApiImgScaleHQ
  • cApiImgScaleImageMagick
  • cApiImgScaleLQ
  • cApiIsImageMagickAvailable
  • cApiStrCleanURLCharacters
  • cApiStrNormalizeLineEndings
  • cApiStrRecodeString
  • cApiStrReplaceDiacritics
  • cApiStrTrimAfterWord
  • cApiStrTrimHard
  • cApiStrTrimSentence
  • cDeprecated
  • cDie
  • cError
  • checkLangInClients
  • checkPathInformation
  • cInclude
  • compareUrlStrings
  • conChangeTemplateForCat
  • conCopyArticle
  • conCopyArtLang
  • conCopyContainerConf
  • conCopyContent
  • conCopyMetaTags
  • conCopyTemplateConfiguration
  • conCreateLocationString
  • conDeeperCategoriesArray
  • conDeleteart
  • conEditArt
  • conEditFirstTime
  • conFetchCategoryTree
  • conFlagOnOffline
  • conGenerateCode
  • conGenerateCodeForAllArts
  • conGenerateCodeForAllArtsInCategory
  • conGenerateCodeForAllartsUsingLayout
  • conGenerateCodeForAllartsUsingMod
  • conGenerateCodeForAllArtsUsingTemplate
  • conGenerateCodeForArtInAllCategories
  • conGenerateCodeForClient
  • conGenerateKeywords
  • conGetAvailableMetaTagTypes
  • conGetCategoryArticleId
  • conGetCategoryAssignments
  • conGetContainerConfiguration
  • conGetContentFromArticle
  • conGetHtmlTranslationTable
  • conGetMetaValue
  • conGetTemplateConfigurationIdForArticle
  • conGetTemplateConfigurationIdForCategory
  • conGetTopmostCat
  • conGetUniqueArticleUrlname
  • conGetUsedModules
  • conHtmlentities
  • conHtmlEntityDecode
  • conHtmlSpecialChars
  • conIsArticleUrlnameUnique
  • conIsLocked
  • conLock
  • conLockBulkEditing
  • conMakeArticleIndex
  • conMakeCatOnline
  • conMakeInlineScript
  • conMakeOnline
  • conMakeOnlineBulkEditing
  • conMakePublic
  • conMakeStart
  • conMoveArticles
  • conPhp54Check
  • conRemoveOldCategoryArticle
  • conSaveContentEntry
  • conSetCodeFlag
  • conSetCodeFlagBulkEditing
  • conSetMetaValue
  • conSetStartArticle
  • consoleLog
  • conSyncArticle
  • copyRightsForElement
  • createBulkEditingFunction
  • createRandomName
  • createRightsForElement
  • cWarning
  • dbGetColumns
  • dbGetIndexes
  • dbGetPrimaryKeyName
  • dbTableExists
  • dbUpgradeTable
  • defineIfNotDefined
  • deleteArtspec
  • deleteRightsForElement
  • deleteSystemProperty
  • displayDatetime
  • emptyLogFile
  • endAndLogTiming
  • extractNumber
  • generateDisplayFilePath
  • generateJs
  • getAllClientsAndLanguages
  • getArtLang
  • getArtspec
  • getAvailableContentTypes
  • getCanonicalDay
  • getCanonicalMonth
  • getDirectorySize
  • getEffectiveSetting
  • getEffectiveSettingsByType
  • getEncodingByLanguage
  • getFileInformation
  • getFileType
  • getGroupOrUserName
  • getIDForArea
  • getJsHelpContext
  • getLanguageNamesByClient
  • getLanguagesByClient
  • getmicrotime
  • getNamedFrame
  • getParentAreaId
  • getRightsList
  • getSearchResults
  • getStrExpandCollapseButton
  • getSystemProperties
  • getSystemPropertiesByType
  • getSystemProperty
  • getTemplateSelect
  • getUplExpandCollapseButton
  • htmldecode
  • htmlentities_iso88592
  • humanReadableSize
  • includePlugins
  • insertEmptyStrRow
  • ipMatch
  • isAlphanumeric
  • isArchive
  • isArtInMultipleUse
  • isFunctionDisabled
  • isGroup
  • isIPv4
  • isRunningFromWeb
  • isStartArticle
  • isUtf8
  • isValidMail
  • langActivateDeactivateLanguage
  • langDeleteLanguage
  • langEditLanguage
  • langGetTextDirection
  • langNewLanguage
  • langRenameLanguage
  • layDeleteLayout
  • layEditLayout
  • machineReadableSize
  • mailLogBulkEditingFunctions
  • mailLogDecodeAddresses
  • markSubMenuItem
  • mask
  • modDeleteModule
  • modEditModule
  • phpInfoToHtml
  • plugin_include
  • prCreateURLNameLocationString
  • prDeleteCacheFileContent
  • prGetCacheFileContent
  • prResolvePathViaCategoryNames
  • prResolvePathViaURLNames
  • prWriteCacheFileContent
  • recursiveCopy
  • removeFileInformation
  • renderBackendBreadcrumb
  • renderLabel
  • renderSelectProperty
  • renderTextProperty
  • saveGroupRights
  • saveRights
  • scanDirectory
  • scanPlugins
  • sendEncodingHeader
  • set_magic_quotes_gpc
  • setArtspecDefault
  • setArtspecOnline
  • setSystemProperty
  • showTree
  • startTiming
  • statCreateLocationString
  • statDisplayTopChooser
  • statDisplayYearlyTopChooser
  • statGetAvailableMonths
  • statGetAvailableYears
  • statResetStatistic
  • statsArchive
  • statsDisplayInfo
  • statsOverviewAll
  • statsOverviewTop
  • statsOverviewTopYear
  • statsOverviewYear
  • strAssignTemplate
  • strBuildSqlValues
  • strCheckAlias
  • strCheckTreeForErrors
  • strCopyCategory
  • strCopyTree
  • strDeeperCategoriesArray
  • strDeleteCategory
  • strHasArticles
  • strHasStartArticle
  • strMakePublic
  • strMakeVisible
  • strMoveCatTargetallowed
  • strMoveDownCategory
  • strMoveSubtree
  • strMoveUpCategory
  • strNewCategory
  • strNewTree
  • strNextBackwards
  • strNextDeeper
  • strNextDeeperAll
  • strNextPost
  • strOrderedPostTreeList
  • strRemakeTreeTable
  • strRenameCategory
  • strRenameCategoryAlias
  • strSortPrePost
  • strSyncCategory
  • systemHavePerm
  • tplAutoFillModules
  • tplBrowseLayoutForContainers
  • tplcfgDuplicate
  • tplDeleteTemplate
  • tplDuplicateTemplate
  • tplEditTemplate
  • tplGetContainerDefault
  • tplGetContainerMode
  • tplGetContainerName
  • tplGetContainerNumbersInLayout
  • tplGetContainerTypes
  • tplGetInUsedData
  • tplIsTemplateInUse
  • tplPreparseLayout
  • tplProcessSendContainerConfiguration
  • updateClientCache
  • updateFileInformation
  • uplCreateFriendlyName
  • uplDirectoryListRecursive
  • uplGetDirectoriesToExclude
  • uplGetFileExtension
  • uplGetFileIcon
  • uplGetFileTypeDescription
  • uplGetThumbnail
  • uplHasFiles
  • uplHasSubdirs
  • uplmkdir
  • uplRecursiveDBDirectoryList
  • uplRecursiveDirectoryList
  • uplRenameDirectory
  • uplSearch
  • uplSyncDirectory
  • uplSyncDirectoryDBFS
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the CONTENIDO system related functions.
  5:  *
  6:  * @package          Core
  7:  * @subpackage       Backend
  8:  * @author           Unknown
  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:  * Clears CONTENIDO standard errorlog.txt
 19:  *
 20:  * @return string
 21:  *         Message if clearing was successfull or not
 22:  * 
 23:  * @throws cException
 24:  * @throws cInvalidArgumentException
 25:  */
 26: function emptyLogFile() {
 27:     global $cfg, $notification, $auth;
 28: 
 29:     if (cString::findFirstPos($auth->auth["perm"], "sysadmin") === false) {
 30:         return $notification->returnNotification("error", i18n("Can't clear error log : Access is denied!"));
 31:     }
 32: 
 33:     $tmp_notification = false;
 34: 
 35:     // clear errorlog.txt
 36:     $filename = $cfg['path']['contenido_logs'] . 'errorlog.txt';
 37: 
 38:     if (cFileHandler::exists($filename) && is_writeable($filename)) {
 39:         cFileHandler::truncate($filename);
 40:         $tmp_notification = $notification->returnNotification("ok", i18n("Error log successfully cleared!"));
 41:     } else if (cFileHandler::exists($filename) && !is_writeable($filename)) {
 42:         $tmp_notification = $notification->returnNotification("error", i18n("Can't clear error log : Access is denied!"));
 43:     }
 44: 
 45:     return $tmp_notification;
 46: }
 47: 
 48: /**
 49:  * Grabs phpinfo() output.
 50:  *
 51:  * @deprecated [2015-05-21]
 52:  *         This method is no longer supported (no replacement)
 53:  *             
 54:  * @return string
 55:  *         HTML output of phpinfo()
 56:  * 
 57:  * @throws cInvalidArgumentException
 58:  */
 59: function phpInfoToHtml() {
 60:     cDeprecated('This method is deprecated and is not needed any longer');
 61: 
 62:     // get output
 63:     ob_start();
 64:     phpinfo();
 65:     $phpInfoToHtml = ob_get_contents();
 66:     ob_end_clean();
 67: 
 68:     return $phpInfoToHtml;
 69: }
 70: 
 71: /**
 72:  * Check if the user has a right for a defined client.
 73:  *
 74:  * @param int $client
 75:  *         client id
 76:  * @return bool
 77:  *         Wether user has access or not
 78:  */
 79: function systemHavePerm($client) {
 80:     global $auth;
 81: 
 82:     if (!isset($auth->perm['perm'])) {
 83:         $auth->perm['perm'] = '';
 84:     }
 85: 
 86:     $userPerm = explode(',', $auth->auth['perm']);
 87: 
 88:     if (in_array('sysadmin', $userPerm)) { // is user sysadmin ?
 89:         return true;
 90:     } elseif (in_array('admin[' . $client . ']', $userPerm)) { // is user admin for this client ?
 91:         return true;
 92:     } elseif (in_array('client[' . $client . ']', $userPerm)) { // has user access to this client ?
 93:         return true;
 94:     }
 95:     return false;
 96: }
 97: 
 98: /**
 99:  * Check for valid ip adress
100:  *
101:  * @param string $strHostAdress
102:  *         IP adress
103:  * @return bool
104:  *         If string is a valid ip or not
105:  */
106: function isIPv4($strHostAdress) {
107:     // ip pattern needed for validation
108:     $ipPattern = "([0-9]|1?\d\d|2[0-4]\d|25[0-5])";
109:     if (preg_match("/^$ipPattern\.$ipPattern\.$ipPattern\.$ipPattern?$/", $strHostAdress)) { // ip is valid
110:         return true;
111:     }
112:     return false;
113: }
114: 
115: /**
116:  * must be done
117:  *
118:  * @deprecated [2015-05-21]
119:  *         This method is no longer supported (no replacement)
120:  *
121:  * @param string $strConUrl
122:  *         CONTENIDO fullhtmlPath
123:  * @param string $strBrowserUrl
124:  *         current browser string
125:  *
126:  * @return string
127:  *         Status of path comparement
128:  * 
129:  * @throws cInvalidArgumentException
130:  */
131: function checkPathInformation($strConUrl, $strBrowserUrl) {
132:     cDeprecated('This method is deprecated and is not needed any longer');
133: 
134:     // parse url
135:     $arrConUrl = parse_url($strConUrl);
136:     $arrBrowserUrl = parse_url($strBrowserUrl);
137: 
138:     if (isIPv4($arrConUrl['host'])) { // is
139:         if (isIPv4($arrBrowserUrl['host'])) { // is
140:             if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
141:                 return '1';
142:             }
143: 
144:             return '2';
145:         } else { // isn't
146:             $arrBrowserUrl['host'] = gethostbyname($arrBrowserUrl['host']);
147:             if (!isIPv4($arrBrowserUrl['host'])) {
148:                 return '3';
149:             }
150: 
151:             if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
152:                 return '1';
153:             }
154: 
155:             return '2';
156:         }
157:     } else { // isn't
158:         if (isIPv4($arrBrowserUrl['host'])) { //is
159:             $tmpAddr = gethostbyaddr($arrBrowserUrl['host']);
160:             $arrBrowserUrl['host'] = str_replace('-', '.', cString::getPartOfString($tmpAddr, 0, cString::findFirstPos($tmpAddr, ".")));
161: 
162:             if (isIPv4($arrBrowserUrl['host'])) {
163:                 return '3';
164:             }
165: 
166:             if (compareUrlStrings($arrConUrl, $arrBrowserUrl, true)) {
167:                 return '1';
168:             }
169: 
170:             return '2';
171:         } else { // isn't
172:             if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
173:                 return '1';
174:             }
175: 
176:             return '2';
177:         }
178:     }
179: }
180: 
181: /**
182:  * Check path informations.
183:  *
184:  * Checks two path informations against each other to get potential nonconformities.
185:  *
186:  * @deprecated [2015-05-21]
187:  *         This method is no longer supported (no replacement)
188:  *
189:  * @param array $arrConUrl
190:  * @param array $arrBrowserUrl
191:  * @param bool  $isIP
192:  *
193:  * @return bool
194:  * 
195:  * @throws cInvalidArgumentException
196:  */
197: function compareUrlStrings($arrConUrl, $arrBrowserUrl, $isIP = false) {
198:     cDeprecated('This method is deprecated and is not needed any longer');
199: 
200:     // && $isIP == false
201:     // remove 'www.' if needed
202:     if (cString::findFirstPos($arrConUrl['host'], 'www.') == 0 || cString::findFirstPos($arrBrowserUrl['host'], 'www.') == 0) {
203:         $arrConUrl['host'] = str_replace('www.', '', $arrConUrl);
204:         $arrBrowserUrl['host'] = str_replace('www.', '', $arrBrowserUrl);
205:     }
206: 
207:     $strConUrl = $arrConUrl['scheme'] . '://' . $arrConUrl['host'] . $arrConUrl['path'];
208:     $strBrowserUrl = $arrBrowserUrl['scheme'] . '://' . $arrBrowserUrl['host'] . $arrBrowserUrl['path'];
209: 
210:     if (strcmp($strConUrl, $strBrowserUrl) != 0) {
211:         return false;
212:     }
213:     return true;
214: }
215: 
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0