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

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
  • 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
  • conGetUsedModules
  • conHtmlentities
  • conHtmlEntityDecode
  • conHtmlSpecialChars
  • conIsLocked
  • conLock
  • conLockBulkEditing
  • conMakeArticleIndex
  • conMakeCatOnline
  • conMakeInlineScript
  • conMakeOnline
  • conMakeOnlineBulkEditing
  • conMakePublic
  • conMakeStart
  • conMoveArticles
  • conPhp54Check
  • conRemoveOldCategoryArticle
  • conSaveContentEntry
  • conSetCodeFlag
  • conSetCodeFlagBulkEditing
  • conSetMetaValue
  • 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
  • getFileContents
  • getFileInformation
  • getFileType
  • getGroupOrUserName
  • getIDForArea
  • getJsHelpContext
  • getLanguageNamesByClient
  • getLanguagesByClient
  • getmicrotime
  • getNamedFrame
  • getParam
  • getParentAreaId
  • 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
  • putFileContents
  • 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
  • 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: function emptyLogFile() {
 24:     global $cfg, $notification, $auth;
 25: 
 26:     if (strpos($auth->auth["perm"], "sysadmin") === false) {
 27:         return $notification->returnNotification("error", i18n("Can't clear error log : Access is denied!"));
 28:     }
 29: 
 30:     $tmp_notification = false;
 31: 
 32:     // clear errorlog.txt
 33:     $filename = $cfg['path']['contenido_logs'] . 'errorlog.txt';
 34: 
 35:     if (cFileHandler::exists($filename) && is_writeable($filename)) {
 36:         cFileHandler::truncate($filename);
 37:         $tmp_notification = $notification->returnNotification("ok", i18n("Error log successfully cleared!"));
 38:     } else if (cFileHandler::exists($filename) && !is_writeable($filename)) {
 39:         $tmp_notification = $notification->returnNotification("error", i18n("Can't clear error log : Access is denied!"));
 40:     }
 41: 
 42:     return $tmp_notification;
 43: }
 44: 
 45: /**
 46:  * Grabs phpinfo() output.
 47:  *
 48:  * @deprecated [2015-05-21]
 49:  *         This method is no longer supported (no replacement)
 50:  * @return string
 51:  *         HTML output of phpinfo()
 52:  */
 53: function phpInfoToHtml() {
 54:     cDeprecated('This method is deprecated and is not needed any longer');
 55: 
 56:     // get output
 57:     ob_start();
 58:     phpinfo();
 59:     $phpInfoToHtml = ob_get_contents();
 60:     ob_end_clean();
 61: 
 62:     return $phpInfoToHtml;
 63: }
 64: 
 65: /**
 66:  * Check if the user has a right for a defined client.
 67:  *
 68:  * @param int $client
 69:  *         client id
 70:  * @return bool
 71:  *         Wether user has access or not
 72:  */
 73: function systemHavePerm($client) {
 74:     global $auth;
 75: 
 76:     if (!isset($auth->perm['perm'])) {
 77:         $auth->perm['perm'] = '';
 78:     }
 79: 
 80:     $userPerm = explode(',', $auth->auth['perm']);
 81: 
 82:     if (in_array('sysadmin', $userPerm)) { // is user sysadmin ?
 83:         return true;
 84:     } elseif (in_array('admin[' . $client . ']', $userPerm)) { // is user admin for this client ?
 85:         return true;
 86:     } elseif (in_array('client[' . $client . ']', $userPerm)) { // has user access to this client ?
 87:         return true;
 88:     }
 89:     return false;
 90: }
 91: 
 92: /**
 93:  * Check for valid ip adress
 94:  *
 95:  * @param string $strHostAdress
 96:  *         IP adress
 97:  * @return bool
 98:  *         If string is a valid ip or not
 99:  */
100: function isIPv4($strHostAdress) {
101:     // ip pattern needed for validation
102:     $ipPattern = "([0-9]|1?\d\d|2[0-4]\d|25[0-5])";
103:     if (preg_match("/^$ipPattern\.$ipPattern\.$ipPattern\.$ipPattern?$/", $strHostAdress)) { // ip is valid
104:         return true;
105:     }
106:     return false;
107: }
108: 
109: /**
110:  * must be done
111:  *
112:  * @deprecated [2015-05-21]
113:  *         This method is no longer supported (no replacement)
114:  * @param string $strConUrl
115:  *         CONTENIDO fullhtmlPath
116:  * @param string $strBrowserUrl
117:  *         current browser string
118:  * @return string
119:  *         Status of path comparement
120:  */
121: function checkPathInformation($strConUrl, $strBrowserUrl) {
122:     cDeprecated('This method is deprecated and is not needed any longer');
123: 
124:     // parse url
125:     $arrConUrl = parse_url($strConUrl);
126:     $arrBrowserUrl = parse_url($strBrowserUrl);
127: 
128:     if (isIPv4($arrConUrl['host'])) { // is
129:         if (isIPv4($arrBrowserUrl['host'])) { // is
130:             if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
131:                 return '1';
132:             }
133: 
134:             return '2';
135:         } else { // isn't
136:             $arrBrowserUrl['host'] = gethostbyname($arrBrowserUrl['host']);
137:             if (!isIPv4($arrBrowserUrl['host'])) {
138:                 return '3';
139:             }
140: 
141:             if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
142:                 return '1';
143:             }
144: 
145:             return '2';
146:         }
147:     } else { // isn't
148:         if (isIPv4($arrBrowserUrl['host'])) { //is
149:             $tmpAddr = gethostbyaddr($arrBrowserUrl['host']);
150:             $arrBrowserUrl['host'] = str_replace('-', '.', substr($tmpAddr, 0, strpos($tmpAddr, ".")));
151: 
152:             if (isIPv4($arrBrowserUrl['host'])) {
153:                 return '3';
154:             }
155: 
156:             if (compareUrlStrings($arrConUrl, $arrBrowserUrl, true)) {
157:                 return '1';
158:             }
159: 
160:             return '2';
161:         } else { // isn't
162:             if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
163:                 return '1';
164:             }
165: 
166:             return '2';
167:         }
168:     }
169: }
170: 
171: /**
172:  * Check path informations.
173:  *
174:  * Checks two path informations against each other to get potential nonconformities.
175:  *
176:  * @deprecated [2015-05-21]
177:  *         This method is no longer supported (no replacement)
178:  * @param array $arrConUrl
179:  * @param array $arrBrowserUrl
180:  * @param bool $isIP
181:  * @return bool
182:  */
183: function compareUrlStrings($arrConUrl, $arrBrowserUrl, $isIP = false) {
184:     cDeprecated('This method is deprecated and is not needed any longer');
185: 
186:     // && $isIP == false
187:     // remove 'www.' if needed
188:     if (strpos($arrConUrl['host'], 'www.') == 0 || strpos($arrBrowserUrl['host'], 'www.') == 0) {
189:         $arrConUrl['host'] = str_replace('www.', '', $arrConUrl);
190:         $arrBrowserUrl['host'] = str_replace('www.', '', $arrBrowserUrl);
191:     }
192: 
193:     $strConUrl = $arrConUrl['scheme'] . '://' . $arrConUrl['host'] . $arrConUrl['path'];
194:     $strBrowserUrl = $arrBrowserUrl['scheme'] . '://' . $arrBrowserUrl['host'] . $arrBrowserUrl['path'];
195: 
196:     if (strcmp($strConUrl, $strBrowserUrl) != 0) {
197:         return false;
198:     }
199:     return true;
200: }
201: 
CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0