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