Merge pull request 'Merge latest PHP8 changes to develop' (#31) from dev_php8 into develop

Reviewed-on: #31
Dieser Commit ist enthalten in:
Ortwin Pinke 2022-05-23 17:18:43 +00:00
Commit 6a150745dd
84 geänderte Dateien mit 4531 neuen und 3471 gelöschten Zeilen

4
.gitignore vendored
Datei anzeigen

@ -17,3 +17,7 @@
/cms/dflip/ /cms/dflip/
/cms/js/firstlevel/ /cms/js/firstlevel/
/conlite/external/**/.git /conlite/external/**/.git
/dievino/
/conlite/logs/debug.log
/cms/data/config/production/config.mod_rewrite.php
/cms/data/config/production/config.local.php

Datei anzeigen

@ -14,7 +14,11 @@
# $Id: htaccess_simple.txt 145 2019-10-25 16:00:47Z oldperl $ # $Id: htaccess_simple.txt 145 2019-10-25 16:00:47Z oldperl $
################################################################################ ################################################################################
#SetEnv CONLITE_ENVIRONMENT development # easily set this enviroment variable to the config you want to use
# add a config folder with the same name in data/config and cms/data/config
# and use your custom config for development
#SetEnv CONLITE_ENVIRONMENT develop
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
@ -33,7 +37,7 @@
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR] RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR]
RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC] RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC]
RewriteRule ^.* - [F,L] # all matching conditions from above will end in nirvana RewriteRule ^.* - [F,L,DPI] # all matching conditions from above will end in nirvana
# Rewrite request to root to front_content.php # Rewrite request to root to front_content.php
RewriteRule ^$ front_content.php [QSA,L] RewriteRule ^$ front_content.php [QSA,L]
@ -44,7 +48,7 @@
RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ - [NC,L,DPI]
# Pass other requests to front_content.php # Pass other requests to front_content.php
RewriteRule ^.*$ front_content.php [QSA,NC,L] RewriteRule ^.*$ front_content.php [QSA,NC,L]

Datei anzeigen

@ -1,5 +1,5 @@
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
This is the readme file for ConLite 2.1.3 This is the readme file for ConLite 2.2.0 beta
Any help you need you may find by visiting the following links. Any help you need you may find by visiting the following links.
@ -56,6 +56,8 @@ FS#25 - Collision with pre-installed AMR after Migration
** History / Changelog ** ** History / Changelog **
ConLite 2.2.0 beta
ConLite 2.1.3 ConLite 2.1.3
ConLite 2.1.2 ConLite 2.1.2
ConLite 2.1.1 ConLite 2.1.1

Datei anzeigen

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

Datei anzeigen

@ -1,5 +1,5 @@
/* /*
Simple Responsive Template v 1.2 Simple Responsive Template v 1.2 test
primary styles primary styles

Datei anzeigen

@ -93,7 +93,7 @@ if ($cfg["use_pseudocron"] == true) {
* PHPLIB application development toolkit * PHPLIB application development toolkit
* @see http://sourceforge.net/projects/phplib * @see http://sourceforge.net/projects/phplib
*/ */
if ($contenido) { if (!empty($contenido)) {
//Backend //Backend
page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm')); page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang); i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang);
@ -102,33 +102,24 @@ if ($contenido) {
page_open(array('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm')); page_open(array('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
} }
/**
* Bugfix
* @see http://contenido.org/forum/viewtopic.php?t=18291
*
* added by H. Librenz (2007-12-07)
*/
//includePluginConf();
/**
* fixed bugfix - using functions brokes variable scopes!
*
* added by H. Librenz (2007-12-21) based on an idea of A. Lindner
*/
require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.includePluginConf.php'; require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.includePluginConf.php';
$db = new DB_Contenido; // Call hook after plugins are loaded, added by Murat Purc, 2008-09-07
CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins');
$db = new DB_ConLite();
$sess->register("cfgClient"); $sess->register("cfgClient");
$sess->register("errsite_idcat"); $sess->register("errsite_idcat");
$sess->register("errsite_idart"); $sess->register("errsite_idart");
$sess->register("encoding"); $sess->register("encoding");
if ($cfgClient["set"] != "set") { if (empty($cfgClient["set"]) || $cfgClient["set"] != "set") {
rereadClients(); rereadClients();
} }
# Check if this request is for a compressed file # Check if this request is for a compressed file
if ($_GET['action'] == 'get_compressed') { if (isset($_GET['action']) && $_GET['action'] == 'get_compressed') {
# Get the calling parameters # Get the calling parameters
$sFilename = ((isset($_GET['f'])) ? $_GET['f'] : $_GET['amp;f']); $sFilename = ((isset($_GET['f'])) ? $_GET['f'] : $_GET['amp;f']);
$sContentType = ((isset($_GET['c'])) ? $_GET['c'] : $_GET['amp;c']); $sContentType = ((isset($_GET['c'])) ? $_GET['c'] : $_GET['amp;c']);
@ -264,9 +255,9 @@ if ($idart && !$idcat && !$idcatart) {
unset($code); unset($code);
unset($markscript); unset($markscript);
if (!$idcatart) { if (empty($idcatart)) {
if (!$idart) { if (empty($idart)) {
if (!$idcat) { if (empty($idcat)) {
# Note: In earlier Contenido versions the information if an article is startarticle of a category has been stored # Note: In earlier Contenido versions the information if an article is startarticle of a category has been stored
# in relation con_cat_art. # in relation con_cat_art.
if ($cfg["is_start_compatible"] == true) { if ($cfg["is_start_compatible"] == true) {
@ -313,7 +304,7 @@ if (!$idcatart) {
$idart = $db->f("idart"); $idart = $db->f("idart");
$idcat = $db->f("idcat"); $idcat = $db->f("idcat");
} else { } else {
if ($contenido) { if (!empty($contenido)) {
cInclude("includes", "functions.i18n.php"); cInclude("includes", "functions.i18n.php");
die(i18n("No start article for this category")); die(i18n("No start article for this category"));
} else { } else {
@ -525,7 +516,7 @@ if ($contenido) {
/* If mode is 'edit' and user has permission to edit articles in the current category */ /* If mode is 'edit' and user has permission to edit articles in the current category */
if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) { if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) {
cInclude("includes", "functions.tpl.php"); cInclude("includes", "functions.tpl.php");
cInclude("includes", "functions.con.php"); cInclude("includes", "functions.con.php");
include ($cfg["path"]["contenido"] . $cfg["path"]["includes"] . "include.con_editcontent.php"); include ($cfg["path"]["contenido"] . $cfg["path"]["includes"] . "include.con_editcontent.php");
@ -606,10 +597,12 @@ if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_ar
} }
/* Add mark Script to code if user is in the backend */ /* Add mark Script to code if user is in the backend */
if(!empty($markscript)) {
$code = preg_replace("/<\/head>/i", "$markscript\n</head>", $code, 1); $code = preg_replace("/<\/head>/i", "$markscript\n</head>", $code, 1);
}
/* If article is in use, display notification */ /* If article is in use, display notification */
if ($sHtmlInUseCss && $sHtmlInUseMessage) { if (!empty($sHtmlInUseCss) && !empty($sHtmlInUseMessage)) {
$code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n</head>", $code, 1); $code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n</head>", $code, 1);
$code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1); $code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1);
} }
@ -652,7 +645,7 @@ if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_ar
WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '" . Contenido_Security::escapeDB($user_id, $db2) . "' AND A.idcat = '" . Contenido_Security::toInteger($idcat) . "' WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '" . Contenido_Security::escapeDB($user_id, $db2) . "' AND A.idcat = '" . Contenido_Security::toInteger($idcat) . "'
AND A.idarea = C.idarea AND B.idaction = A.idaction"; AND A.idarea = C.idarea AND B.idaction = A.idaction";
$db2 = new DB_Contenido; $db2 = new DB_ConLite();
$db2->query($sql); $db2->query($sql);
if ($db2->num_rows() > 0) { if ($db2->num_rows() > 0) {
@ -853,4 +846,3 @@ if (isset($savedlang)) {
$db->disconnect(); $db->disconnect();
page_close(); page_close();
?>

Datei anzeigen

@ -1,4 +1,4 @@
<!-- developer design for file list --> <!-- developer design for file list test -->
<h3>{TITLE}</h3> <h3>{TITLE}</h3>
<!-- <!--
Possible place holders for entries: Possible place holders for entries:

Datei anzeigen

@ -92,6 +92,10 @@ class DB_Sql extends DB_Sql_Abstract {
return null; return null;
} }
// PHP 8.1 fix
$driver = new mysqli_driver();
$driver->report_mode = MYSQLI_REPORT_OFF;
$dbh = mysqli_init(); $dbh = mysqli_init();
//print_r($dbh); //print_r($dbh);
if (!$dbh) { if (!$dbh) {
@ -123,7 +127,7 @@ class DB_Sql extends DB_Sql_Abstract {
$aCon['socket'] = null; $aCon['socket'] = null;
} }
if (!isset($aCon['flags'])) { if (!isset($aCon['flags'])) {
$aCon['flags'] = null; $aCon['flags'] = MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT;
} }
if (!isset($aCon['database'])) { if (!isset($aCon['database'])) {
$aCon['database'] = null; $aCon['database'] = null;
@ -134,10 +138,10 @@ class DB_Sql extends DB_Sql_Abstract {
); );
if (isset($aCon['charset'])) { if (!empty($aCon['charset'])) {
@mysqli_set_charset($dbh, $aCon['charset']); mysqli_set_charset($dbh, $aCon['charset']);
} else { } else {
@mysqli_set_charset($dbh, 'utf8'); mysqli_set_charset($dbh, 'utf8');
} }
//echo mysqli_character_set_name($dbh); //echo mysqli_character_set_name($dbh);
@ -420,10 +424,13 @@ class DB_Sql extends DB_Sql_Abstract {
* @see DB_Sql_Abstract::escape() * @see DB_Sql_Abstract::escape()
*/ */
public function escape($sString) { public function escape($sString) {
if(is_null($sString)) {
$sString = '';
}
$sResult = ''; $sResult = '';
if (is_resource($this->Link_ID) || $this->connect()) { if (is_resource($this->Link_ID) || $this->connect()) {
$sResult = mysqli_real_escape_string($this->Link_ID, $sString); $sResult = mysqli_real_escape_string($this->Link_ID, $sString);
}; }
return $sResult; return $sResult;
} }

Datei anzeigen

@ -36,7 +36,7 @@ class cApiUploadCollection extends ItemCollection {
public function sync($dir, $file) { public function sync($dir, $file) {
global $client; global $client;
if (strstr(strtolower($_ENV["OS"]), 'windows') === FALSE) { if (!empty($_ENV["OS"]) && strstr(strtolower($_ENV["OS"]), 'windows') === FALSE) {
#Unix style OS distinguish between lower and uppercase file names, i.e. test.gif is not the same as Test.gif #Unix style OS distinguish between lower and uppercase file names, i.e. test.gif is not the same as Test.gif
$this->select("dirname = BINARY '$dir' AND filename = BINARY '$file' AND idclient = '$client'"); $this->select("dirname = BINARY '$dir' AND filename = BINARY '$file' AND idclient = '$client'");
} else { } else {

Datei anzeigen

@ -17,13 +17,14 @@
* @link http://www.conlite.org ConLite.org * @link http://www.conlite.org ConLite.org
*/ */
// security check // security check
defined('CON_FRAMEWORK') or die('Illegal call'); defined('CON_FRAMEWORK') or die('Illegal call');
/*
if (!class_exists("HTML_Common2")) { if (!class_exists("HTML_Common2")) {
cInclude("pear", "HTML/Common2.php"); cInclude("pear", "HTML/Common2.php");
} }
*/
/* Global ID counter */ /* Global ID counter */
$cHTMLIDCount = 0; $cHTMLIDCount = 0;
@ -32,7 +33,7 @@ $cHTMLIDCount = 0;
* *
* @author Ortwin Pinke <o.pinke@conlite.org> * @author Ortwin Pinke <o.pinke@conlite.org>
*/ */
class cHTML extends HTML_Common2 { class cHTML extends cHTML5Common {
/** /**
* Storage of the open SGML tag template * Storage of the open SGML tag template

Datei anzeigen

@ -0,0 +1,584 @@
<?php
/**
* @category ConLite
* @package Core
* @subpackage cHTML5
* @since 2.2
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2022, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*/
/*
* HTML_Common2: port of HTML_Common package to PHP5
*
* PHP version 5
*
* LICENSE:
*
* Copyright (c) 2004-2012, Alexey Borzov <avb@php.net>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * The names of the authors may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category HTML
* @package HTML_Common2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version SVN: $Id$
* @link http://pear.php.net/package/HTML_Common2
*/
/*
* Base class for HTML classes
*
* Implements methods for working with HTML attributes, parsing and generating
* attribute strings. Port of HTML_Common class for PHP4 originally written by
* Adam Daniel with contributions from numerous other developers.
*
* @category HTML
* @package HTML_Common2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version Release: 2.1.0
* @link http://pear.php.net/package/HTML_Common2
*/
abstract class cHTML5Common implements ArrayAccess
{
/**
* Associative array of attributes
* @var array
*/
protected $attributes = array();
/**
* Changes to attributes in this list will be announced via onAttributeChange()
* method rather than performed by HTML_Common2 class itself
* @var array
* @see onAttributeChange()
*/
protected $watchedAttributes = array();
/**
* Indentation level of the element
* @var int
*/
private $_indentLevel = 0;
/**
* Comment associated with the element
* @var string
*/
private $_comment = null;
/**
* Global options for all elements generated by subclasses of HTML_Common2
*
* Preset options are
* - 'charset': charset parameter used in htmlspecialchars() calls,
* defaults to 'ISO-8859-1'
* - 'indent': string used to indent HTML elements, defaults to "\11"
* - 'linebreak': string used to indicate linebreak, defaults to "\12"
*
* @var array
*/
private static $_options = array(
'charset' => 'ISO-8859-1',
'indent' => "\11",
'linebreak' => "\12"
);
/**
* Sets global option(s)
*
* @param string|array $nameOrOptions Option name or array ('option name' => 'option value')
* @param mixed $value Option value, if first argument is not an array
*/
public static function setOption($nameOrOptions, $value = null)
{
if (is_array($nameOrOptions)) {
foreach ($nameOrOptions as $k => $v) {
self::setOption($k, $v);
}
} else {
$linebreaks = array('win' => "\15\12", 'unix' => "\12", 'mac' => "\15");
if ('linebreak' == $nameOrOptions && isset($linebreaks[$value])) {
$value = $linebreaks[$value];
}
self::$_options[$nameOrOptions] = $value;
}
}
/**
* Returns global option(s)
*
* @param string $name Option name
*
* @return mixed Option value, null if option does not exist,
* array of all options if $name is not given
*/
public static function getOption($name = null)
{
if (null === $name) {
return self::$_options;
} else {
return isset(self::$_options[$name])? self::$_options[$name]: null;
}
}
/**
* Parses the HTML attributes given as string
*
* @param string $attrString HTML attribute string
*
* @return array An associative array of attributes
*/
protected static function parseAttributes($attrString)
{
$attributes = array();
if (preg_match_all(
"/(([A-Za-z_:]|[^\\x00-\\x7F])([A-Za-z0-9_:.-]|[^\\x00-\\x7F])*)" .
"([ \\n\\t\\r]+)?(=([ \\n\\t\\r]+)?(\"[^\"]*\"|'[^']*'|[^ \\n\\t\\r]*))?/",
$attrString,
$regs
)) {
for ($i = 0; $i < count($regs[1]); $i++) {
$name = trim($regs[1][$i]);
$check = trim($regs[0][$i]);
$value = trim($regs[7][$i]);
if ($name == $check) {
$attributes[strtolower($name)] = strtolower($name);
} else {
if (!empty($value) && ($value[0] == '\'' || $value[0] == '"')) {
$value = substr($value, 1, -1);
}
$attributes[strtolower($name)] = $value;
}
}
}
return $attributes;
}
/**
* Creates a valid attribute array from either a string or an array
*
* @param string|array $attributes Array of attributes or HTML attribute string
*
* @return array An associative array of attributes
*/
protected static function prepareAttributes($attributes)
{
$prepared = array();
if (is_string($attributes)) {
return self::parseAttributes($attributes);
} elseif (is_array($attributes)) {
foreach ($attributes as $key => $value) {
if (is_int($key)) {
$key = strtolower($value);
$prepared[$key] = $key;
} else {
$prepared[strtolower($key)] = (string)$value;
}
}
}
return $prepared;
}
/**
* Removes an attribute from an attribute array
*
* @param array &$attributes Attribute array
* @param string $name Name of attribute to remove
*/
protected static function removeAttributeArray(array &$attributes, $name)
{
unset($attributes[strtolower($name)]);
}
/**
* Creates HTML attribute string from array
*
* @param array $attributes Attribute array
*
* @return string Attribute string
*/
protected static function getAttributesString(array $attributes)
{
$str = '';
$charset = self::getOption('charset');
foreach ($attributes as $key => $value) {
$str .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES, $charset) . '"';
}
return $str;
}
/**
* Class constructor, sets default attributes
*
* @param array|string $attributes Array of attribute 'name' => 'value' pairs
* or HTML attribute string
*/
public function __construct($attributes = null)
{
$this->mergeAttributes($attributes);
}
/**
* Sets the value of the attribute
*
* @param string $name Attribute name
* @param string $value Attribute value (will be set to $name if omitted)
*
* @return HTML_Common2
*/
public function setAttribute($name, $value = null)
{
$name = strtolower($name);
if (is_null($value)) {
$value = $name;
}
if (in_array($name, $this->watchedAttributes)) {
$this->onAttributeChange($name, $value);
} else {
$this->attributes[$name] = (string)$value;
}
return $this;
}
/**
* Returns the value of an attribute
*
* @param string $name Attribute name
*
* @return string|null Attribute value, null if attribute does not exist
*/
public function getAttribute($name)
{
$name = strtolower($name);
return isset($this->attributes[$name])? $this->attributes[$name]: '';
}
/**
* Sets the attributes
*
* @param string|array $attributes Array of attribute 'name' => 'value' pairs
* or HTML attribute string
*
* @return HTML_Common2
*/
public function setAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
$watched = array();
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->setAttribute($watchedKey, $attributes[$watchedKey]);
unset($attributes[$watchedKey]);
} else {
$this->removeAttribute($watchedKey);
}
if (isset($this->attributes[$watchedKey])) {
$watched[$watchedKey] = $this->attributes[$watchedKey];
}
}
$this->attributes = array_merge($watched, $attributes);
return $this;
}
/**
* Returns the attribute array or string
*
* @param bool $asString Whether to return attributes as string
*
* @return array|string
*/
public function getAttributes($asString = false)
{
if ($asString) {
return self::getAttributesString($this->attributes);
} else {
return $this->attributes;
}
}
/**
* Merges the existing attributes with the new ones
*
* @param array|string $attributes Array of attribute 'name' => 'value' pairs
* or HTML attribute string
*
* @return HTML_Common2
*/
public function mergeAttributes($attributes)
{
$attributes = self::prepareAttributes($attributes);
foreach ($this->watchedAttributes as $watchedKey) {
if (isset($attributes[$watchedKey])) {
$this->onAttributeChange($watchedKey, $attributes[$watchedKey]);
unset($attributes[$watchedKey]);
}
}
$this->attributes = array_merge($this->attributes, $attributes);
return $this;
}
/**
* Removes an attribute
*
* @param string $attribute Name of attribute to remove
*
* @return HTML_Common2
*/
public function removeAttribute($attribute)
{
if (in_array(strtolower($attribute), $this->watchedAttributes)) {
$this->onAttributeChange(strtolower($attribute), null);
} else {
self::removeAttributeArray($this->attributes, $attribute);
}
return $this;
}
/**
* Sets the indentation level
*
* @param int $level Indentation level
*
* @return HTML_Common2
*/
public function setIndentLevel($level)
{
$level = intval($level);
if (0 <= $level) {
$this->_indentLevel = $level;
}
return $this;
}
/**
* Gets the indentation level
*
* @return int
*/
public function getIndentLevel()
{
return $this->_indentLevel;
}
/**
* Returns the string to indent the element
*
* @return string
*/
protected function getIndent()
{
return str_repeat(self::getOption('indent'), $this->getIndentLevel());
}
/**
* Sets the comment for the element
*
* @param string $comment String to output as HTML comment
*
* @return HTML_Common2
*/
public function setComment($comment)
{
$this->_comment = $comment;
return $this;
}
/**
* Returns the comment associated with the element
*
* @return string
*/
public function getComment()
{
return $this->_comment;
}
/**
* Checks whether the element has given CSS class
*
* @param string $class CSS Class name
*
* @return bool
*/
public function hasClass($class)
{
$regex = '/(^|\s)' . preg_quote($class, '/') . '(\s|$)/';
return (bool)preg_match($regex, $this->getAttribute('class'));
}
/**
* Adds the given CSS class(es) to the element
*
* @param string|array $class Class name, multiple class names separated by
* whitespace, array of class names
*
* @return HTML_Common2
*/
public function addClass($class)
{
if (!is_array($class)) {
$class = preg_split('/\s+/', $class, null, PREG_SPLIT_NO_EMPTY);
}
$curClass = preg_split(
'/\s+/', $this->getAttribute('class'), null, PREG_SPLIT_NO_EMPTY
);
foreach ($class as $c) {
if (!in_array($c, $curClass)) {
$curClass[] = $c;
}
}
$this->setAttribute('class', implode(' ', $curClass));
return $this;
}
/**
* Removes the given CSS class(es) from the element
*
* @param string|array $class Class name, multiple class names separated by
* whitespace, array of class names
*
* @return HTML_Common2
*/
public function removeClass($class)
{
if (!is_array($class)) {
$class = preg_split('/\s+/', $class, null, PREG_SPLIT_NO_EMPTY);
}
$curClass = array_diff(
preg_split(
'/\s+/', $this->getAttribute('class'), null, PREG_SPLIT_NO_EMPTY
),
$class
);
if (0 == count($curClass)) {
$this->removeAttribute('class');
} else {
$this->setAttribute('class', implode(' ', $curClass));
}
return $this;
}
/**
* Returns the HTML representation of the element
*
* This magic method allows using the instances of HTML_Common2 in string
* contexts
*
* @return string
*/
abstract public function __toString();
/**
* Called if trying to change an attribute with name in $watchedAttributes
*
* This method is called for each attribute whose name is in the
* $watchedAttributes array and which is being changed by setAttribute(),
* setAttributes() or mergeAttributes() or removed via removeAttribute().
* Note that the operation for the attribute is not carried on after calling
* this method, it is the responsibility of this method to change or remove
* (or not) the attribute.
*
* @param string $name Attribute name
* @param string $value Attribute value, null if attribute is being removed
*/
protected function onAttributeChange($name, $value = null)
{
}
/**
* Whether or not an offset (HTML attribute) exists
*
* @param string $offset An offset to check for.
*
* @return boolean Returns true on success or false on failure.
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->attributes[strtolower($offset)]);
}
/**
* Returns the value at specified offset (i.e. attribute name)
*
* @param string $offset The offset to retrieve.
*
* @return string|null
* @link http://php.net/manual/en/arrayaccess.offsetget.php
* @see getAttribute()
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->getAttribute($offset);
}
/**
* Assigns a value to the specified offset (i.e. attribute name)
*
* @param string $offset The offset to assign the value to
* @param string $value The value to set
*
* @return void
* @link http://php.net/manual/en/arrayaccess.offsetset.php
* @see setAttribute()
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (null !== $offset) {
$this->setAttribute($offset, $value);
} else {
// handles $foo[] = 'disabled';
$this->setAttribute($value);
}
}
/**
* Unsets an offset (i.e. removes an attribute)
*
* @param string $offset The offset to unset
*
* @return void
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
* @see removeAttribute
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
$this->removeAttribute($offset);
}
}

Datei anzeigen

@ -283,7 +283,7 @@ class Article extends Item
*/ */
public function getContent($type, $id = NULL) public function getContent($type, $id = NULL)
{ {
if ($type == '') { if (empty($type)) {
return 'Class ' . get_class($this) . ': content-type must be specified!'; return 'Class ' . get_class($this) . ': content-type must be specified!';
} }
@ -295,7 +295,7 @@ class Article extends Item
if (is_null($id)) { if (is_null($id)) {
// return Array // return Array
return $this->content[$type]; return (empty($this->content[$type]))?'':$this->content[$type];
} }
// return String // return String

Datei anzeigen

@ -238,7 +238,7 @@ class cAutoload {
* @return (string|null) Path and filename or null * @return (string|null) Path and filename or null
*/ */
private static function _getContenidoClassFile($className) { private static function _getContenidoClassFile($className) {
$file = isset(self::$_includeFiles[$className]) ? self::$_conRootPath . self::$_includeFiles[$className] : null; $file = isset(self::$_includeFiles[$className]) ? self::$_conRootPath . self::$_includeFiles[$className] : '';
return self::_validateClassAndFile($className, $file); return self::_validateClassAndFile($className, $file);
} }
@ -247,7 +247,7 @@ class cAutoload {
* *
* @param string $className * @param string $className
* @param string $filePathName * @param string $filePathName
* @return (string|null) The file if validation was successfull, otherwhise null * @return (string) The file if validation was successfull, otherwhise empty
*/ */
private static function _validateClassAndFile($className, $filePathName) { private static function _validateClassAndFile($className, $filePathName) {
if (class_exists($className)) { if (class_exists($className)) {
@ -256,14 +256,14 @@ class cAutoload {
'file' => str_replace(self::$_conRootPath, '', $filePathName), 'file' => str_replace(self::$_conRootPath, '', $filePathName),
'error' => self::ERROR_CLASS_EXISTS 'error' => self::ERROR_CLASS_EXISTS
); );
return null; return '';
} elseif (!is_file($filePathName)) { } elseif (!is_file($filePathName)) {
self::$_errors[] = array( self::$_errors[] = array(
'class' => $className, 'class' => $className,
'file' => str_replace(self::$_conRootPath, '', $filePathName), 'file' => str_replace(self::$_conRootPath, '', $filePathName),
'error' => self::ERROR_FILE_NOT_FOUND 'error' => self::ERROR_FILE_NOT_FOUND
); );
return null; return '';
} }
return $filePathName; return $filePathName;

Datei anzeigen

@ -1712,8 +1712,13 @@ abstract class Item extends cItemBaseAbstract {
* @return mixed Filtered data * @return mixed Filtered data
*/ */
public function _inFilter($mData) { public function _inFilter($mData) {
if (is_numeric($mData) || is_array($mData)) if (is_numeric($mData) || is_array($mData)) {
return $mData; return $mData;
}
if(is_null($mData)) {
$mData = '';
}
foreach ($this->_arrInFilters as $_function) { foreach ($this->_arrInFilters as $_function) {
if (function_exists($_function)) { if (function_exists($_function)) {

Datei anzeigen

@ -672,7 +672,7 @@ class cHTMLSelectElement extends cHTMLFormElement {
*/ */
function setDefault($lvalue) { function setDefault($lvalue) {
$bSet = false; $bSet = false;
$lvalue = cString::nullToString($lvalue);
if (is_array($this->_options)) { if (is_array($this->_options)) {
foreach ($this->_options as $key => $value) { foreach ($this->_options as $key => $value) {
if (strcmp($value->getAttribute("value"), $lvalue) == 0) { if (strcmp($value->getAttribute("value"), $lvalue) == 0) {

Datei anzeigen

@ -715,4 +715,19 @@ class cString extends cStringMultiByteWrapper {
return $string; return $string;
} }
/**
* Convert null string to empty string
*
* @param string $string
* @return string
*/
public static function nullToString($string) {
//var_dump($string);
if(empty($string) || is_null($string)) {
$string = '';
}
//var_dump($string);
return $string;
}
} }

Datei anzeigen

@ -174,10 +174,10 @@ class UI_Menu {
foreach ($this->link as $key => $value) { foreach ($this->link as $key => $value) {
if ($value != NULL) { if ($value != NULL) {
if ($this->imagewidth[$key] != 0) { if (!empty($this->imagewidth[$key]) && !empty ($this->image[$key])) {
$value->setContent('<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">'); $value->setContent('<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">');
$img = $value->render(); $img = $value->render();
} else { } else if(!empty ($this->image[$key])) {
$value->setContent('<img border="0" src="' . $this->image[$key] . '">'); $value->setContent('<img border="0" src="' . $this->image[$key] . '">');
$img = $value->render(); $img = $value->render();
} }
@ -186,14 +186,12 @@ class UI_Menu {
} else { } else {
$link = $this->title[$key]; $link = $this->title[$key];
if ($this->image[$key] != "") { if (!empty($this->image[$key])) {
if ($this->imagewidth[$key] != 0) { if ($this->imagewidth[$key] != 0) {
$img = '<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">'; $img = '<img border="0" src="' . $this->image[$key] . '" width="' . $this->imagewidth[$key] . '">';
} else { } else {
$img = '<img border="0" src="' . $this->image[$key] . '">'; $img = '<img border="0" src="' . $this->image[$key] . '">';
} }
} else {
$img = "&nbsp;";
} }
} }
@ -212,21 +210,24 @@ class UI_Menu {
$bgColor = $cfg["color"]["table_light_active"]; $bgColor = $cfg["color"]["table_light_active"];
} }
if ($this->extra[$key] == 'id="marked" ') { if (!empty($this->extra[$key]) && $this->extra[$key] == 'id="marked" ') {
$bgColor = $cfg["color"]["table_light_active"]; $bgColor = $cfg["color"]["table_light_active"];
} }
} }
$tpl->set('d', 'NAME', $link); $tpl->set('d', 'NAME', $link);
if ($this->image[$key] == "") { if (empty($this->image[$key])) {
$tpl->set('d', 'ICON', ''); $tpl->set('d', 'ICON', '');
} else { } else {
$tpl->set('d', 'ICON', $img); $tpl->set('d', 'ICON', $img);
} }
if ($this->extra[$key] != "" || $this->rowmark == true) { if (!empty($this->extra[$key]) || $this->rowmark == true) {
$extraadd = ""; $extraadd = "";
if(empty($this->extra[$key])) {
$this->extra[$key] = '';
}
if ($this->rowmark == true) { if ($this->rowmark == true) {
$extraadd = 'onmouseover="row.over(this)" onmouseout="row.out(this)" onclick="row.click(this)"'; $extraadd = 'onmouseover="row.over(this)" onmouseout="row.out(this)" onclick="row.click(this)"';
@ -439,7 +440,7 @@ class UI_Table_Form {
if (is_array($this->items)) { if (is_array($this->items)) {
foreach ($this->items as $key => $value) { foreach ($this->items as $key => $value) {
if ($this->itemType[$key] == 'subheader') { if (isset($this->itemType[$key]) && $this->itemType[$key] == 'subheader') {
$subheader = '<tr class="text_medium" style="background-color: ' . $cfg["color"]["table_header"] . ';">'; $subheader = '<tr class="text_medium" style="background-color: ' . $cfg["color"]["table_header"] . ';">';
$subheader .= '<td colspan="2" valign="top" style="border: 0px;border-top: 0px; border-bottom:0px; border-right:1px;border-color: ' . $cfg["color"]["table_border"] . '; border-style: solid;">' . $this->captions[$key] . '</td></tr>'; $subheader .= '<td colspan="2" valign="top" style="border: 0px;border-top: 0px; border-bottom:0px; border-right:1px;border-color: ' . $cfg["color"]["table_border"] . '; border-style: solid;">' . $this->captions[$key] . '</td></tr>';
@ -703,6 +704,7 @@ class UI_Page {
class Link { class Link {
var $alt = '';
var $link; var $link;
var $title; var $title;
var $targetarea; var $targetarea;
@ -770,7 +772,8 @@ class Link {
function render() { function render() {
global $sess, $cfg; global $sess, $cfg;
$custom = '';
$attributes = '';
if ($this->alt != "") { if ($this->alt != "") {
$alt = 'alt="' . $this->alt . '" title="' . $this->alt . '" '; $alt = 'alt="' . $this->alt . '" title="' . $this->alt . '" ';
} else { } else {
@ -819,7 +822,7 @@ class Link {
break; break;
} }
if ($this->images == '') { if (empty($this->images)) {
return ($link . $this->content . "</a>"); return ($link . $this->content . "</a>");
} else { } else {
list($this->img_width, $this->img_height, $this->img_type, $this->img_attr) = getimagesize($cfg['path']['contenido'] . $this->images); list($this->img_width, $this->img_height, $this->img_type, $this->img_attr) = getimagesize($cfg['path']['contenido'] . $this->images);
@ -910,6 +913,7 @@ class UI_List {
$colcount = 0; $colcount = 0;
if (is_array($this->cells)) { if (is_array($this->cells)) {
$dark = true;
foreach ($this->cells as $row => $cells) { foreach ($this->cells as $row => $cells) {
$thefont = ''; $thefont = '';
$unne = ''; $unne = '';
@ -928,7 +932,7 @@ class UI_List {
$bgColor = $cfg["color"]["table_light"]; $bgColor = $cfg["color"]["table_light"];
} }
if ($this->bgcolor[$row] != "") { if (!empty($this->bgcolor[$row])) {
$bgColor = $this->bgcolor[$row]; $bgColor = $this->bgcolor[$row];
} }
@ -936,7 +940,7 @@ class UI_List {
$count = 0; $count = 0;
foreach ($cells as $key => $value) { foreach ($cells as $key => $value) {
$thefontDispl = $thefont . $this->extra[$row][$key]; $thefontDispl = $thefont . (empty($this->extra[$row][$key]))?'':$this->extra[$row][$key];
$count++; $count++;
$tpl2->reset(); $tpl2->reset();
@ -966,7 +970,7 @@ class UI_List {
$tpl2->set('s', 'ALIGN', 'left'); $tpl2->set('s', 'ALIGN', 'left');
} }
if ($this->cellvalignment[$row][$key] != "") { if (!empty($this->cellvalignment[$row][$key])) {
$tpl2->set('s', 'VALIGN', $this->cellvalignment[$row][$key]); $tpl2->set('s', 'VALIGN', $this->cellvalignment[$row][$key]);
} else { } else {
$tpl2->set('s', 'VALIGN', 'top'); $tpl2->set('s', 'VALIGN', 'top');
@ -1027,10 +1031,10 @@ class cScrollList {
var $listStart; var $listStart;
/** /**
* sortable flag * sortable array
* @var string * @var array
*/ */
var $sortable; protected $_aSortable;
/** /**
* sortlink * sortlink
@ -1080,7 +1084,7 @@ class cScrollList {
$this->resultsPerPage = 0; $this->resultsPerPage = 0;
$this->listStart = 1; $this->listStart = 1;
$this->sortable = false; $this->_aSortable = [];
$this->objTable = new cHTMLTable(); $this->objTable = new cHTMLTable();
if ($defaultstyle == true) { if ($defaultstyle == true) {
@ -1126,7 +1130,7 @@ class cScrollList {
* @param $sortable boolean true or false * @param $sortable boolean true or false
*/ */
function setSortable($key, $sortable) { function setSortable($key, $sortable) {
$this->sortable[$key] = $sortable; $this->_aSortable[$key] = $sortable;
} }
/** /**
@ -1298,8 +1302,7 @@ class cScrollList {
$this->sortkey = $field; $this->sortkey = $field;
$this->sortmode = $order; $this->sortmode = $order;
$field = intval($field) + 1;
$field = $field + 1;
$this->data = array_csort($this->data, "$field", $order); $this->data = array_csort($this->data, "$field", $order);
} }
@ -1330,8 +1333,8 @@ class cScrollList {
/* Render header */ /* Render header */
foreach ($this->header as $key => $value) { foreach ($this->header as $key => $value) {
if (is_array($this->sortable)) { if (is_array($this->_aSortable)) {
if (array_key_exists($key, $this->sortable) && $this->sortable[$key] == true) { if (array_key_exists($key, $this->_aSortable) && $this->_aSortable[$key] == true) {
$this->sortlink->setContent($value); $this->sortlink->setContent($value);
$this->sortlink->setCustom("sortby", $key); $this->sortlink->setCustom("sortby", $key);

Datei anzeigen

@ -378,6 +378,10 @@ class User {
function getUserProperty($type, $name, $group = false) { function getUserProperty($type, $name, $group = false) {
global $cfg, $perm; global $cfg, $perm;
if(empty($this->values)) {
return false;
}
if (!is_object($perm)) { if (!is_object($perm)) {
$perm = new Contenido_Perm(); $perm = new Contenido_Perm();
} }

Datei anzeigen

@ -58,7 +58,7 @@ class cRegistry {
public static function getFrontendPath() { public static function getFrontendPath() {
$cfgClient = self::getClientConfig(); $cfgClient = self::getClientConfig();
$client = self::getClientId(); $client = self::getClientId();
return $cfgClient[$client]['path']['frontend']; return (empty($cfgClient))?'':$cfgClient[$client]['path']['frontend'];
} }
/** /**

Datei anzeigen

@ -69,7 +69,7 @@ class cApiLayout extends Item {
* @param mixed $mId Specifies the ID of item to load * @param mixed $mId Specifies the ID of item to load
*/ */
public function __construct($mId = false) { public function __construct($mId = false) {
global $cfg; $cfg = cRegistry::getConfig();
parent::__construct($cfg["tab"]["lay"], "idlay"); parent::__construct($cfg["tab"]["lay"], "idlay");
$this->setFilters(array(), array()); $this->setFilters(array(), array());
@ -78,7 +78,7 @@ class cApiLayout extends Item {
$this->_setLayPath(); $this->_setLayPath();
} }
$oClient = new cApiClient($client); $oClient = new cApiClient(cRegistry::getClientId());
$aClientProp = $oClient->getPropertiesByType('layfileedit'); $aClientProp = $oClient->getPropertiesByType('layfileedit');
if(count($aClientProp) > 0) { if(count($aClientProp) > 0) {
$this->_aLayFileEditConf = array_merge($this->_aLayFileEditConf, $aClientProp); $this->_aLayFileEditConf = array_merge($this->_aLayFileEditConf, $aClientProp);

Datei anzeigen

@ -912,7 +912,7 @@ class cApiModule extends Item {
} }
private function _displayNoteFromFile($bIsOldPath = FALSE) { private function _displayNoteFromFile($bIsOldPath = FALSE) {
if ($this->_bNoted === true) { if (isset($this->_bNoted) && $this->_bNoted === true) {
return; return;
} }
global $frame, $area; global $frame, $area;
@ -1053,6 +1053,8 @@ class cApiModuleTranslationCollection extends ItemCollection {
protected $_error; protected $_error;
protected $f_obj;
/** /**
* Constructor Function * Constructor Function
* @param none * @param none

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -33,53 +34,52 @@
* - ./contenido/external/frontend/front_content.php * - ./contenido/external/frontend/front_content.php
* *
* *
* @package Contenido Backend external * @package Contenido Frontend
* @version 1.8.11 * @version 4.8
* @author unknown * @author Olaf Niemann, Jan Lengowski, Timo A. Hummel et al.
* @copyright four for business AG <www.4fb.de> * @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt * @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de * @link http://www.4fb.de
* @link http://www.contenido.org * @link http://www.contenido.org
* @since file available since contenido release <= 4.6 * @since file available since contenido release <= 4.6
*
* {@internal
* created 2003-01-21
* modified 2008-07-02, Frederic Schneider, add security fix and include class_security
* modified 2008-08-29, Murat Purc, synchronised with /cms/front_content.php
* modified 2008-11-18, Timo Trautmann: in backendeditmode also check if logged in backenduser has permission to view preview of page
* modified 2009-04-16, OliverL, check return from Contenido.Frontend.HTMLCodeOutput
* modified 2009-10-23, Murat Purc, removed deprecated function (PHP 5.3 ready)
* modified 2009-12-31, Murat Purc, fixed/modified CEC_Hook, see [#CON-256]
* modified 2010-05-20, Murat Purc, moved security checks into startup process, see [#CON-307]
* modified 2010-09-23, Murat Purc, fixed $encoding handling, see [#CON-305]
* modified 2011-02-07, Dominik Ziegler, added exit after redirections to force their execution
* modified 2011-02-10, Dominik Ziegler, moved function declaration of IP_match out of front_content.php
*
* $Id$:
* }}
*
*/ */
if (!defined("CON_FRAMEWORK")) { if (!defined("CON_FRAMEWORK")) {
define("CON_FRAMEWORK", true); define("CON_FRAMEWORK", true);
} }
# Contenido startup process $contenido_path = dirname(__FILE__, 3) . DIRECTORY_SEPARATOR;
include_once ('../../includes/startup.php');
if (!is_file($contenido_path . 'includes/startup.php')) {
die("<h1>Fatal Error</h1><br>Couldn't include ConLite startup.");
}
include_once($contenido_path . 'includes/startup.php');
rereadClients(); rereadClients();
$frontend_path = cRegistry::getClientConfig(cRegistry::getClientId())['path']['frontend'];
# include the config file of the frontend to init the Client and Language Id // Include the environment definer file
include_once ($cfgClient[$client]["path"]["frontend"]."config.php"); include_once($frontend_path . 'environment.php');
chdir($cfgClient[$client]["path"]["frontend"]);
if (defined('CL_ENVIRONMENT')) {
include_once($frontend_path . 'data/config/' . CL_ENVIRONMENT . '/config.php');
if (file_exists($frontend_path . 'data/config/' . CL_ENVIRONMENT . '/config.local.php')) {
@include($frontend_path . 'data/config/' . CL_ENVIRONMENT . '/config.local.php');
}
} else {
if (file_exists($frontend_path . 'config.php')) {
include_once($frontend_path . 'config.php');
}
if (file_exists($frontend_path . 'config.local.php')) {
include_once($frontend_path . 'config.local.php');
}
}
cInclude("includes", "functions.con.php"); cInclude("includes", "functions.con.php");
cInclude("includes", "functions.con2.php"); cInclude("includes", "functions.con2.php");
cInclude("includes", "functions.api.php"); cInclude("includes", "functions.api.php");
cInclude("includes", "functions.pathresolver.php"); cInclude("includes", "functions.pathresolver.php");
if ($cfg["use_pseudocron"] == true) if ($cfg["use_pseudocron"] == true) {
{
/* Include cronjob-Emulator */ /* Include cronjob-Emulator */
$oldpwd = getcwd(); $oldpwd = getcwd();
chdir($cfg["path"]["contenido"] . $cfg["path"]["cronjobs"]); chdir($cfg["path"]["contenido"] . $cfg["path"]["cronjobs"]);
@ -92,49 +92,48 @@ if ($cfg["use_pseudocron"] == true)
* PHPLIB application development toolkit * PHPLIB application development toolkit
* @see http://sourceforge.net/projects/phplib * @see http://sourceforge.net/projects/phplib
*/ */
if ($contenido) if (!empty($contenido)) {
{
//Backend //Backend
page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm')); page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang); i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang);
} } else {
else
{
//Frontend //Frontend
page_open(array('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm')); page_open(array('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
} }
/**
* Bugfix
* @see http://contenido.org/forum/viewtopic.php?t=18291
*
* added by H. Librenz (2007-12-07)
*/
//includePluginConf();
/**
* fixed bugfix - using functions brokes variable scopes!
*
* added by H. Librenz (2007-12-21) based on an idea of A. Lindner
*/
require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.includePluginConf.php'; require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.includePluginConf.php';
// Call hook after plugins are loaded, added by Murat Purc, 2008-09-07 // Call hook after plugins are loaded, added by Murat Purc, 2008-09-07
CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins'); CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins');
$db = new DB_ConLite; $db = new DB_ConLite();
$sess->register("cfgClient"); $sess->register("cfgClient");
$sess->register("errsite_idcat"); $sess->register("errsite_idcat");
$sess->register("errsite_idart"); $sess->register("errsite_idart");
$sess->register("encoding"); $sess->register("encoding");
if ($cfgClient["set"] != "set") if (empty($cfgClient["set"]) || $cfgClient["set"] != "set") {
{
rereadClients(); rereadClients();
} }
if (!isset($encoding) || !is_array($encoding) || count($encoding) == 0) # Check if this request is for a compressed file
{ if (isset($_GET['action']) && $_GET['action'] == 'get_compressed') {
# Get the calling parameters
$sFilename = ((isset($_GET['f'])) ? $_GET['f'] : $_GET['amp;f']);
$sContentType = ((isset($_GET['c'])) ? $_GET['c'] : $_GET['amp;c']);
# Output the file using the class output() function
Output_Compressor::output($cfgClient[$client]['path']['frontend'] . 'cache/', $sFilename, $sContentType);
# Don't do anything else
exit();
}
// Call hook after plugins are loaded, added by Murat Purc, 2008-09-07
CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins');
if (!isset($encoding) || !is_array($encoding) || count($encoding) == 0) {
// get encodings of all languages // get encodings of all languages
$encoding = array(); $encoding = array();
$sql = "SELECT idlang, encoding FROM " . $cfg["tab"]["lang"]; $sql = "SELECT idlang, encoding FROM " . $cfg["tab"]["lang"];
@ -149,11 +148,9 @@ if (!isset($encoding) || !is_array($encoding) || count($encoding) == 0)
// @TODO: Should be outsourced into startup process but requires a better detection (frontend or backend) // @TODO: Should be outsourced into startup process but requires a better detection (frontend or backend)
Contenido_Security::checkFrontendGlobals(); Contenido_Security::checkFrontendGlobals();
// update urlbuilder set http base path // update urlbuilder set http base path
Contenido_Url::getInstance()->getUrlBuilder()->setHttpBasePath($cfgClient[$client]['htmlpath']['frontend']); Contenido_Url::getInstance()->getUrlBuilder()->setHttpBasePath($cfgClient[$client]['htmlpath']['frontend']);
// Initialize language // Initialize language
if (!isset($lang)) { if (!isset($lang)) {
@ -181,11 +178,12 @@ if (!isset($lang)) {
} }
} }
if (!$sess->is_registered("lang") ) $sess->register("lang"); if (!$sess->is_registered("lang"))
if (!$sess->is_registered("client") ) $sess->register("client"); $sess->register("lang");
if (!$sess->is_registered("client"))
$sess->register("client");
if (isset ($username)) if (isset($username)) {
{
$auth->login_if(true); $auth->login_if(true);
} }
@ -198,8 +196,7 @@ header("Content-Type: text/html; charset={$encoding[$lang]}");
* if http global logout is set e.g. front_content.php?logout=true * if http global logout is set e.g. front_content.php?logout=true
* log out the current user. * log out the current user.
*/ */
if (isset ($logout)) if (isset($logout)) {
{
$auth->logout(true); $auth->logout(true);
$auth->unauth(true); $auth->unauth(true);
$auth->auth["uname"] = "nobody"; $auth->auth["uname"] = "nobody";
@ -208,8 +205,7 @@ if (isset ($logout))
/* /*
* local configuration * local configuration
*/ */
if (file_exists("config.local.php")) if (file_exists("config.local.php")) {
{
@ include ("config.local.php"); @ include ("config.local.php");
} }
@ -217,25 +213,19 @@ if (file_exists("config.local.php"))
* If the path variable was passed, try to resolve it to a Category Id * If the path variable was passed, try to resolve it to a Category Id
* e.g. front_content.php?path=/company/products/ * e.g. front_content.php?path=/company/products/
*/ */
if (isset($path) && strlen($path) > 1) if (isset($path) && strlen($path) > 1) {
{
/* Which resolve method is configured? */ /* Which resolve method is configured? */
if ($cfg["urlpathresolve"] == true) if ($cfg["urlpathresolve"] == true) {
{
$iLangCheck = 0; $iLangCheck = 0;
$idcat = prResolvePathViaURLNames($path, $iLangCheck); $idcat = prResolvePathViaURLNames($path, $iLangCheck);
} else {
}
else
{
$iLangCheck = 0; $iLangCheck = 0;
$idcat = prResolvePathViaCategoryNames($path, $iLangCheck); $idcat = prResolvePathViaCategoryNames($path, $iLangCheck);
if (($lang != $iLangCheck) && ((int) $iLangCheck != 0)) { if (($lang != $iLangCheck) && ((int) $iLangCheck != 0)) {
$lang = $iLangCheck; $lang = $iLangCheck;
} }
} }
} }
@ -246,20 +236,17 @@ $aParams = array (
); );
$errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams); $errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams);
/* /*
* Try to initialize variables $idcat, $idart, $idcatart, $idartlang * Try to initialize variables $idcat, $idart, $idcatart, $idartlang
* Note: These variables can be set via http globals e.g. front_content.php?idcat=41&idart=34&idcatart=35&idartlang=42 * Note: These variables can be set via http globals e.g. front_content.php?idcat=41&idart=34&idcatart=35&idartlang=42
* If not the values will be computed. * If not the values will be computed.
*/ */
if ($idart && !$idcat && !$idcatart) if ($idart && !$idcat && !$idcatart) {
{
/* Try to fetch the first idcat */ /* Try to fetch the first idcat */
$sql = "SELECT idcat FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "'"; $sql = "SELECT idcat FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "'";
$db->query($sql); $db->query($sql);
if ($db->next_record()) if ($db->next_record()) {
{
$idcat = $db->f("idcat"); $idcat = $db->f("idcat");
} }
} }
@ -267,16 +254,12 @@ if ($idart && !$idcat && !$idcatart)
unset($code); unset($code);
unset($markscript); unset($markscript);
if (!$idcatart) if (empty($idcatart)) {
{ if (empty($idart)) {
if (!$idart) if (empty($idcat)) {
{
if (!$idcat)
{
# Note: In earlier Contenido versions the information if an article is startarticle of a category has been stored # Note: In earlier Contenido versions the information if an article is startarticle of a category has been stored
# in relation con_cat_art. # in relation con_cat_art.
if ($cfg["is_start_compatible"] == true) if ($cfg["is_start_compatible"] == true) {
{
$sql = "SELECT $sql = "SELECT
idart, idart,
B.idcat B.idcat
@ -291,9 +274,7 @@ if (!$idcatart)
idclient='" . Contenido_Security::toInteger($client) . "' idclient='" . Contenido_Security::toInteger($client) . "'
ORDER BY ORDER BY
idtree ASC"; idtree ASC";
} } else {
else
{
# Note: Now the information if an article is startarticle of a category is stored in relation con_cat_lang. # Note: Now the information if an article is startarticle of a category is stored in relation con_cat_lang.
$sql = "SELECT $sql = "SELECT
A.idart, A.idart,
@ -318,54 +299,37 @@ if (!$idcatart)
$db->query($sql); $db->query($sql);
if ($db->next_record()) if ($db->next_record()) {
{
$idart = $db->f("idart"); $idart = $db->f("idart");
$idcat = $db->f("idcat"); $idcat = $db->f("idcat");
} } else {
else if (!empty($contenido)) {
{
if ($contenido)
{
cInclude("includes", "functions.i18n.php"); cInclude("includes", "functions.i18n.php");
die(i18n("No start article for this category")); die(i18n("No start article for this category"));
} } else {
else if ($error == 1) {
{ die("Fatal error: Could not display error page. Error to display was: 'No start article in this category'");
if ($error == 1) } else {
{
echo "Fatal error: Could not display error page. Error to display was: 'No start article in this category'";
}
else
{
header($errsite); header($errsite);
exit; exit;
} }
} }
} }
} } else {
else
{
$idart = -1; $idart = -1;
if ($cfg["is_start_compatible"] == true) if ($cfg["is_start_compatible"] == true) {
{
$sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND is_start='1'"; $sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND is_start='1'";
$db->query($sql); $db->query($sql);
if ($db->next_record()) if ($db->next_record()) {
{
$idart = $db->f("idart"); $idart = $db->f("idart");
} }
} } else {
else
{
$sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang='" . Contenido_Security::toInteger($lang) . "'"; $sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang='" . Contenido_Security::toInteger($lang) . "'";
$db->query($sql); $db->query($sql);
if ($db->next_record()) if ($db->next_record()) {
{ if ($db->f("startidartlang") != 0) {
if ($db->f("startidartlang") != 0)
{
$sql = "SELECT idart FROM " . $cfg["tab"]["art_lang"] . " WHERE idartlang='" . Contenido_Security::toInteger($db->f("startidartlang")) . "'"; $sql = "SELECT idart FROM " . $cfg["tab"]["art_lang"] . " WHERE idartlang='" . Contenido_Security::toInteger($db->f("startidartlang")) . "'";
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
@ -374,25 +338,17 @@ if (!$idcatart)
} }
} }
if ($idart != -1) if ($idart != -1) {
{
} } else {
else
{
// error message in backend // error message in backend
if ($contenido) if ($contenido) {
{
cInclude("includes", "functions.i18n.php"); cInclude("includes", "functions.i18n.php");
die(i18n("No start article for this category")); die(i18n("No start article for this category"));
} } else {
else if ($error == 1) {
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No start article in this category'"; echo "Fatal error: Could not display error page. Error to display was: 'No start article in this category'";
} } else {
else
{
header($errsite); header($errsite);
exit; exit;
} }
@ -400,9 +356,7 @@ if (!$idcatart)
} }
} }
} }
} } else {
else
{
$sql = "SELECT idcat, idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcatart='" . Contenido_Security::toInteger($idcatart) . "'"; $sql = "SELECT idcat, idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcatart='" . Contenido_Security::toInteger($idcatart) . "'";
$db->query($sql); $db->query($sql);
@ -413,8 +367,7 @@ else
} }
/* Get idcatart */ /* Get idcatart */
if (0 != $idart && 0 != $idcat) if (0 != $idart && 0 != $idcat) {
{
$sql = "SELECT idcatart FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "' AND idcat = '" . Contenido_Security::toInteger($idcat) . "'"; $sql = "SELECT idcatart FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "' AND idcat = '" . Contenido_Security::toInteger($idcat) . "'";
$db->query($sql); $db->query($sql);
@ -425,8 +378,7 @@ if (0 != $idart && 0 != $idcat)
$idartlang = getArtLang($idart, $lang); $idartlang = getArtLang($idart, $lang);
if ($idartlang === false) if ($idartlang === false) {
{
header($errsite); header($errsite);
exit; exit;
} }
@ -444,8 +396,6 @@ if ($cfg["cache"]["disable"] != '1') {
$oCacheHandler->start($iStartTime); // $iStartTime ist optional und ist die startzeit des scriptes, z. b. am anfang von fron_content.php $oCacheHandler->start($iStartTime); // $iStartTime ist optional und ist die startzeit des scriptes, z. b. am anfang von fron_content.php
} }
// END: concache // END: concache
############################################## ##############################################
# BACKEND / FRONTEND EDITING # BACKEND / FRONTEND EDITING
############################################## ##############################################
@ -460,33 +410,36 @@ if ($cfg["cache"]["disable"] != '1') {
* The reason is to avoid cross-site scripting errors in the backend, if the backend domain differs from * The reason is to avoid cross-site scripting errors in the backend, if the backend domain differs from
* the frontend domain. * the frontend domain.
*/ */
if ($contenido) if ($contenido) {
{
$perm->load_permissions(); $perm->load_permissions();
/* Change mode edit / view */ /* Change mode edit / view */
if (isset ($changeview)) if (isset($changeview)) {
{
$sess->register("view"); $sess->register("view");
$view = $changeview; $view = $changeview;
} }
$col = new InUseCollection; $col = new InUseCollection;
if ($overrideid != "" && $overridetype != "") if (!empty($overrideid) && !empty($overridetype)) {
{
$col->removeItemMarks($overridetype, $overrideid); $col->removeItemMarks($overridetype, $overrideid);
} }
/* Remove all own marks */ /* Remove all own marks */
$col->removeSessionMarks($sess->id); $col->removeSessionMarks($sess->id);
/* If the override flag is set, override a specific InUseItem */ /* If the override flag is set, override a specific InUseItem */
if(empty($type)) {
$type = '';
}
if(empty($typenr)) {
$typenr = '';
}
list ($inUse, $message) = $col->checkAndMark("article", $idartlang, true, i18n("Article is in use by %s (%s)"), true, $cfg['path']['contenido_fullhtml'] . "external/backendedit/front_content.php?changeview=edit&action=con_editart&idartlang=$idartlang&type=$type&typenr=$typenr&idart=$idart&idcat=$idcat&idcatart=$idcatart&client=$client&lang=$lang"); list ($inUse, $message) = $col->checkAndMark("article", $idartlang, true, i18n("Article is in use by %s (%s)"), true, $cfg['path']['contenido_fullhtml'] . "external/backendedit/front_content.php?changeview=edit&action=con_editart&idartlang=$idartlang&type=$type&typenr=$typenr&idart=$idart&idcat=$idcat&idcatart=$idcatart&client=$client&lang=$lang");
$sHtmlInUse = ''; $sHtmlInUse = '';
$sHtmlInUseMessage = ''; $sHtmlInUseMessage = '';
if ($inUse == true) if ($inUse == true) {
{
$disabled = 'disabled="disabled"'; $disabled = 'disabled="disabled"';
$sHtmlInUseCss = '<link rel="stylesheet" type="text/css" href="' . $cfg['path']['contenido_fullhtml'] . 'styles/inuse.css" />'; $sHtmlInUseCss = '<link rel="stylesheet" type="text/css" href="' . $cfg['path']['contenido_fullhtml'] . 'styles/inuse.css" />';
$sHtmlInUseMessage = $message; $sHtmlInUseMessage = $message;
@ -496,8 +449,7 @@ if ($contenido)
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
$locked = $db->f("locked"); $locked = $db->f("locked");
if ($locked == 1) if ($locked == 1) {
{
$inUse = true; $inUse = true;
$disabled = 'disabled="disabled"'; $disabled = 'disabled="disabled"';
} }
@ -508,13 +460,11 @@ if ($contenido)
'Contenido.Frontend.AllowEdit', $lang, $idcat, $idart, $auth->auth['uid'] 'Contenido.Frontend.AllowEdit', $lang, $idcat, $idart, $auth->auth['uid']
); );
if ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat) && $inUse == false && $allow == true) if ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat) && $inUse == false && $allow == true) {
{
/* Create buttons for editing */ /* Create buttons for editing */
$edit_preview = '<table cellspacing="0" cellpadding="4" border="0">'; $edit_preview = '<table cellspacing="0" cellpadding="4" border="0">';
if ($view == "edit") if ($view == "edit") {
{
$edit_preview = '<tr> $edit_preview = '<tr>
<td width="18"> <td width="18">
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart") . '"><img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_preview.gif" alt="Preview" title="Preview" border="0"></a> <a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart") . '"><img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_preview.gif" alt="Preview" title="Preview" border="0"></a>
@ -523,9 +473,7 @@ if ($contenido)
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart") . '">Preview</a> <a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart") . '">Preview</a>
</td> </td>
</tr>'; </tr>';
} } else {
else
{
$edit_preview = '<tr> $edit_preview = '<tr>
<td width="18"> <td width="18">
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=edit&idcat=$idcat&idart=$idart") . '"><img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_edit.gif" alt="Preview" title="Preview" border="0"></a> <a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=edit&idcat=$idcat&idart=$idart") . '"><img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_edit.gif" alt="Preview" title="Preview" border="0"></a>
@ -537,14 +485,11 @@ if ($contenido)
} }
/* Display articles */ /* Display articles */
if ($cfg["is_start_compatible"] == true) if ($cfg["is_start_compatible"] == true) {
{
$sql = "SELECT idart, is_start FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' ORDER BY idart"; $sql = "SELECT idart, is_start FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' ORDER BY idart";
$db->query($sql); $db->query($sql);
} } else {
else
{
$sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' ORDER BY idart"; $sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' ORDER BY idart";
$db->query($sql); $db->query($sql);
@ -554,21 +499,15 @@ if ($contenido)
$edit_preview .= '<tr><td colspan="2"><table cellspacing="0" cellpadding="2" border="0"></tr><td style="font-family: verdana; font-size:10; color:#000000; text-decoration:none">Articles in category:<br>'; $edit_preview .= '<tr><td colspan="2"><table cellspacing="0" cellpadding="2" border="0"></tr><td style="font-family: verdana; font-size:10; color:#000000; text-decoration:none">Articles in category:<br>';
while ($db->next_record() && ($db->affected_rows() != 1)) while ($db->next_record() && ($db->affected_rows() != 1)) {
{
$class = "font-family:'Verdana'; font-size:10; color:#000000; text-decoration: underline; font-weight:normal"; $class = "font-family:'Verdana'; font-size:10; color:#000000; text-decoration: underline; font-weight:normal";
if (!isset ($idart)) if (!isset($idart)) {
{ if (isStartArticle(getArtLang($idart, $lang), $idcat, $lang)) {
if (isStartArticle(getArtLang($idart, $lang), $idcat, $lang))
{
$class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline ;font-weight:bold"; $class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline ;font-weight:bold";
} }
} } else {
else if ($idart == $db->f("idart")) {
{
if ($idart == $db->f("idart"))
{
$class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline; font-weight:bold"; $class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline; font-weight:bold";
} }
} }
@ -578,29 +517,23 @@ if ($contenido)
} }
$edit_preview .= '</td></tr></table></td></tr></table>'; $edit_preview .= '</td></tr></table></td></tr></table>';
} }
} // end if $contenido } // end if $contenido
/* If mode is 'edit' and user has permission to edit articles in the current category */ /* If mode is 'edit' and user has permission to edit articles in the current category */
if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) {
{
cInclude("includes", "functions.tpl.php"); cInclude("includes", "functions.tpl.php");
cInclude("includes", "functions.con.php"); cInclude("includes", "functions.con.php");
include ($cfg["path"]["contenido"] . $cfg["path"]["includes"] . "include.con_editcontent.php"); include ($cfg["path"]["contenido"] . $cfg["path"]["includes"] . "include.con_editcontent.php");
} } else {
else
{
############################################## ##############################################
# FRONTEND VIEW # FRONTEND VIEW
############################################## ##############################################
/* Mark submenuitem 'Preview' in the Contenido Backend (Area: Contenido --> Articles --> Preview) */ /* Mark submenuitem 'Preview' in the Contenido Backend (Area: Contenido --> Articles --> Preview) */
if ($contenido) if ($contenido) {
{
$markscript = markSubMenuItem(4, true); $markscript = markSubMenuItem(4, true);
} }
@ -623,13 +556,11 @@ else
############################################## ##############################################
/* Check if code is expired, create new code if needed */ /* Check if code is expired, create new code if needed */
if ($db->f("createcode") == 0 && $force == 0) if ($db->f("createcode") == 0 && $force == 0 && $cfg['dceModEdit']['use'] !== true && $cfg['dceLayEdit']['use'] !== true) {
{
$sql = "SELECT code FROM " . $cfg["tab"]["code"] . " WHERE idcatart = '" . Contenido_Security::toInteger($idcatart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'"; $sql = "SELECT code FROM " . $cfg["tab"]["code"] . " WHERE idcatart = '" . Contenido_Security::toInteger($idcatart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'";
$db->query($sql); $db->query($sql);
if ($db->num_rows() == 0) if ($db->num_rows() == 0) {
{
/* Include here for performance reasons */ /* Include here for performance reasons */
cInclude("includes", "functions.tpl.php"); cInclude("includes", "functions.tpl.php");
@ -639,30 +570,21 @@ else
$db->query($sql); $db->query($sql);
} }
if ($db->next_record()) if ($db->next_record()) {
{
$code = stripslashes($db->f("code")); $code = stripslashes($db->f("code"));
} } else {
else
{
if ($contenido) if ($contenido)
$code = "echo \"No code available.\";"; $code = "echo \"No code available.\";";
else else {
{ if ($error == 1) {
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No code available'"; echo "Fatal error: Could not display error page. Error to display was: 'No code available'";
} } else {
else
{
header($errsite); header($errsite);
exit; exit;
} }
} }
} }
} } else {
else
{
$sql = "DELETE FROM " . $cfg["tab"]["code"] . " WHERE idcatart = '" . Contenido_Security::toInteger($idcatart) . "'"; $sql = "DELETE FROM " . $cfg["tab"]["code"] . " WHERE idcatart = '" . Contenido_Security::toInteger($idcatart) . "'";
$db->query($sql); $db->query($sql);
@ -681,10 +603,12 @@ else
} }
/* Add mark Script to code if user is in the backend */ /* Add mark Script to code if user is in the backend */
if(!empty($markscript)) {
$code = preg_replace("/<\/head>/i", "$markscript\n</head>", $code, 1); $code = preg_replace("/<\/head>/i", "$markscript\n</head>", $code, 1);
}
/* If article is in use, display notification */ /* If article is in use, display notification */
if ($sHtmlInUseCss && $sHtmlInUseMessage) { if (!empty($sHtmlInUseCss) && !empty($sHtmlInUseMessage)) {
$code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n</head>", $code, 1); $code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n</head>", $code, 1);
$code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1); $code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1);
} }
@ -700,33 +624,26 @@ else
############################################## ##############################################
# protected categories # protected categories
############################################## ##############################################
if ($public == 0) if ($public == 0) {
{ if ($auth->auth["uid"] == "nobody") {
if ($auth->auth["uid"] == "nobody")
{
$sql = "SELECT user_id, value FROM " . $cfg["tab"]["user_prop"] . " WHERE type='frontend' and name='allowed_ip'"; $sql = "SELECT user_id, value FROM " . $cfg["tab"]["user_prop"] . " WHERE type='frontend' and name='allowed_ip'";
$db->query($sql); $db->query($sql);
while ($db->next_record()) while ($db->next_record()) {
{
$user_id = $db->f("user_id"); $user_id = $db->f("user_id");
$range = urldecode($db->f("value")); $range = urldecode($db->f("value"));
$slash = strpos($range, "/"); $slash = strpos($range, "/");
if ($slash == false) if ($slash == false) {
{
$netmask = "255.255.255.255"; $netmask = "255.255.255.255";
$network = $range; $network = $range;
} } else {
else
{
$network = substr($range, 0, $slash); $network = substr($range, 0, $slash);
$netmask = substr($range, $slash + 1, strlen($range) - $slash - 1); $netmask = substr($range, $slash + 1, strlen($range) - $slash - 1);
} }
if (IP_match($network, $netmask, $_SERVER["REMOTE_ADDR"])) if (IP_match($network, $netmask, $_SERVER["REMOTE_ADDR"])) {
{
$sql = "SELECT idright $sql = "SELECT idright
FROM " . $cfg["tab"]["rights"] . " AS A, FROM " . $cfg["tab"]["rights"] . " AS A,
" . $cfg["tab"]["actions"] . " AS B, " . $cfg["tab"]["actions"] . " AS B,
@ -737,15 +654,13 @@ else
$db2 = new DB_ConLite; $db2 = new DB_ConLite;
$db2->query($sql); $db2->query($sql);
if ($db2->num_rows() > 0) if ($db2->num_rows() > 0) {
{
$auth->auth["uid"] = $user_id; $auth->auth["uid"] = $user_id;
$validated = 1; $validated = 1;
} }
} }
} }
if ($validated != 1) if ($validated != 1) {
{
// CEC to check category access // CEC to check category access
CEC_Hook::setBreakCondition(true, false); // break at "true", default value "false" CEC_Hook::setBreakCondition(true, false); // break at "true", default value "false"
$allow = CEC_Hook::executeWhileBreakCondition( $allow = CEC_Hook::executeWhileBreakCondition(
@ -753,9 +668,7 @@ else
); );
$auth->login_if(!$allow); $auth->login_if(!$allow);
} }
} } else {
else
{
// CEC to check category access // CEC to check category access
CEC_Hook::setBreakCondition(true, false); // break at "true", default value "false" CEC_Hook::setBreakCondition(true, false); // break at "true", default value "false"
$allow = CEC_Hook::executeWhileBreakCondition( $allow = CEC_Hook::executeWhileBreakCondition(
@ -770,8 +683,7 @@ else
$allow = true; $allow = true;
} }
if (!$allow) if (!$allow) {
{
header($errsite); header($errsite);
exit; exit;
} }
@ -781,47 +693,24 @@ else
############################################## ##############################################
# statistic # statistic
############################################## ##############################################
/* Sanity: If the statistic table doesn't contain an entry, create one */ $oStatCol = new cApiStatCollection();
$sql = "SELECT idcatart FROM ".$cfg["tab"]["stat"]." WHERE idcatart = '".Contenido_Security::toInteger($idcatart)."' AND idlang='".Contenido_Security::toInteger($lang)."'"; $oStatCol->trackView($idcatart);
$db->query($sql);
if ($db->next_record())
{
/* Update the statistics. */
$sql = "UPDATE ".$cfg["tab"]["stat"]." SET visited = visited + 1 WHERE idcatart = '".Contenido_Security::toInteger($idcatart)."' AND idclient = '".Contenido_Security::toInteger($client)."'
AND idlang = '".Contenido_Security::toInteger($lang)."'";
$db->query($sql);
}
else
{
/* Insert new record */
$next = $db->nextid($cfg["tab"]["stat"]);
$sql = "INSERT INTO ".$cfg["tab"]["stat"]." (visited, idcatart, idlang, idstat, idclient) VALUES ('1', '".Contenido_Security::toInteger($idcatart)."', '".Contenido_Security::toInteger($lang)."',
'".Contenido_Security::toInteger($next)."', '".Contenido_Security::toInteger($client)."')";
$db->query($sql);
}
/* /*
* Check if an article is start article of the category * Check if an article is start article of the category
*/ */
if ($cfg["is_start_compatible"] == true) if ($cfg["is_start_compatible"] == true) {
{
$sql = "SELECT is_start FROM " . $cfg["tab"]["cat_art"] . " WHERE idcatart='" . Contenido_Security::toInteger($idcatart) . "'"; $sql = "SELECT is_start FROM " . $cfg["tab"]["cat_art"] . " WHERE idcatart='" . Contenido_Security::toInteger($idcatart) . "'";
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
$isstart = $db->f("is_start"); $isstart = $db->f("is_start");
} } else {
else
{
$sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'"; $sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'";
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
if ($db->f("idartlang") == $idartlang) if ($db->f("idartlang") == $idartlang) {
{
$isstart = 1; $isstart = 1;
} } else {
else
{
$isstart = 0; $isstart = 0;
} }
} }
@ -833,13 +722,10 @@ else
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
if (($db->f("timemgmt") == "1") && ($isstart != 1)) if (($db->f("timemgmt") == "1") && ($isstart != 1)) {
{
$sql = "SELECT online, redirect, redirect_url FROM " . $cfg["tab"]["art_lang"] . " WHERE idart='" . Contenido_Security::toInteger($idart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "' $sql = "SELECT online, redirect, redirect_url FROM " . $cfg["tab"]["art_lang"] . " WHERE idart='" . Contenido_Security::toInteger($idart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'
AND NOW() > datestart AND NOW() < dateend"; AND NOW() > datestart AND NOW() < dateend";
} } else {
else
{
$sql = "SELECT online, redirect, redirect_url FROM " . $cfg["tab"]["art_lang"] . " WHERE idart='" . Contenido_Security::toInteger($idart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'"; $sql = "SELECT online, redirect, redirect_url FROM " . $cfg["tab"]["art_lang"] . " WHERE idart='" . Contenido_Security::toInteger($idart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'";
} }
@ -857,8 +743,7 @@ else
/* /*
* generate base url * generate base url
*/ */
if ($insert_base == "true") if ($insert_base == "true") {
{
$is_XHTML = getEffectiveSetting('generator', 'xhtml', "false"); $is_XHTML = getEffectiveSetting('generator', 'xhtml', "false");
$str_base_uri = $cfgClient[$client]["path"]["htmlpath"]; $str_base_uri = $cfgClient[$client]["path"]["htmlpath"];
@ -878,10 +763,8 @@ else
/* /*
* Handle online (offline) articles * Handle online (offline) articles
*/ */
if ($online) if ($online) {
{ if ($redirect == '1' && $redirect_url != '') {
if ($redirect == '1' && $redirect_url != '')
{
page_close(); page_close();
/* /*
* Redirect to the URL defined in article properties * Redirect to the URL defined in article properties
@ -897,11 +780,8 @@ else
} }
header("Location: $redirect_url"); header("Location: $redirect_url");
exit; exit;
} } else {
else if ($cfg["debug"]["codeoutput"]) {
{
if ($cfg["debug"]["codeoutput"])
{
echo "<textarea>" . clHtmlSpecialChars($code) . "</textarea>"; echo "<textarea>" . clHtmlSpecialChars($code) . "</textarea>";
} }
@ -924,27 +804,21 @@ else
// process CEC to do some preparations before output // process CEC to do some preparations before output
$htmlCode = CEC_Hook::executeAndReturn('Contenido.Frontend.HTMLCodeOutput', $htmlCode); $htmlCode = CEC_Hook::executeAndReturn('Contenido.Frontend.HTMLCodeOutput', $htmlCode);
// process CEC to handle the compression of the output
$htmlCode = CEC_Hook::executeAndReturn('Contenido.Frontend.HTMLCodeCompression', $htmlCode);
// print output // print output
echo $htmlCode; echo $htmlCode;
} }
} }
} } else {
else
{
# if user is in the backend display offline articles # if user is in the backend display offline articles
if ($contenido) if ($contenido) {
{
eval("?>\n" . $code . "\n<?php\n"); eval("?>\n" . $code . "\n<?php\n");
} } else {
else if ($error == 1) {
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No contenido session variable set. Probable error cause: Start article in this category is not set on-line.'"; echo "Fatal error: Could not display error page. Error to display was: 'No contenido session variable set. Probable error cause: Start article in this category is not set on-line.'";
} } else {
else
{
header($errsite); header($errsite);
exit; exit;
} }
@ -968,15 +842,13 @@ if ($cfg["cache"]["disable"] != '1') {
/* /*
* configuration settings after the site is displayed. * configuration settings after the site is displayed.
*/ */
if (file_exists("config.after.php")) if (file_exists("config.after.php")) {
{
@ include ("config.after.php"); @ include ("config.after.php");
} }
if (isset ($savedlang)) if (isset($savedlang)) {
{
$lang = $savedlang; $lang = $savedlang;
} }
$db->disconnect();
page_close(); page_close();
?>

Datei anzeigen

@ -0,0 +1,2 @@
/local
/localhost

Datei anzeigen

@ -0,0 +1 @@

Datei anzeigen

@ -4,17 +4,15 @@
* Contenido Content Management System * Contenido Content Management System
* *
* Description: * Description:
* <Description> * Configuration File
* *
* Requirements: * Requirements:
* @con_php_req 5 * @con_php_req 5
* @con_template <Templatefiles>
* @con_notice <Notice>
* *
* *
* @package ContenidoBackendArea * @package ContenidoBackendArea
* @version <version> * @version 0.1
* @author <author> * @author unknown
* @copyright four for business AG <www.4fb.de> * @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt * @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de * @link http://www.4fb.de
@ -23,23 +21,25 @@
* *
* *
* {@internal * {@internal
* created <date> * created unknown
* modified 2008-07-04, bilal arslan, added security fix * modified 2008-07-03, bilal arslan, added security fix
* *
* $Id$: * $Id$:
* }} * }}
* *
*/ */
if(!defined('CON_FRAMEWORK')) { if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
// Relative path to contenido directory, for all inclusions, in most cases: "../contenido/" // Relative path to contenido directory, for all inclusions, in most cases: "../contenido/"
$contenido_path = "!PATH!"; $contenido_path = "../conlite/";
// If language isn't specified, set this client and language (ID) // If language isn't specified, set this client and language (ID)
$load_lang = "!LANG!"; $load_lang = "1";
$load_client = "!CLIENT!"; $load_client = "1";
/* Various debugging options */ /* Various debugging options */
$frontend_debug["container_display"] = false; $frontend_debug["container_display"] = false;
@ -49,5 +49,4 @@ $frontend_debug["module_timing_summary"] = false;
/* Set to 1 to brute-force module regeneration */ /* Set to 1 to brute-force module regeneration */
$force = 0; $force = 0;
?> ?>

Datei anzeigen

@ -8,9 +8,11 @@
* *
* Requirements: * Requirements:
* @con_php_req 5 * @con_php_req 5
* @con_template <Templatefiles>
* @con_notice <Notice>
*
* *
* @package ContenidoBackendArea * @package ContenidoBackendArea
* @version <version>
* @author unknown * @author unknown
* @copyright four for business AG <www.4fb.de> * @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt * @license http://www.contenido.org/license/LIZENZ.txt
@ -22,12 +24,14 @@
* {@internal * {@internal
* created unknown * created unknown
* modified 2008-06-16, H. Librenz - Hotfix: checking for potential unsecure calling * modified 2008-06-16, H. Librenz - Hotfix: checking for potential unsecure calling
* modified 2008-07-04, bilal arslan, added security fix * modified 2008-07-03, bilal arslan, added security fix
* modified 2010-05-20, Murat Purc, standardized Contenido startup and security check invocations, see [#CON-307]
* *
* $Id$: * $Id$:
* }} * }}
* *
*/ */
if (!defined("CON_FRAMEWORK")) { if (!defined("CON_FRAMEWORK")) {
define("CON_FRAMEWORK", true); define("CON_FRAMEWORK", true);
} }
@ -36,12 +40,8 @@ $contenido_path = '';
# include the config file of the frontend to init the Client and Language Id # include the config file of the frontend to init the Client and Language Id
include_once ("config.php"); include_once ("config.php");
// include security class and check request variables // Contenido startup process
include_once ($contenido_path . 'classes/class.security.php'); include_once ($contenido_path . 'includes/startup.php');
Contenido_Security::checkRequests();
include_once ($contenido_path . "includes/startup.php");
cInclude("includes", "functions.general.php");
if ($contenido) if ($contenido)
{ {

19
conlite/external/frontend/environment.php vendored Normale Datei
Datei anzeigen

@ -0,0 +1,19 @@
<?php
// Load environment config file
$configEnv = str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . '/data/config/config.environment.php';
if (file_exists($configEnv)) {
include_once($configEnv);
}
if (!defined('CL_ENVIRONMENT')) {
if (getenv('CONLITE_ENVIRONMENT')) {
define('CL_ENVIRONMENT', getenv('CONLITE_ENVIRONMENT'));
} if (getenv('CONTENIDO_ENVIRONMENT')) {
define('CL_ENVIRONMENT', getenv('CONTENIDO_ENVIRONMENT'));
} else {
define('CL_ENVIRONMENT', 'production');
}
}
//echo CL_ENVIRONMENT;

BIN
conlite/external/frontend/favicon.ico vendored Normale Datei

Binäre Datei nicht angezeigt.

Nachher

Breite:  |  Höhe:  |  Größe: 28 KiB

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -41,44 +42,37 @@
* @link http://www.4fb.de * @link http://www.4fb.de
* @link http://www.contenido.org * @link http://www.contenido.org
* @since file available since contenido release <= 4.6 * @since file available since contenido release <= 4.6
*
* {@internal
* created 2003-01-21
* modified 2008-06-16, H. Librenz, Hotfix: checking for potential unsecure call
* modified 2008-06-26, Frederic Schneider, add security fix
* modified 2008-07-02, Frederic Schneider, add more security fixes and include security_class
* modified 2008-08-29, Murat Purc, new way to execute chains
* modified 2008-09-07, Murat Purc, new chain 'Contenido.Frontend.AfterLoadPlugins'
* modified 2008-11-11, Andreas Lindner, added additional option to CEC_Hook::setConditions for frontend user acccess
* modified 2008-11-11, Andreas Lindner, Fixed typo in var name $iLangCheck (missing $)
* modified 2008-11-11, Andreas Lindner,
* modified 2008-11-18, Timo Trautmann: in backendeditmode also check if logged in backenduser has permission to view preview of page
* modified 2008-11-18, Murat Purc, add usage of Contenido_Url to create urls to frontend pages
* modified 2008-12-23, Murat Purc, fixed problems with Contenido_Url
* modified 2009-01-13, Murat Purc, changed handling of internal redirects
* modified 2009-03-02, Andreas Lindner, prevent $lang being wrongly set to 0
* modified 2009-04-16, OliverL, check return from Contenido.Frontend.HTMLCodeOutput
* modified 2009-10-23, Murat Purc, removed deprecated function (PHP 5.3 ready)
* modified 2009-10-27, Murat Purc, fixed/modified CEC_Hook, see [#CON-256]
* modified 2010-05-20, Murat Purc, moved security checks into startup process, see [#CON-307]
* modified 2010-09-23, Murat Purc, fixed $encoding handling, see [#CON-305]
* modified 2011-02-07, Dominik Ziegler, added exit after redirections to force their execution
* modified 2011-02-10, Dominik Ziegler, moved function declaration of IP_match out of front_content.php
*
* $Id$:
* }}
*
*/ */
if (!defined("CON_FRAMEWORK")) { if (!defined("CON_FRAMEWORK")) {
define("CON_FRAMEWORK", true); define("CON_FRAMEWORK", true);
} }
$contenido_path = ''; $contenido_path = '';
# include the config file of the frontend to init the Client and Language Id
include_once ("config.php");
# Contenido startup process // Set path to current frontend
$frontend_path = str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . '/';
// Include the environment definer file
include_once($frontend_path . 'environment.php');
if (defined('CL_ENVIRONMENT')) {
include_once($frontend_path . 'data/config/' . CL_ENVIRONMENT . '/config.php');
if (file_exists($frontend_path . 'data/config/' . CL_ENVIRONMENT . '/config.local.php')) {
@include($frontend_path . 'data/config/' . CL_ENVIRONMENT . '/config.local.php');
}
} else {
if(file_exists($frontend_path.'config.php')) {
include_once($frontend_path.'config.php');
}
if(file_exists($frontend_path.'config.local.php')) {
include_once($frontend_path.'config.local.php');
}
}
if (!is_file($contenido_path . 'includes/startup.php')) {
die("<h1>Fatal Error</h1><br>Couldn't include ConLite startup.");
}
include_once($contenido_path . 'includes/startup.php'); include_once($contenido_path . 'includes/startup.php');
cInclude("includes", "functions.con.php"); cInclude("includes", "functions.con.php");
@ -86,8 +80,7 @@ cInclude("includes", "functions.con2.php");
cInclude("includes", "functions.api.php"); cInclude("includes", "functions.api.php");
cInclude("includes", "functions.pathresolver.php"); cInclude("includes", "functions.pathresolver.php");
if ($cfg["use_pseudocron"] == true) if ($cfg["use_pseudocron"] == true) {
{
/* Include cronjob-Emulator */ /* Include cronjob-Emulator */
$oldpwd = getcwd(); $oldpwd = getcwd();
chdir($cfg["path"]["contenido"] . $cfg["path"]["cronjobs"]); chdir($cfg["path"]["contenido"] . $cfg["path"]["cronjobs"]);
@ -100,46 +93,33 @@ if ($cfg["use_pseudocron"] == true)
* PHPLIB application development toolkit * PHPLIB application development toolkit
* @see http://sourceforge.net/projects/phplib * @see http://sourceforge.net/projects/phplib
*/ */
if ($contenido) if (!empty($contenido)) {
{
//Backend //Backend
page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm')); page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang); i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang);
} } else {
else
{
//Frontend //Frontend
page_open(array('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm')); page_open(array('sess' => 'Contenido_Frontend_Session', 'auth' => 'Contenido_Frontend_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
} }
/**
* Bugfix
* @see http://contenido.org/forum/viewtopic.php?t=18291
*
* added by H. Librenz (2007-12-07)
*/
//includePluginConf();
/**
* fixed bugfix - using functions brokes variable scopes!
*
* added by H. Librenz (2007-12-21) based on an idea of A. Lindner
*/
require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.includePluginConf.php'; require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.includePluginConf.php';
$db = new DB_ConLite; // Call hook after plugins are loaded, added by Murat Purc, 2008-09-07
CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins');
$db = new DB_ConLite();
$sess->register("cfgClient"); $sess->register("cfgClient");
$sess->register("errsite_idcat"); $sess->register("errsite_idcat");
$sess->register("errsite_idart"); $sess->register("errsite_idart");
$sess->register("encoding"); $sess->register("encoding");
if ($cfgClient["set"] != "set") if (empty($cfgClient["set"]) || $cfgClient["set"] != "set") {
{
rereadClients(); rereadClients();
} }
# Check if this request is for a compressed file # Check if this request is for a compressed file
if ($_GET['action'] == 'get_compressed') { if (isset($_GET['action']) && $_GET['action'] == 'get_compressed') {
# Get the calling parameters # Get the calling parameters
$sFilename = ((isset($_GET['f'])) ? $_GET['f'] : $_GET['amp;f']); $sFilename = ((isset($_GET['f'])) ? $_GET['f'] : $_GET['amp;f']);
$sContentType = ((isset($_GET['c'])) ? $_GET['c'] : $_GET['amp;c']); $sContentType = ((isset($_GET['c'])) ? $_GET['c'] : $_GET['amp;c']);
@ -154,8 +134,7 @@ if ($_GET['action'] == 'get_compressed') {
// Call hook after plugins are loaded, added by Murat Purc, 2008-09-07 // Call hook after plugins are loaded, added by Murat Purc, 2008-09-07
CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins'); CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins');
if (!isset($encoding) || !is_array($encoding) || count($encoding) == 0) if (!isset($encoding) || !is_array($encoding) || count($encoding) == 0) {
{
// get encodings of all languages // get encodings of all languages
$encoding = array(); $encoding = array();
$sql = "SELECT idlang, encoding FROM " . $cfg["tab"]["lang"]; $sql = "SELECT idlang, encoding FROM " . $cfg["tab"]["lang"];
@ -170,11 +149,9 @@ if (!isset($encoding) || !is_array($encoding) || count($encoding) == 0)
// @TODO: Should be outsourced into startup process but requires a better detection (frontend or backend) // @TODO: Should be outsourced into startup process but requires a better detection (frontend or backend)
Contenido_Security::checkFrontendGlobals(); Contenido_Security::checkFrontendGlobals();
// update urlbuilder set http base path // update urlbuilder set http base path
Contenido_Url::getInstance()->getUrlBuilder()->setHttpBasePath($cfgClient[$client]['htmlpath']['frontend']); Contenido_Url::getInstance()->getUrlBuilder()->setHttpBasePath($cfgClient[$client]['htmlpath']['frontend']);
// Initialize language // Initialize language
if (!isset($lang)) { if (!isset($lang)) {
@ -202,11 +179,12 @@ if (!isset($lang)) {
} }
} }
if (!$sess->is_registered("lang") ) $sess->register("lang"); if (!$sess->is_registered("lang"))
if (!$sess->is_registered("client") ) $sess->register("client"); $sess->register("lang");
if (!$sess->is_registered("client"))
$sess->register("client");
if (isset ($username)) if (isset($username)) {
{
$auth->login_if(true); $auth->login_if(true);
} }
@ -219,8 +197,7 @@ header("Content-Type: text/html; charset={$encoding[$lang]}");
* if http global logout is set e.g. front_content.php?logout=true * if http global logout is set e.g. front_content.php?logout=true
* log out the current user. * log out the current user.
*/ */
if (isset ($logout)) if (isset($logout)) {
{
$auth->logout(true); $auth->logout(true);
$auth->unauth(true); $auth->unauth(true);
$auth->auth["uname"] = "nobody"; $auth->auth["uname"] = "nobody";
@ -229,8 +206,7 @@ if (isset ($logout))
/* /*
* local configuration * local configuration
*/ */
if (file_exists("config.local.php")) if (file_exists("config.local.php")) {
{
@ include ("config.local.php"); @ include ("config.local.php");
} }
@ -238,25 +214,19 @@ if (file_exists("config.local.php"))
* If the path variable was passed, try to resolve it to a Category Id * If the path variable was passed, try to resolve it to a Category Id
* e.g. front_content.php?path=/company/products/ * e.g. front_content.php?path=/company/products/
*/ */
if (isset($path) && strlen($path) > 1) if (isset($path) && strlen($path) > 1) {
{
/* Which resolve method is configured? */ /* Which resolve method is configured? */
if ($cfg["urlpathresolve"] == true) if ($cfg["urlpathresolve"] == true) {
{
$iLangCheck = 0; $iLangCheck = 0;
$idcat = prResolvePathViaURLNames($path, $iLangCheck); $idcat = prResolvePathViaURLNames($path, $iLangCheck);
} else {
}
else
{
$iLangCheck = 0; $iLangCheck = 0;
$idcat = prResolvePathViaCategoryNames($path, $iLangCheck); $idcat = prResolvePathViaCategoryNames($path, $iLangCheck);
if (($lang != $iLangCheck) && ((int) $iLangCheck != 0)) { if (($lang != $iLangCheck) && ((int) $iLangCheck != 0)) {
$lang = $iLangCheck; $lang = $iLangCheck;
} }
} }
} }
@ -267,20 +237,17 @@ $aParams = array (
); );
$errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams); $errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams);
/* /*
* Try to initialize variables $idcat, $idart, $idcatart, $idartlang * Try to initialize variables $idcat, $idart, $idcatart, $idartlang
* Note: These variables can be set via http globals e.g. front_content.php?idcat=41&idart=34&idcatart=35&idartlang=42 * Note: These variables can be set via http globals e.g. front_content.php?idcat=41&idart=34&idcatart=35&idartlang=42
* If not the values will be computed. * If not the values will be computed.
*/ */
if ($idart && !$idcat && !$idcatart) if ($idart && !$idcat && !$idcatart) {
{
/* Try to fetch the first idcat */ /* Try to fetch the first idcat */
$sql = "SELECT idcat FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "'"; $sql = "SELECT idcat FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "'";
$db->query($sql); $db->query($sql);
if ($db->next_record()) if ($db->next_record()) {
{
$idcat = $db->f("idcat"); $idcat = $db->f("idcat");
} }
} }
@ -288,16 +255,12 @@ if ($idart && !$idcat && !$idcatart)
unset($code); unset($code);
unset($markscript); unset($markscript);
if (!$idcatart) if (empty($idcatart)) {
{ if (empty($idart)) {
if (!$idart) if (empty($idcat)) {
{
if (!$idcat)
{
# Note: In earlier Contenido versions the information if an article is startarticle of a category has been stored # Note: In earlier Contenido versions the information if an article is startarticle of a category has been stored
# in relation con_cat_art. # in relation con_cat_art.
if ($cfg["is_start_compatible"] == true) if ($cfg["is_start_compatible"] == true) {
{
$sql = "SELECT $sql = "SELECT
idart, idart,
B.idcat B.idcat
@ -312,9 +275,7 @@ if (!$idcatart)
idclient='" . Contenido_Security::toInteger($client) . "' idclient='" . Contenido_Security::toInteger($client) . "'
ORDER BY ORDER BY
idtree ASC"; idtree ASC";
} } else {
else
{
# Note: Now the information if an article is startarticle of a category is stored in relation con_cat_lang. # Note: Now the information if an article is startarticle of a category is stored in relation con_cat_lang.
$sql = "SELECT $sql = "SELECT
A.idart, A.idart,
@ -343,7 +304,7 @@ if (!$idcatart)
$idart = $db->f("idart"); $idart = $db->f("idart");
$idcat = $db->f("idcat"); $idcat = $db->f("idcat");
} else { } else {
if($contenido) { if (!empty($contenido)) {
cInclude("includes", "functions.i18n.php"); cInclude("includes", "functions.i18n.php");
die(i18n("No start article for this category")); die(i18n("No start article for this category"));
} else { } else {
@ -357,25 +318,19 @@ if (!$idcatart)
} }
} else { } else {
$idart = -1; $idart = -1;
if ($cfg["is_start_compatible"] == true) if ($cfg["is_start_compatible"] == true) {
{
$sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND is_start='1'"; $sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND is_start='1'";
$db->query($sql); $db->query($sql);
if ($db->next_record()) if ($db->next_record()) {
{
$idart = $db->f("idart"); $idart = $db->f("idart");
} }
} } else {
else
{
$sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang='" . Contenido_Security::toInteger($lang) . "'"; $sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang='" . Contenido_Security::toInteger($lang) . "'";
$db->query($sql); $db->query($sql);
if ($db->next_record()) if ($db->next_record()) {
{ if ($db->f("startidartlang") != 0) {
if ($db->f("startidartlang") != 0)
{
$sql = "SELECT idart FROM " . $cfg["tab"]["art_lang"] . " WHERE idartlang='" . Contenido_Security::toInteger($db->f("startidartlang")) . "'"; $sql = "SELECT idart FROM " . $cfg["tab"]["art_lang"] . " WHERE idartlang='" . Contenido_Security::toInteger($db->f("startidartlang")) . "'";
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
@ -384,25 +339,17 @@ if (!$idcatart)
} }
} }
if ($idart != -1) if ($idart != -1) {
{
} } else {
else
{
// error message in backend // error message in backend
if ($contenido) if ($contenido) {
{
cInclude("includes", "functions.i18n.php"); cInclude("includes", "functions.i18n.php");
die(i18n("No start article for this category")); die(i18n("No start article for this category"));
} } else {
else if ($error == 1) {
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No start article in this category'"; echo "Fatal error: Could not display error page. Error to display was: 'No start article in this category'";
} } else {
else
{
header($errsite); header($errsite);
exit; exit;
} }
@ -410,9 +357,7 @@ if (!$idcatart)
} }
} }
} }
} } else {
else
{
$sql = "SELECT idcat, idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcatart='" . Contenido_Security::toInteger($idcatart) . "'"; $sql = "SELECT idcat, idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcatart='" . Contenido_Security::toInteger($idcatart) . "'";
$db->query($sql); $db->query($sql);
@ -423,8 +368,7 @@ else
} }
/* Get idcatart */ /* Get idcatart */
if (0 != $idart && 0 != $idcat) if (0 != $idart && 0 != $idcat) {
{
$sql = "SELECT idcatart FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "' AND idcat = '" . Contenido_Security::toInteger($idcat) . "'"; $sql = "SELECT idcatart FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "' AND idcat = '" . Contenido_Security::toInteger($idcat) . "'";
$db->query($sql); $db->query($sql);
@ -435,8 +379,7 @@ if (0 != $idart && 0 != $idcat)
$idartlang = getArtLang($idart, $lang); $idartlang = getArtLang($idart, $lang);
if ($idartlang === false) if ($idartlang === false) {
{
header($errsite); header($errsite);
exit; exit;
} }
@ -454,8 +397,6 @@ if ($cfg["cache"]["disable"] != '1') {
$oCacheHandler->start($iStartTime); // $iStartTime ist optional und ist die startzeit des scriptes, z. b. am anfang von fron_content.php $oCacheHandler->start($iStartTime); // $iStartTime ist optional und ist die startzeit des scriptes, z. b. am anfang von fron_content.php
} }
// END: concache // END: concache
############################################## ##############################################
# BACKEND / FRONTEND EDITING # BACKEND / FRONTEND EDITING
############################################## ##############################################
@ -470,21 +411,18 @@ if ($cfg["cache"]["disable"] != '1') {
* The reason is to avoid cross-site scripting errors in the backend, if the backend domain differs from * The reason is to avoid cross-site scripting errors in the backend, if the backend domain differs from
* the frontend domain. * the frontend domain.
*/ */
if ($contenido) if ($contenido) {
{
$perm->load_permissions(); $perm->load_permissions();
/* Change mode edit / view */ /* Change mode edit / view */
if (isset ($changeview)) if (isset($changeview)) {
{
$sess->register("view"); $sess->register("view");
$view = $changeview; $view = $changeview;
} }
$col = new InUseCollection; $col = new InUseCollection;
if ($overrideid != "" && $overridetype != "") if ($overrideid != "" && $overridetype != "") {
{
$col->removeItemMarks($overridetype, $overrideid); $col->removeItemMarks($overridetype, $overrideid);
} }
/* Remove all own marks */ /* Remove all own marks */
@ -495,8 +433,7 @@ if ($contenido)
$sHtmlInUse = ''; $sHtmlInUse = '';
$sHtmlInUseMessage = ''; $sHtmlInUseMessage = '';
if ($inUse == true) if ($inUse == true) {
{
$disabled = 'disabled="disabled"'; $disabled = 'disabled="disabled"';
$sHtmlInUseCss = '<link rel="stylesheet" type="text/css" href="' . $cfg['path']['contenido_fullhtml'] . 'styles/inuse.css" />'; $sHtmlInUseCss = '<link rel="stylesheet" type="text/css" href="' . $cfg['path']['contenido_fullhtml'] . 'styles/inuse.css" />';
$sHtmlInUseMessage = $message; $sHtmlInUseMessage = $message;
@ -506,8 +443,7 @@ if ($contenido)
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
$locked = $db->f("locked"); $locked = $db->f("locked");
if ($locked == 1) if ($locked == 1) {
{
$inUse = true; $inUse = true;
$disabled = 'disabled="disabled"'; $disabled = 'disabled="disabled"';
} }
@ -518,13 +454,11 @@ if ($contenido)
'Contenido.Frontend.AllowEdit', $lang, $idcat, $idart, $auth->auth['uid'] 'Contenido.Frontend.AllowEdit', $lang, $idcat, $idart, $auth->auth['uid']
); );
if ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat) && $inUse == false && $allow == true) if ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat) && $inUse == false && $allow == true) {
{
/* Create buttons for editing */ /* Create buttons for editing */
$edit_preview = '<table cellspacing="0" cellpadding="4" border="0">'; $edit_preview = '<table cellspacing="0" cellpadding="4" border="0">';
if ($view == "edit") if ($view == "edit") {
{
$edit_preview = '<tr> $edit_preview = '<tr>
<td width="18"> <td width="18">
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart") . '"><img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_preview.gif" alt="Preview" title="Preview" border="0"></a> <a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart") . '"><img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_preview.gif" alt="Preview" title="Preview" border="0"></a>
@ -533,9 +467,7 @@ if ($contenido)
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart") . '">Preview</a> <a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=prev&idcat=$idcat&idart=$idart") . '">Preview</a>
</td> </td>
</tr>'; </tr>';
} } else {
else
{
$edit_preview = '<tr> $edit_preview = '<tr>
<td width="18"> <td width="18">
<a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=edit&idcat=$idcat&idart=$idart") . '"><img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_edit.gif" alt="Preview" title="Preview" border="0"></a> <a title="Preview" style="font-family: Verdana; font-size: 10px; color: #000000; text-decoration: none" href="' . $sess->url("front_content.php?changeview=edit&idcat=$idcat&idart=$idart") . '"><img src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_edit.gif" alt="Preview" title="Preview" border="0"></a>
@ -547,14 +479,11 @@ if ($contenido)
} }
/* Display articles */ /* Display articles */
if ($cfg["is_start_compatible"] == true) if ($cfg["is_start_compatible"] == true) {
{
$sql = "SELECT idart, is_start FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' ORDER BY idart"; $sql = "SELECT idart, is_start FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' ORDER BY idart";
$db->query($sql); $db->query($sql);
} } else {
else
{
$sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' ORDER BY idart"; $sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' ORDER BY idart";
$db->query($sql); $db->query($sql);
@ -564,21 +493,15 @@ if ($contenido)
$edit_preview .= '<tr><td colspan="2"><table cellspacing="0" cellpadding="2" border="0"></tr><td style="font-family: verdana; font-size:10; color:#000000; text-decoration:none">Articles in category:<br>'; $edit_preview .= '<tr><td colspan="2"><table cellspacing="0" cellpadding="2" border="0"></tr><td style="font-family: verdana; font-size:10; color:#000000; text-decoration:none">Articles in category:<br>';
while ($db->next_record() && ($db->affected_rows() != 1)) while ($db->next_record() && ($db->affected_rows() != 1)) {
{
$class = "font-family:'Verdana'; font-size:10; color:#000000; text-decoration: underline; font-weight:normal"; $class = "font-family:'Verdana'; font-size:10; color:#000000; text-decoration: underline; font-weight:normal";
if (!isset ($idart)) if (!isset($idart)) {
{ if (isStartArticle(getArtLang($idart, $lang), $idcat, $lang)) {
if (isStartArticle(getArtLang($idart, $lang), $idcat, $lang))
{
$class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline ;font-weight:bold"; $class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline ;font-weight:bold";
} }
} } else {
else if ($idart == $db->f("idart")) {
{
if ($idart == $db->f("idart"))
{
$class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline; font-weight:bold"; $class = "font-family: verdana; font-size:10; color:#000000; text-decoration: underline; font-weight:bold";
} }
} }
@ -588,29 +511,23 @@ if ($contenido)
} }
$edit_preview .= '</td></tr></table></td></tr></table>'; $edit_preview .= '</td></tr></table></td></tr></table>';
} }
} // end if $contenido } // end if $contenido
/* If mode is 'edit' and user has permission to edit articles in the current category */ /* If mode is 'edit' and user has permission to edit articles in the current category */
if ($inUse == false && $allow == true && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat))) {
{
cInclude("includes", "functions.tpl.php"); cInclude("includes", "functions.tpl.php");
cInclude("includes", "functions.con.php"); cInclude("includes", "functions.con.php");
include ($cfg["path"]["contenido"] . $cfg["path"]["includes"] . "include.con_editcontent.php"); include ($cfg["path"]["contenido"] . $cfg["path"]["includes"] . "include.con_editcontent.php");
} } else {
else
{
############################################## ##############################################
# FRONTEND VIEW # FRONTEND VIEW
############################################## ##############################################
/* Mark submenuitem 'Preview' in the Contenido Backend (Area: Contenido --> Articles --> Preview) */ /* Mark submenuitem 'Preview' in the Contenido Backend (Area: Contenido --> Articles --> Preview) */
if ($contenido) if ($contenido) {
{
$markscript = markSubMenuItem(4, true); $markscript = markSubMenuItem(4, true);
} }
@ -633,13 +550,11 @@ else
############################################## ##############################################
/* Check if code is expired, create new code if needed */ /* Check if code is expired, create new code if needed */
if ($db->f("createcode") == 0 && $force == 0 && $cfg['dceModEdit']['use'] !== true) if ($db->f("createcode") == 0 && $force == 0 && $cfg['dceModEdit']['use'] !== true && $cfg['dceLayEdit']['use'] !== true) {
{
$sql = "SELECT code FROM " . $cfg["tab"]["code"] . " WHERE idcatart = '" . Contenido_Security::toInteger($idcatart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'"; $sql = "SELECT code FROM " . $cfg["tab"]["code"] . " WHERE idcatart = '" . Contenido_Security::toInteger($idcatart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'";
$db->query($sql); $db->query($sql);
if ($db->num_rows() == 0) if ($db->num_rows() == 0) {
{
/* Include here for performance reasons */ /* Include here for performance reasons */
cInclude("includes", "functions.tpl.php"); cInclude("includes", "functions.tpl.php");
@ -649,30 +564,21 @@ else
$db->query($sql); $db->query($sql);
} }
if ($db->next_record()) if ($db->next_record()) {
{
$code = stripslashes($db->f("code")); $code = stripslashes($db->f("code"));
} } else {
else
{
if ($contenido) if ($contenido)
$code = "echo \"No code available.\";"; $code = "echo \"No code available.\";";
else else {
{ if ($error == 1) {
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No code available'"; echo "Fatal error: Could not display error page. Error to display was: 'No code available'";
} } else {
else
{
header($errsite); header($errsite);
exit; exit;
} }
} }
} }
} } else {
else
{
$sql = "DELETE FROM " . $cfg["tab"]["code"] . " WHERE idcatart = '" . Contenido_Security::toInteger($idcatart) . "'"; $sql = "DELETE FROM " . $cfg["tab"]["code"] . " WHERE idcatart = '" . Contenido_Security::toInteger($idcatart) . "'";
$db->query($sql); $db->query($sql);
@ -691,10 +597,12 @@ else
} }
/* Add mark Script to code if user is in the backend */ /* Add mark Script to code if user is in the backend */
if(!empty($markscript)) {
$code = preg_replace("/<\/head>/i", "$markscript\n</head>", $code, 1); $code = preg_replace("/<\/head>/i", "$markscript\n</head>", $code, 1);
}
/* If article is in use, display notification */ /* If article is in use, display notification */
if ($sHtmlInUseCss && $sHtmlInUseMessage) { if (!empty($sHtmlInUseCss) && !empty($sHtmlInUseMessage)) {
$code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n</head>", $code, 1); $code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n</head>", $code, 1);
$code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1); $code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1);
} }
@ -710,33 +618,26 @@ else
############################################## ##############################################
# protected categories # protected categories
############################################## ##############################################
if ($public == 0) if ($public == 0) {
{ if ($auth->auth["uid"] == "nobody") {
if ($auth->auth["uid"] == "nobody")
{
$sql = "SELECT user_id, value FROM " . $cfg["tab"]["user_prop"] . " WHERE type='frontend' and name='allowed_ip'"; $sql = "SELECT user_id, value FROM " . $cfg["tab"]["user_prop"] . " WHERE type='frontend' and name='allowed_ip'";
$db->query($sql); $db->query($sql);
while ($db->next_record()) while ($db->next_record()) {
{
$user_id = $db->f("user_id"); $user_id = $db->f("user_id");
$range = urldecode($db->f("value")); $range = urldecode($db->f("value"));
$slash = strpos($range, "/"); $slash = strpos($range, "/");
if ($slash == false) if ($slash == false) {
{
$netmask = "255.255.255.255"; $netmask = "255.255.255.255";
$network = $range; $network = $range;
} } else {
else
{
$network = substr($range, 0, $slash); $network = substr($range, 0, $slash);
$netmask = substr($range, $slash + 1, strlen($range) - $slash - 1); $netmask = substr($range, $slash + 1, strlen($range) - $slash - 1);
} }
if (IP_match($network, $netmask, $_SERVER["REMOTE_ADDR"])) if (IP_match($network, $netmask, $_SERVER["REMOTE_ADDR"])) {
{
$sql = "SELECT idright $sql = "SELECT idright
FROM " . $cfg["tab"]["rights"] . " AS A, FROM " . $cfg["tab"]["rights"] . " AS A,
" . $cfg["tab"]["actions"] . " AS B, " . $cfg["tab"]["actions"] . " AS B,
@ -744,18 +645,16 @@ else
WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '" . Contenido_Security::escapeDB($user_id, $db2) . "' AND A.idcat = '" . Contenido_Security::toInteger($idcat) . "' WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '" . Contenido_Security::escapeDB($user_id, $db2) . "' AND A.idcat = '" . Contenido_Security::toInteger($idcat) . "'
AND A.idarea = C.idarea AND B.idaction = A.idaction"; AND A.idarea = C.idarea AND B.idaction = A.idaction";
$db2 = new DB_ConLite; $db2 = new DB_ConLite();
$db2->query($sql); $db2->query($sql);
if ($db2->num_rows() > 0) if ($db2->num_rows() > 0) {
{
$auth->auth["uid"] = $user_id; $auth->auth["uid"] = $user_id;
$validated = 1; $validated = 1;
} }
} }
} }
if ($validated != 1) if ($validated != 1) {
{
// CEC to check category access // CEC to check category access
CEC_Hook::setBreakCondition(true, false); // break at "true", default value "false" CEC_Hook::setBreakCondition(true, false); // break at "true", default value "false"
$allow = CEC_Hook::executeWhileBreakCondition( $allow = CEC_Hook::executeWhileBreakCondition(
@ -763,9 +662,7 @@ else
); );
$auth->login_if(!$allow); $auth->login_if(!$allow);
} }
} } else {
else
{
// CEC to check category access // CEC to check category access
CEC_Hook::setBreakCondition(true, false); // break at "true", default value "false" CEC_Hook::setBreakCondition(true, false); // break at "true", default value "false"
$allow = CEC_Hook::executeWhileBreakCondition( $allow = CEC_Hook::executeWhileBreakCondition(
@ -780,8 +677,7 @@ else
$allow = true; $allow = true;
} }
if (!$allow) if (!$allow) {
{
header($errsite); header($errsite);
exit; exit;
} }
@ -791,47 +687,24 @@ else
############################################## ##############################################
# statistic # statistic
############################################## ##############################################
/* Sanity: If the statistic table doesn't contain an entry, create one */ $oStatCol = new cApiStatCollection();
$sql = "SELECT idcatart FROM ".$cfg["tab"]["stat"]." WHERE idcatart = '".Contenido_Security::toInteger($idcatart)."' AND idlang='".Contenido_Security::toInteger($lang)."'"; $oStatCol->trackView($idcatart);
$db->query($sql);
if ($db->next_record())
{
/* Update the statistics. */
$sql = "UPDATE ".$cfg["tab"]["stat"]." SET visited = visited + 1 WHERE idcatart = '".Contenido_Security::toInteger($idcatart)."' AND idclient = '".Contenido_Security::toInteger($client)."'
AND idlang = '".Contenido_Security::toInteger($lang)."'";
$db->query($sql);
}
else
{
/* Insert new record */
$next = $db->nextid($cfg["tab"]["stat"]);
$sql = "INSERT INTO ".$cfg["tab"]["stat"]." (visited, idcatart, idlang, idstat, idclient) VALUES ('1', '".Contenido_Security::toInteger($idcatart)."', '".Contenido_Security::toInteger($lang)."',
'".Contenido_Security::toInteger($next)."', '".Contenido_Security::toInteger($client)."')";
$db->query($sql);
}
/* /*
* Check if an article is start article of the category * Check if an article is start article of the category
*/ */
if ($cfg["is_start_compatible"] == true) if ($cfg["is_start_compatible"] == true) {
{
$sql = "SELECT is_start FROM " . $cfg["tab"]["cat_art"] . " WHERE idcatart='" . Contenido_Security::toInteger($idcatart) . "'"; $sql = "SELECT is_start FROM " . $cfg["tab"]["cat_art"] . " WHERE idcatart='" . Contenido_Security::toInteger($idcatart) . "'";
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
$isstart = $db->f("is_start"); $isstart = $db->f("is_start");
} } else {
else
{
$sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'"; $sql = "SELECT startidartlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'";
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
if ($db->f("idartlang") == $idartlang) if ($db->f("idartlang") == $idartlang) {
{
$isstart = 1; $isstart = 1;
} } else {
else
{
$isstart = 0; $isstart = 0;
} }
} }
@ -843,13 +716,10 @@ else
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
if (($db->f("timemgmt") == "1") && ($isstart != 1)) if (($db->f("timemgmt") == "1") && ($isstart != 1)) {
{
$sql = "SELECT online, redirect, redirect_url FROM " . $cfg["tab"]["art_lang"] . " WHERE idart='" . Contenido_Security::toInteger($idart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "' $sql = "SELECT online, redirect, redirect_url FROM " . $cfg["tab"]["art_lang"] . " WHERE idart='" . Contenido_Security::toInteger($idart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'
AND NOW() > datestart AND NOW() < dateend"; AND NOW() > datestart AND NOW() < dateend";
} } else {
else
{
$sql = "SELECT online, redirect, redirect_url FROM " . $cfg["tab"]["art_lang"] . " WHERE idart='" . Contenido_Security::toInteger($idart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'"; $sql = "SELECT online, redirect, redirect_url FROM " . $cfg["tab"]["art_lang"] . " WHERE idart='" . Contenido_Security::toInteger($idart) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'";
} }
@ -867,8 +737,7 @@ else
/* /*
* generate base url * generate base url
*/ */
if ($insert_base == "true") if ($insert_base == "true") {
{
$is_XHTML = getEffectiveSetting('generator', 'xhtml', "false"); $is_XHTML = getEffectiveSetting('generator', 'xhtml', "false");
$str_base_uri = $cfgClient[$client]["path"]["htmlpath"]; $str_base_uri = $cfgClient[$client]["path"]["htmlpath"];
@ -888,10 +757,8 @@ else
/* /*
* Handle online (offline) articles * Handle online (offline) articles
*/ */
if ($online) if ($online) {
{ if ($redirect == '1' && $redirect_url != '') {
if ($redirect == '1' && $redirect_url != '')
{
page_close(); page_close();
/* /*
* Redirect to the URL defined in article properties * Redirect to the URL defined in article properties
@ -907,11 +774,8 @@ else
} }
header("Location: $redirect_url"); header("Location: $redirect_url");
exit; exit;
} } else {
else if ($cfg["debug"]["codeoutput"]) {
{
if ($cfg["debug"]["codeoutput"])
{
echo "<textarea>" . clHtmlSpecialChars($code) . "</textarea>"; echo "<textarea>" . clHtmlSpecialChars($code) . "</textarea>";
} }
@ -940,24 +804,15 @@ else
// print output // print output
echo $htmlCode; echo $htmlCode;
} }
} }
} } else {
else
{
# if user is in the backend display offline articles # if user is in the backend display offline articles
if ($contenido) if ($contenido) {
{
eval("?>\n" . $code . "\n<?php\n"); eval("?>\n" . $code . "\n<?php\n");
} } else {
else if ($error == 1) {
{
if ($error == 1)
{
echo "Fatal error: Could not display error page. Error to display was: 'No contenido session variable set. Probable error cause: Start article in this category is not set on-line.'"; echo "Fatal error: Could not display error page. Error to display was: 'No contenido session variable set. Probable error cause: Start article in this category is not set on-line.'";
} } else {
else
{
header($errsite); header($errsite);
exit; exit;
} }
@ -981,16 +836,13 @@ if ($cfg["cache"]["disable"] != '1') {
/* /*
* configuration settings after the site is displayed. * configuration settings after the site is displayed.
*/ */
if (file_exists("config.after.php")) if (file_exists("config.after.php")) {
{
@ include ("config.after.php"); @ include ("config.after.php");
} }
if (isset ($savedlang)) if (isset($savedlang)) {
{
$lang = $savedlang; $lang = $savedlang;
} }
$db->disconnect(); $db->disconnect();
page_close(); page_close();
?>

Datei anzeigen

@ -1,40 +1,25 @@
<?php <?php
/** /**
* Project: * file: front_crcloginform.inc.php
* Contenido Content Management System
* *
* Description: * @package ConLite
* <Description> * @subpackage Frontend
* * @version $Rev$
* Requirements: * @author Ortwin Pinke
* @con_php_req 5 * @copyright conrepo.org
* @con_template <Templatefiles> * @link http://conlite.conrepo.org
* @con_notice <Notice>
*
*
* @package ContenidoBackendArea
* @version <version>
* @author Jan Lengowski * @author Jan Lengowski
* @copyright four for business AG <www.4fb.de> * @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt * @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de * @link http://www.4fb.de
* @link http://www.contenido.org * @link http://www.contenido.org
* *
*
*
* {@internal
* created 2003-01-21
* modified 2005-09-29, Andreas Lindner
* modified 2008-07-04, bilal arslan, added security fix
* modified 2008-11-18, Murat Purc, add usage of Contenido_Url to create urls to frontend pages and redesign of HTML markup
* modified 2009-01-03, Murat Purc, synchronized with cms/front_crcloginform.inc.php
* modified 2011-02-07, Dominik Ziegler, fixed check of but_ok.gif and changed input type button to submit
*
* $Id$: * $Id$:
* }}
*
*/ */
/**
* security check
*/
if(!defined('CON_FRAMEWORK')) { if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -108,18 +93,17 @@ if ( file_exists($cfgClient[$client]['path']['frontend'] . 'images/but_ok.gif')
} }
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $encoding[$lang] ?>" /> <meta charset="<?php echo $encoding[$lang] ?>" />
<title>:: :: :: :: Contenido Login</title> <title>:: :: :: :: Contenido Login</title>
<script type="text/javascript"><!-- <script type="text/javascript">
if (top != self) { if (top != self) {
top.location.href = self.location.href; top.location.href = self.location.href;
} }
// --></script> </script>
<style type="text/css"><!-- <style type="text/css">
* {margin:0; padding:0;} * {margin:0; padding:0;}
html, body {height: 100%;} html, body {height: 100%;}
body {background-color:#fff; font-family: Verdana, Arial, Helvetica, Sans-Serif; font-size: 11px; color:#000;} body {background-color:#fff; font-family: Verdana, Arial, Helvetica, Sans-Serif; font-size: 11px; color:#000;}
@ -134,7 +118,7 @@ if ( file_exists($cfgClient[$client]['path']['frontend'] . 'images/but_ok.gif')
#login .formHeader {font-weight:bold; background-color:<?php echo $cfg['color']['table_header'] ?>; border-bottom:1px solid <?php echo $cfg['color']['table_border'] ?>; padding:3px; margin-bottom:10px;} #login .formHeader {font-weight:bold; background-color:<?php echo $cfg['color']['table_header'] ?>; border-bottom:1px solid <?php echo $cfg['color']['table_border'] ?>; padding:3px; margin-bottom:10px;}
#login .formRow {padding:0 10px; height:31px;} #login .formRow {padding:0 10px; height:31px;}
#login .clear {clear:both;} #login .clear {clear:both;}
// --></style> </style>
</head> </head>
<body> <body>
@ -156,13 +140,14 @@ if ( file_exists($cfgClient[$client]['path']['frontend'] . 'images/but_ok.gif')
</form> </form>
</div> </div>
<script type="text/javascript"><!-- <script type="text/javascript">
<!--
if (document.login.username.value == '') { if (document.login.username.value == '') {
document.login.username.focus(); document.login.username.focus();
} else { } else {
document.login.password.focus(); document.login.password.focus();
} }
// --></script> // -->
</script>
</body> </body>
</html> </html>

Datei anzeigen

@ -0,0 +1,85 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
* Recursive loop over given category for building a frontend navigation
*
* @package Frontend
* @subpackage Navigation
* @version 1.0.0
* @author Rudi Bieller
* @copyright four for business AG <www.4fb.de>
*
* $Id$
*/
class Contenido_NavMain_Util {
/**
* Recursive Loop over all (sub)categories.
* Each level will be assigned a css class navmainStandardLevel_x
*
* @param Contenido_Category $oCategory
* @param Contenido_FrontendNavigation $oFrontendNavigation
* @param Template $oTpl
* @param string $sUrlStyle
* @param array $aCfg
* @param int $iLang
* @param array $aLevelInfo Information for marking active cat per levels
* @param array $aDepthInfo Info on level depth / where to stop. Format: array(iCurrentLoopCount, iMaxLoopCount)
* @return void
*/
public static function loopCats(Contenido_Category $oCategory, Contenido_FrontendNavigation $oFrontendNavigation, Template $oTpl, array $aCfg, $iLang, array $aLevelInfo, $iCurrentPageIdcat, array $aDepthInfo = array()) {
$aDepthInfo[0] = isset($aDepthInfo[0]) ? $aDepthInfo[0] + 1 : 1;
$aDepthInfo[1] = isset($aDepthInfo[1]) ? $aDepthInfo[1] : 1;
// display current item
$iItemLevel = $oFrontendNavigation->getLevel($oCategory->getIdCat());
if (!isset($aLevelInfo[$oCategory->getIdCat()])) {
$aLevelInfo[$oCategory->getIdCat()] = array();
}
$oCurrentSubcategories = $oFrontendNavigation->getSubCategories($oCategory->getIdCat());
$aLevelInfo[$oCategory->getIdCat()]['has_children'] = $oCurrentSubcategories->count() > 0;
$aLevelInfo[$oCategory->getIdCat()]['first_child_item'] = -1;
$aLevelInfo[$oCategory->getIdCat()]['last_child_item'] = -1;
$bMarkActive = $oCategory->getIdCat() == $iCurrentPageIdcat || $oFrontendNavigation->isInPathToRoot($oCategory->getIdCat(), $iCurrentPageIdcat);
if ($oCurrentSubcategories->count() > 0) {
$aLevelInfo[$oCategory->getIdCat()]['first_child_item'] = $oCurrentSubcategories[0]->getIdCat();
$aLevelInfo[$oCategory->getIdCat()]['last_child_item'] = $oCurrentSubcategories[$oCurrentSubcategories->count()-1]->getIdCat();
}
// this is just for sample client - modify to your needs!
if (($aCfg['url_builder']['name'] == 'front_content') || ($aCfg['url_builder']['name'] == 'MR')) {
$aParams = array('lang' => $iLang, 'idcat' => $oCategory->getIdCat());
} else {
$aParams = array('a' => $oCategory->getIdCat(),
'idcat' => $oCategory->getIdCat(), // needed to build category path
'lang' => $iLang, // needed to build category path
'level' => 1); // needed to build category path
}
// fill template with values
$oTpl->set('d', 'name', $oCategory->getCategoryLanguage()->getName());
$oTpl->set('d', 'css_level', $iItemLevel);
$oTpl->set('d', 'css_first_item', ($aLevelInfo[$oCategory->getIdParent()]['first_child_item'] == $oCategory->getIdCat() ? ' first' : ''));
$oTpl->set('d', 'css_last_item', ($aLevelInfo[$oCategory->getIdParent()]['last_child_item'] == $oCategory->getIdCat() ? ' last' : ''));
$oTpl->set('d', 'css_active_item', ($bMarkActive === true ? ' active' : ''));
try {
$oTpl->set('d', 'url', Contenido_Url::getInstance()->build($aParams));
} catch (InvalidArgumentException $e) {
$oTpl->set('d', 'url', '#');
}
$oTpl->next();
// continue until max level depth
if ($aDepthInfo[1] > $aDepthInfo[0]) {
// check if current item has sub-items to be displayed
$bShowFollowUps = ($oCategory->getIdCat() == $iCurrentPageIdcat || $oFrontendNavigation->isInPathToRoot($oCategory->getIdCat(), $iCurrentPageIdcat))
? true : false;
if ($bShowFollowUps === true && $oCurrentSubcategories->count() > 0) {
$oSubCategories = $oCurrentSubcategories;
foreach ($oSubCategories as $oSubCategory) {
self::loopCats($oSubCategory, $oFrontendNavigation, $oTpl, $aCfg, $iLang, $aLevelInfo, $iCurrentPageIdcat, $aDepthInfo);
}
}
}
}
}
?>

Datei anzeigen

@ -0,0 +1,66 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
* Recursive loop over given category for building a sitemap navigation
*
* @package Frontend
* @subpackage Navigation
* @version 1.0.0
* @author Rudi Bieller
* @copyright four for business AG <www.4fb.de>
*
* $Id$
*/
class Contenido_Sitemap_Util {
/**
* Recursive Loop over all (sub)categories.
* Each level will be assigned a css class sitemapStandardLevel_x
*
* @param Contenido_Category $oCategory
* @param Contenido_FrontendNavigation $oFrontendNavigation
* @param Template $oTpl
* @param string $sUrlStyle
* @param array $aCfg
* @param int $iLang
* @param array $aDepthInfo Info on level depth / where to stop. Format: array(iCurrentLoopCount, iMaxLoopCount)
* @return void
*/
public static function loopCats(Contenido_Category $oCategory, Contenido_FrontendNavigation $oFrontendNavigation, Template $oTpl, $sUrlStyle, array $aCfg, $iLang, array $aDepthInfo = array()) {
$aDepthInfo[0] = isset($aDepthInfo[0]) ? $aDepthInfo[0] + 1 : 1;
$aDepthInfo[1] = isset($aDepthInfo[1]) ? $aDepthInfo[1] : 1;
// display current item
$iItemLevel = $oFrontendNavigation->getLevel($oCategory->getIdCat());
// this is just for sample client - modify to your needs!
if (($aCfg['url_builder']['name'] == 'front_content') || ($aCfg['url_builder']['name'] == 'MR')) {
$aParams = array('lang' => $iLang, 'idcat' => $oCategory->getIdCat());
} else {
$aParams = array('a' => $oCategory->getIdCat(),
'idcat' => $oCategory->getIdCat(), // needed to build category path
'lang' => $iLang, // needed to build category path
'level' => 1); // needed to build category path
}
// fill template with values
$oTpl->set('d', 'name', $oCategory->getCategoryLanguage()->getName());
$oTpl->set('d', 'css_level', $iItemLevel);
try {
$oTpl->set('d', 'url', Contenido_Url::getInstance()->build($aParams));
} catch (InvalidArgumentException $e) {
$oTpl->set('d', 'url', '#');
}
$oTpl->next();
// continue until max level depth
if ($aDepthInfo[1] > $aDepthInfo[0]) {
// check if current item has sub-items
$oSubCategories = $oFrontendNavigation->getSubCategories($oCategory->getIdCat());
if ($oSubCategories->count() > 0) {
foreach ($oSubCategories as $oSubCategory) {
self::loopCats($oSubCategory, $oFrontendNavigation, $oTpl, $sUrlStyle, $aCfg, $iLang, $aDepthInfo);
}
}
}
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -26,14 +27,13 @@
* *
* $Id$: * $Id$:
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
// Select box with additional functions for category and article selection // Select box with additional functions for category and article selection
class cHTMLInputSelectElement extends cHTMLSelectElement class cHTMLInputSelectElement extends cHTMLSelectElement {
{
/** /**
* Constructor. Creates an HTML select field (aka "DropDown"). * Constructor. Creates an HTML select field (aka "DropDown").
* *
@ -46,12 +46,10 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* *
* @return none * @return none
* */ * */
function cHTMLInputSelectElement ($sName, $iWidth = "", $sID = "", $bDisabled = false, $iTabIndex = null, $sAccessKey = "") function __construct($sName, $iWidth = "", $sID = "", $bDisabled = false, $iTabIndex = null, $sAccessKey = "") {
{
cHTMLSelectElement :: __construct($sName, $iWidth, $sID, $bDisabled, $iTabIndex, $sAccessKey); cHTMLSelectElement :: __construct($sName, $iWidth, $sID, $bDisabled, $iTabIndex, $sAccessKey);
} }
/** /**
* Function addArticles. Adds articles to select box values. * Function addArticles. Adds articles to select box values.
* *
@ -62,14 +60,12 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* *
* @return int Number of items added * @return int Number of items added
* */ * */
function addArticles ($iIDCat, $bColored = false, $bArtOnline = true, $sSpaces = "") function addArticles($iIDCat, $bColored = false, $bArtOnline = true, $sSpaces = "") {
{
global $cfg, $lang; global $cfg, $lang;
$oDB = new DB_ConLite; $oDB = new DB_Contenido;
if (is_numeric($iIDCat) && $iIDCat > 0) if (is_numeric($iIDCat) && $iIDCat > 0) {
{
$sSQL = "SELECT tblArtLang.title AS title, tblArtLang.idartlang AS idartlang, tblCatArt.idcat AS idcat, "; $sSQL = "SELECT tblArtLang.title AS title, tblArtLang.idartlang AS idartlang, tblCatArt.idcat AS idcat, ";
$sSQL .= "tblCatArt.idcatart AS idcatart, tblCatArt.is_start AS isstart, tblArtLang.online AS online, "; $sSQL .= "tblCatArt.idcatart AS idcatart, tblCatArt.is_start AS isstart, tblArtLang.online AS online, ";
$sSQL .= "tblCatLang.startidartlang as idstartartlang "; $sSQL .= "tblCatLang.startidartlang as idstartartlang ";
@ -95,13 +91,11 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
return 0; return 0;
} else { } else {
$iCounter = count($this->_options); $iCounter = count($this->_options);
while ($oDB->next_record()) while ($oDB->next_record()) {
{
// Generate new option element // Generate new option element
$oOption = new cHTMLOptionElement($sSpaces . "&nbsp;&nbsp;&nbsp;" . substr(urldecode($oDB->f("title")), 0, 32), $oDB->f("idcatart")); $oOption = new cHTMLOptionElement($sSpaces . "&nbsp;&nbsp;&nbsp;" . substr(urldecode($oDB->f("title")), 0, 32), $oDB->f("idcatart"));
if ($bColored) if ($bColored) {
{
$bIsStartArticle = false; $bIsStartArticle = false;
if ($cfg["is_start_compatible"] == true && $oDB->f("isstart") == 1) { if ($cfg["is_start_compatible"] == true && $oDB->f("isstart") == 1) {
// Compatible mode and "start article" flag is set // Compatible mode and "start article" flag is set
@ -111,8 +105,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
$bIsStartArticle = true; $bIsStartArticle = true;
} }
if ($bIsStartArticle) if ($bIsStartArticle) {
{
if ($oDB->f("online") == 0) { if ($oDB->f("online") == 0) {
// Start article, but offline -> red // Start article, but offline -> red
$oOption->setStyle("color: #ff0000;"); $oOption->setStyle("color: #ff0000;");
@ -152,11 +145,10 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* @return int Number of items added * @return int Number of items added
* */ * */
function addCategories($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true, function addCategories($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true,
$bWithArt = false, $bArtOnline = true) $bWithArt = false, $bArtOnline = true) {
{
global $cfg, $client, $lang; global $cfg, $client, $lang;
$oDB = new DB_ConLite; $oDB = new DB_Contenido;
$sSQL = "SELECT tblCat.idcat AS idcat, tblCatLang.name AS name, "; $sSQL = "SELECT tblCat.idcat AS idcat, tblCatLang.name AS name, ";
$sSQL .= "tblCatLang.visible AS visible, tblCatLang.public AS public, tblCatTree.level AS level "; $sSQL .= "tblCatLang.visible AS visible, tblCatLang.public AS public, tblCatTree.level AS level ";
@ -177,8 +169,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
return false; return false;
} else { } else {
$iCounter = count($this->_options); $iCounter = count($this->_options);
while ($oDB->next_record()) while ($oDB->next_record()) {
{
$sSpaces = ""; $sSpaces = "";
$sStyle = ""; $sStyle = "";
$iID = $oDB->f("idcat"); $iID = $oDB->f("idcat");
@ -188,8 +179,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
} }
// Generate new option element // Generate new option element
if (($bCatVisible && $oDB->f("visible") == 0) || if (($bCatVisible && $oDB->f("visible") == 0) || ($bCatPublic && $oDB->f("public") == 0)) {
($bCatPublic && $oDB->f("public") == 0)) {
// If category has to be visible or public and it isn't, don't add value // If category has to be visible or public and it isn't, don't add value
$sValue = ""; $sValue = "";
} else if ($bWithArt) { } else if ($bWithArt) {
@ -228,14 +218,12 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* *
* @return int Number of items added * @return int Number of items added
* */ * */
function addTypesFromArt ($iIDCatArt, $sTypeRange = "") function addTypesFromArt($iIDCatArt, $sTypeRange = "") {
{
global $cfg, $lang; global $cfg, $lang;
$oDB = new DB_ConLite; $oDB = new DB_Contenido;
if (is_numeric($iIDCatArt) && $iIDCatArt > 0) if (is_numeric($iIDCatArt) && $iIDCatArt > 0) {
{
$sSQL = "SELECT tblContent.typeid AS typeid, tblContent.idtype AS idtype, tblType.type AS type, tblType.description AS description, "; $sSQL = "SELECT tblContent.typeid AS typeid, tblContent.idtype AS idtype, tblType.type AS type, tblType.description AS description, ";
$sSQL .= "tblContent.value AS value "; $sSQL .= "tblContent.value AS value ";
$sSQL .= "FROM " . $cfg["tab"]["content"] . " AS tblContent, " . $cfg["tab"]["art_lang"] . " AS tblArtLang, "; $sSQL .= "FROM " . $cfg["tab"]["content"] . " AS tblContent, " . $cfg["tab"]["art_lang"] . " AS tblArtLang, ";
@ -255,8 +243,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
if ($iCount == 0) { if ($iCount == 0) {
return false; return false;
} else { } else {
while ($oDB->next_record()) while ($oDB->next_record()) {
{
$sTypeIdentifier = "tblData.idtype = '" . $oDB->f('idtype') . "' AND tblData.typeid = '" . $oDB->f('typeid') . "'"; $sTypeIdentifier = "tblData.idtype = '" . $oDB->f('idtype') . "' AND tblData.typeid = '" . $oDB->f('typeid') . "'";
// Generate new option element // Generate new option element
@ -279,14 +266,10 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
* *
* @return none * @return none
*/ */
function setSelected($aElements) function setSelected($aElements) {
{ if (is_array($this->_options) && is_array($aElements)) {
if (is_array($this->_options) && is_array($aElements)) foreach ($this->_options as $sKey => $oOption) {
{ if (in_array($oOption->getAttribute("value"), $aElements)) {
foreach ($this->_options as $sKey => $oOption)
{
if (in_array($oOption->getAttribute("value"), $aElements))
{
$oOption->setSelected(true); $oOption->setSelected(true);
$this->_options[$sKey] = $oOption; $this->_options[$sKey] = $oOption;
} else { } else {
@ -296,13 +279,13 @@ class cHTMLInputSelectElement extends cHTMLSelectElement
} }
} }
} }
} }
class UI_Config_Table class UI_Config_Table {
{
var $_sTplCellCode; var $_sTplCellCode;
var $_sTplTableFile; var $_sTplTableFile;
var $_sWidth; var $_sWidth;
var $_sBorder; var $_sBorder;
var $_sBorderColor; var $_sBorderColor;
@ -316,12 +299,10 @@ class UI_Config_Table
var $_aRowBgColor; var $_aRowBgColor;
var $_aRowExtra; var $_aRowExtra;
var $_bAddMultiSelJS; var $_bAddMultiSelJS;
var $_sColorLight; var $_sColorLight;
var $_sColorDark; var $_sColorDark;
function UI_Config_Table() function __construct() {
{
global $cfg; global $cfg;
$this->_sPadding = 2; $this->_sPadding = 2;
@ -333,98 +314,78 @@ class UI_Config_Table
$this->_sColorDark = $cfg['color']['table_dark']; $this->_sColorDark = $cfg['color']['table_dark'];
} }
function setCellTemplate($sCode) function setCellTemplate($sCode) {
{
$this->_sTplCellCode = $sCode; $this->_sTplCellCode = $sCode;
} }
function setTableTemplateFile($sPath) {
function setTableTemplateFile($sPath)
{
$this->_sTplTableFile = $sPath; $this->_sTplTableFile = $sPath;
} }
function setLightColor($sColor) function setLightColor($sColor) {
{
$this->_sColorLight = $sColor; $this->_sColorLight = $sColor;
} }
function setDarkColor($sColor) function setDarkColor($sColor) {
{
$this->_sColorDark = $sColor; $this->_sColorDark = $sColor;
} }
function setAddMultiSelJS($bEnabled = true) function setAddMultiSelJS($bEnabled = true) {
{
$this->_bAddMultiSelJS = (bool) $bEnabled; $this->_bAddMultiSelJS = (bool) $bEnabled;
} }
function setWidth ($sWidth) function setWidth($sWidth) {
{
$this->_sWidth = $sWidth; $this->_sWidth = $sWidth;
} }
function setPadding ($sPadding) function setPadding($sPadding) {
{
$this->_sPadding = $sPadding; $this->_sPadding = $sPadding;
} }
function setBorder ($sBorder) function setBorder($sBorder) {
{
$this->_sBorder = $sBorder; $this->_sBorder = $sBorder;
} }
function setBorderColor ($sBorderColor) function setBorderColor($sBorderColor) {
{
$this->_sBorderColor = $sBorderColor; $this->_sBorderColor = $sBorderColor;
} }
function setSolidBorder ($bSolidBorder = true) function setSolidBorder($bSolidBorder = true) {
{
$this->_bSolidBorder = (bool) $bSolidBorder; $this->_bSolidBorder = (bool) $bSolidBorder;
} }
function setCell ($sRow, $sCell, $sContent) function setCell($sRow, $sCell, $sContent) {
{
$this->_aCells[$sRow][$sCell] = $sContent; $this->_aCells[$sRow][$sCell] = $sContent;
$this->_aCellAlignment[$sRow][$sCell] = ""; $this->_aCellAlignment[$sRow][$sCell] = "";
} }
function setCellAlignment ($sRow, $sCell, $sAlignment) function setCellAlignment($sRow, $sCell, $sAlignment) {
{
$this->_aCellAlignment[$sRow][$sCell] = $sAlignment; $this->_aCellAlignment[$sRow][$sCell] = $sAlignment;
} }
function setCellVAlignment ($sRow, $sCell, $sAlignment) function setCellVAlignment($sRow, $sCell, $sAlignment) {
{
$this->_aCellVAlignment[$sRow][$sCell] = $sAlignment; $this->_aCellVAlignment[$sRow][$sCell] = $sAlignment;
} }
function setCellColspan ($sRow, $sCell, $iColSpan) function setCellColspan($sRow, $sCell, $iColSpan) {
{
$this->_aCellColSpan[$sRow][$sCell] = $iColSpan; $this->_aCellColSpan[$sRow][$sCell] = $iColSpan;
} }
function setCellClass ($sRow, $sCell, $sClass) function setCellClass($sRow, $sCell, $sClass) {
{
$this->_aCellClass[$sRow][$sCell] = $sClass; $this->_aCellClass[$sRow][$sCell] = $sClass;
} }
function setRowBgColor ($sRow, $sColor) function setRowBgColor($sRow, $sColor) {
{
$this->_aRowBgColor[$sRow] = $sColor; $this->_aRowBgColor[$sRow] = $sColor;
} }
function setRowExtra ($sRow, $sExtra) function setRowExtra($sRow, $sExtra) {
{
$this->_aRowExtra[$sRow] = $sExtra; $this->_aRowExtra[$sRow] = $sExtra;
} }
function _addMultiSelJS() function _addMultiSelJS() {
{
// Trick: To save multiple selections in <select>-Element, add some JS which saves the // Trick: To save multiple selections in <select>-Element, add some JS which saves the
// selection, comma separated in a hidden input field on change. // selection, comma separated in a hidden input field on change.
// Try ... catch prevents error messages, if function is added more than once // Try ... catch prevents error messages, if function is added more than once
// if (!fncUpdateSel) in JS has not worked... // if (!fncUpdateSel) in JS has not worked...
@ -456,8 +417,7 @@ class UI_Config_Table
return $sSkript; return $sSkript;
} }
function render($bPrint = false) function render($bPrint = false) {
{
$oTable = new Template; $oTable = new Template;
$oTable->reset(); $oTable->reset();
@ -469,24 +429,19 @@ class UI_Config_Table
$bDark = false; $bDark = false;
$sBgColor = ""; $sBgColor = "";
$bMultiSelJSAdded = false; $bMultiSelJSAdded = false;
if (is_array($this->_aCells)) if (is_array($this->_aCells)) {
{ foreach ($this->_aCells as $sRow => $aCells) {
foreach ($this->_aCells as $sRow => $aCells)
{
$iColCount++; $iColCount++;
//$bDark = !$bDark; //$bDark = !$bDark;
$sLine = ""; $sLine = "";
$iCount = 0; $iCount = 0;
foreach ($aCells as $sCell => $sData) foreach ($aCells as $sCell => $sData) {
{
$iCount++; $iCount++;
$sTplCell = $this->_sTplCellCode; $sTplCell = $this->_sTplCellCode;
if ($this->_bSolidBorder) if ($this->_bSolidBorder) {
{ if ($iCount < count($aCells)) {
if ($iCount < count($aCells))
{
if ($iColCount < count($this->_aCells)) { if ($iColCount < count($this->_aCells)) {
$sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-bottom: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell); $sTplCell = str_replace('{EXTRA}', 'border: 0px; border-right: 1px; border-bottom: 1px; border-color: ' . $this->_sBorderColor . '; border-style: solid;', $sTplCell);
} else { } else {
@ -569,5 +524,7 @@ class UI_Config_Table
return $sRendered; return $sRendered;
} }
} }
} }
?> ?>

Datei anzeigen

@ -0,0 +1,40 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
*
*
* @package Frontend
* @subpackage Functions
* @version $Rev$
* @author unknown
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* $Id$:
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
function getTeaserImage ($text,$return = 'path') {
$regEx = "/<img[^>]*?>.*?/i";
$match = array();
preg_match($regEx, $text, $match);
$regEx = "/(src)(=)(['\"]?)([^\"']*)(['\"]?)/i";
$img = array();
preg_match($regEx, $match[0], $img);
if ($return == 'path') {
return $img[4];
} else {
return $match[0];
}
}
?>

Datei anzeigen

@ -0,0 +1,521 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
*
*
* @package Frontend
* @subpackage Functions
* @version $Rev$
* @author unknown
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* $Id$:
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// create Navigation array for one level
function createNavigationArray($start_id, $db) {
global $user, $cfg, $client, $lang, $auth;
$navigation = array();
$FrontendPermissionCollection = new FrontendPermissionCollection;
// SECURITY-FIX
$sql = "SELECT
A.idcat,
C.name,
C.public,
C.idcatlang
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
C.visible = '1' AND
B.parentid = '" . Contenido_Security::escapeDB($start_id, $db) . "'
ORDER BY
A.idtree";
$db->query($sql);
while ($db->next_record()) {
$cat_id = $db->f("idcat");
$cat_idlang = $db->f("idcatlang");
$visible = false;
if ($db->f("public") != 0) {
$visible = true;
} elseif (($auth->auth['uid'] != '') && ($auth->auth['uid'] != 'nobody')) {
$FrontendGroupMemberCollection = new FrontendGroupMemberCollection;
$FrontendGroupMemberCollection->setWhere("idfrontenduser", $auth->auth['uid']);
$FrontendGroupMemberCollection->query();
$groups = array();
while ($member = $FrontendGroupMemberCollection->next()) {
$groups[] = $member->get("idfrontendgroup");
}
}
if (count($groups) > 0) {
for ($i = 0; $i < count($groups); $i++) {
if ($FrontendPermissionCollection->checkPerm($groups[$i], 'category', 'access', $cat_idlang, true)) {
$visible = true;
}
}
}
if ($visible) {
$navigation[$cat_id] = array("idcat" => $cat_id,
"name" => $db->f("name"),
"target" => '_self', # you can not call getTarget($cat_id, &$db) at this point with the same db instance!
"public" => $db->f("public"));
}
} // end while
$db->free();
return $navigation;
}
/**
* Return target of a given category id
*
* @deprecated
*/
function getTarget($cat_id, $db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
a.external_redirect AS ext
FROM
" . $cfg["tab"]["art_lang"] . " AS a,
" . $cfg["tab"]["cat_art"] . " AS b,
" . $cfg["tab"]["cat"] . " AS c
WHERE
b.idcat = '" . Contenido_Security::escapeDB($cat_id, $db) . "' AND
c.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
c.idcat = b.idcat AND
a.idart = b.idart AND
a.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "'";
$db->query($sql);
$db->next_record();
$target = ( $db->f('ext') == 0 ) ? '_self' : '_blank';
$db->free();
return $target;
}
/**
* Return true if $parentid is parent of $catid
*/
function isParent($parentid, $catid, $db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
a.parentid
FROM
" . $cfg["tab"]["cat"] . " AS a,
" . $cfg["tab"]["cat_lang"] . " AS b
WHERE
a.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
b.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
a.idcat = b.idcat AND
a.idcat = '" . Contenido_Security::escapeDB($catid, $db) . "'";
$db->query($sql);
$db->next_record();
$pre = $db->f("parentid");
if ($parentid == $pre) {
return true;
} else {
return false;
}
}
function getParent($preid, &$db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
a.parentid
FROM
" . $cfg["tab"]["cat"] . " AS a,
" . $cfg["tab"]["cat_lang"] . " AS b
WHERE
a.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
b.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
a.idcat = b.idcat AND
a.idcat = '" . Contenido_Security::escapeDB($preid, $db) . "'";
$db->query($sql);
if ($db->next_record()) {
return $db->f("parentid");
} else {
return false;
}
}
function getLevel($catid, &$db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
level
FROM
" . $cfg["tab"]["cat_tree"] . "
WHERE
idcat = '" . Contenido_Security::escapeDB($catid, $db) . "' ";
$db->query($sql);
if ($db->next_record()) {
return $db->f("level");
} else {
return false;
}
}
/**
* Return path of a given category up to a certain level
*/
function getCategoryPath($cat_id, $level, $reverse = true, &$db) {
$root_path = array();
array_push($root_path, $cat_id);
$parent_id = $cat_id;
while (getLevel($parent_id, $db) != false AND getLevel($parent_id, $db) > $level AND getLevel($parent_id, $db) >= 0) {
$parent_id = getParent($parent_id, $db);
if ($parent_id != false) {
array_push($root_path, $parent_id);
}
}
if ($reverse == true) {
$root_path = array_reverse($root_path);
}
return $root_path;
}
/**
* Return location string of a given category
*/
function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sTextStyleClass, $fullweblink = false, $reverse = true, $mod_rewrite = true, $db) {
global $sess, $cfgClient, $client;
$aCatPath = getCategoryPath($iStartCat, $level, $reverse, $db);
if (is_array($aCatPath) AND count($aCatPath) > 0) {
$aLocation = array();
foreach ($aCatPath as $value) {
if (!$fullweblink) {
if ($mod_rewrite == true) {
$linkUrl = $sess->url("index-a-$value.html");
} else {
$linkUrl = $sess->url("front_content.php?idcat=$value");
}
} else {
if ($mod_rewrite == true) {
$linkUrl = $sess->url($cfgClient[$client]["path"]["htmlpath"] . "index-a-$value.html");
} else {
$linkUrl = $sess->url($cfgClient[$client]["path"]["htmlpath"] . "front_content.php?idcat=$value");
}
}
$name = getCategoryName($value, $db);
$aLocation[] = '<a href="' . $linkUrl . '" class="' . $sLinkStyleClass . '"><nobr>' . $name . '</nobr></a>';
}
}
$sLocation = implode($seperator, $aLocation);
$sLocation = '<span class="' . $sTextStyleClass . '">' . $sLocation . '</span>';
return $sLocation;
}
/**
*
* get subtree by a given id
*
* @param int $idcat Id of category
* @return array Array with all deeper categories
*
* @copyright four for business AG <www.4fb.de>
*/
function getSubTree($idcat_start, $db) {
global $client, $cfg;
// SECURITY-FIX
$sql = "SELECT
B.idcat, A.level
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B
WHERE
A.idcat = B.idcat AND
idclient = '" . Contenido_Security::escapeDB($client, $db) . "'
ORDER BY
idtree";
$db->query($sql);
$subCats = false;
$curLevel = 0;
while ($db->next_record()) {
if ($db->f("idcat") == $idcat_start) {
$curLevel = $db->f("level");
$subCats = true;
} else if ($db->f("level") <= $curLevel) { // ending part of tree
$subCats = false;
}
if ($subCats == true) { //echo "true"; echo $db->f("idcat"); echo "<br>";
$deeper_cats[] = $db->f("idcat");
}
}
return $deeper_cats;
}
function getTeaserDeeperCategories($iIdcat, $db) {
global $client, $cfg, $lang;
// SECURITY-FIX
$sql = "SELECT
B.parentid, B.idcat
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
C.visible = '1' AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "'
ORDER BY
idtree";
$db->query($sql);
$subCats = false;
$curLevel = 0;
while ($db->next_record()) {
if ($db->f("idcat") == $iIdcat) {
$curLevel = $db->f("level");
$subCats = true;
} else if ($curLevel == $db->f("level")) { // ending part of tree
$subCats = false;
}
if ($subCats == true) {
$deeper_cats[] = $db->f("idcat");
}
}
return $deeper_cats;
}
/**
*
* get subtree by a given id, without protected and invisible categories
*
* @param int $idcat Id of category
* @return array Array with all deeper categories
*
* @copyright four for business AG <www.4fb.de>
*/
function getProtectedSubTree($idcat_start, $db) {
global $client, $cfg, $lang;
// SECURITY-FIX
$sql = "SELECT
B.parentid, B.idcat
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
C.visible = '1' AND
C.public = '1' AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "'
ORDER BY
idtree";
$db->query($sql);
$subCats = false;
$curLevel = 0;
while ($db->next_record()) {
if ($db->f("idcat") == $idcat_start) {
$curLevel = $db->f("level");
$subCats = true;
} else if ($curLevel == $db->f("level")) { // ending part of tree
$subCats = false;
}
if ($subCats == true) { //echo "true"; echo $db->f("idcat"); echo "<br>";
$deeper_cats[] = $db->f("idcat");
}
}
return $deeper_cats;
}
/**
* Return category name
*/
function getCategoryName($cat_id, &$db) {
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
*
FROM
" . $cfg["tab"]["cat"] . " AS A,
" . $cfg["tab"]["cat_lang"] . " AS B
WHERE
A.idcat = B.idcat AND
A.idcat = '" . Contenido_Security::escapeDB($cat_id, $db) . "' AND
A.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
B.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "'
";
$db->query($sql);
if ($db->next_record()) {
$cat_name = $db->f("name");
return $cat_name;
} else {
return '';
}
}
// end function
// get direct subcategories of a given category
function getSubCategories($parent_id, $db) {
$subcategories = array();
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
A.idcat
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
C.visible = '1' AND
C.public = '1' AND
B.parentid = '" . Contenido_Security::escapeDB($parent_id, $db) . "'
ORDER BY
A.idtree";
$db->query($sql);
while ($db->next_record()) {
$subcategories[] = $db->f("idcat");
} // end while
return $subcategories;
}
// end function
// get direct subcategories with protected categories
function getProtectedSubCategories($parent_id, $db) {
$subcategories = array();
unset($subcategories);
global $cfg, $client, $lang;
// SECURITY-FIX
$sql = "SELECT
A.idcat
FROM
" . $cfg["tab"]["cat_tree"] . " AS A,
" . $cfg["tab"]["cat"] . " AS B,
" . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
B.idclient = '" . Contenido_Security::escapeDB($client, $db) . "' AND
C.idlang = '" . Contenido_Security::escapeDB($lang, $db) . "' AND
B.parentid = '" . Contenido_Security::escapeDB($parent_id, $db) . "'
ORDER BY
A.idtree";
$db->query($sql);
while ($db->next_record()) {
$subcategories[] = $db->f("idcat");
} // end while
return $subcategories;
}
// end function
function checkCatPermission($idcatlang, $public) {
#Check if current user has permissions to access cat
global $auth;
$oDB = new DB_ConLite();
$FrontendPermissionCollection = new FrontendPermissionCollection;
$visible = false;
if ($public != 0) {
$visible = true;
$groups = array();
} elseif (($auth->auth['uid'] != '') && ($auth->auth['uid'] != 'nobody')) {
$FrontendGroupMemberCollection = new FrontendGroupMemberCollection;
$FrontendGroupMemberCollection->setWhere("idfrontenduser", $auth->auth['uid']);
$FrontendGroupMemberCollection->query();
$groups = array();
while ($member = $FrontendGroupMemberCollection->next()) {
$groups[] = $member->get("idfrontendgroup");
}
}
if (count($groups) > 0) {
for ($i = 0; $i < count($groups); $i++) {
if ($FrontendPermissionCollection->checkPerm($groups[$i], 'category', 'access', $idcatlang, true)) {
$visible = true;
}
}
}
return $visible;
}

Datei anzeigen

@ -0,0 +1,59 @@
<?php
function myfile($url) {
// URL zerlegen
$parsedurl = @parse_url($url);
// Host ermitteln, ungültigen Aufruf abfangen
if (empty($parsedurl['host'])) {
return null;
}
$host = $parsedurl['host'];
// Pfadangabe ermitteln
if (empty($parsedurl['path'])) {
$documentpath = '/';
} else {
$documentpath = $parsedurl['path'];
}
// Parameter ermitteln
if (!empty($parsedurl['query'])) {
$documentpath .= '?' . $parsedurl['query'];
}
// Port ermitteln
if (!empty($parsedurl['port'])) {
$port = $parsedurl['port'];
} else {
$port = 80;
}
// Socket öffnen
$fp = @fsockopen($host, $port, $errno, $errstr, 30);
if (!$fp) {
return null;
}
// Request senden
fputs ($fp, "GET {$documentpath} HTTP/1.0\r\nHost: {$host}\r\n\r\n");
// Header auslesen
do {
$line = chop(fgets($fp));
} while ((!empty($line)) && (!feof($fp)));
// Daten auslesen
$result = Array();
while (!feof($fp)) {
$result[] = fgets($fp);
}
// Socket schliessen
fclose($fp);
// Ergebnis-Array zurückgeben
return $result;
}
function prepareStringForOutput($sIn, $sCode = 'ISO-8859-1') {
global $encoding, $lang;
if ((strtoupper($sCode) == 'UTF-8') && (strtoupper($encoding[$lang]) != 'UTF-8')) {
$sOut = utf8_decode($sIn);
} elseif ((strtoupper($encoding[$lang]) == 'UTF-8') && (strtoupper($sCode) != 'UTF-8')) {
$sOut = utf8_encode($sIn);
} else {
$sOut = $sIn;
}
return $sOut;
}
?>

Datei anzeigen

@ -0,0 +1,160 @@
<?php
/*
RSS_PHP - the PHP DOM based RSS Parser
Author: <rssphp.net>
Published: 200801 :: blacknet :: via rssphp.net
RSS_PHP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
Usage:
See the documentation at http://rssphp.net/documentation
Examples:
Can be found online at http://rssphp.net/examples
*/
class rss_php {
public $document;
public $channel;
public $items;
/****************************
public load methods
***/
# load RSS by URL
public function load($url=false, $unblock=true) {
if($url) {
if($unblock) {
$this->loadParser(file_get_contents($url, false, $this->randomContext()));
} else {
$this->loadParser(file_get_contents($url));
}
}
}
# load raw RSS data
public function loadRSS($rawxml=false) {
if($rawxml) {
$this->loadParser($rawxml);
}
}
/****************************
public load methods
@param $includeAttributes BOOLEAN
return array;
***/
# return full rss array
public function getRSS($includeAttributes=false) {
if($includeAttributes) {
return $this->document;
}
return $this->valueReturner();
}
# return channel data
public function getChannel($includeAttributes=false) {
if($includeAttributes) {
return $this->channel;
}
return $this->valueReturner($this->channel);
}
# return rss items
public function getItems($includeAttributes=false) {
if($includeAttributes) {
return $this->items;
}
return $this->valueReturner($this->items);
}
/****************************
internal methods
***/
private function loadParser($rss=false) {
if($rss) {
$this->document = array();
$this->channel = array();
$this->items = array();
$DOMDocument = new DOMDocument;
$DOMDocument->strictErrorChecking = false;
$DOMDocument->loadXML($rss);
$this->document = $this->extractDOM($DOMDocument->childNodes);
}
}
private function valueReturner($valueBlock=false) {
if(!$valueBlock) {
$valueBlock = $this->document;
}
foreach($valueBlock as $valueName => $values) {
if(isset($values['value'])) {
$values = $values['value'];
}
if(is_array($values)) {
$valueBlock[$valueName] = $this->valueReturner($values);
} else {
$valueBlock[$valueName] = $values;
}
}
return $valueBlock;
}
private function extractDOM($nodeList,$parentNodeName=false) {
$itemCounter = 0;
foreach($nodeList as $values) {
if(substr($values->nodeName,0,1) != '#') {
if($values->nodeName == 'item') {
$nodeName = $values->nodeName.':'.$itemCounter;
$itemCounter++;
} else {
$nodeName = $values->nodeName;
}
$tempNode[$nodeName] = array();
if($values->attributes) {
for($i=0;$values->attributes->item($i);$i++) {
$tempNode[$nodeName]['properties'][$values->attributes->item($i)->nodeName] = $values->attributes->item($i)->nodeValue;
}
}
if(!$values->firstChild) {
$tempNode[$nodeName]['value'] = $values->textContent;
} else {
$tempNode[$nodeName]['value'] = $this->extractDOM($values->childNodes, $values->nodeName);
}
if(in_array($parentNodeName, array('channel','rdf:RDF'))) {
if($values->nodeName == 'item') {
$this->items[] = $tempNode[$nodeName]['value'];
} elseif(!in_array($values->nodeName, array('rss','channel'))) {
$this->channel[$values->nodeName] = $tempNode[$nodeName];
}
}
} elseif(substr($values->nodeName,1) == 'text') {
$tempValue = trim(preg_replace('/\s\s+/',' ',str_replace("\n",' ', $values->textContent)));
if($tempValue) {
$tempNode = $tempValue;
}
} elseif(substr($values->nodeName,1) == 'cdata-section'){
$tempNode = $values->textContent;
}
}
return $tempNode;
}
private function randomContext() {
$headerstrings = array();
$headerstrings['User-Agent'] = 'Mozilla/5.0 (Windows; U; Windows NT 5.'.rand(0,2).'; en-US; rv:1.'.rand(2,9).'.'.rand(0,4).'.'.rand(1,9).') Gecko/2007'.rand(10,12).rand(10,30).' Firefox/2.0.'.rand(0,1).'.'.rand(1,9);
$headerstrings['Accept-Charset'] = rand(0,1) ? 'en-gb,en;q=0.'.rand(3,8) : 'en-us,en;q=0.'.rand(3,8);
$headerstrings['Accept-Language'] = 'en-us,en;q=0.'.rand(4,6);
$setHeaders = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'."\r\n".
'Accept-Charset: '.$headerstrings['Accept-Charset']."\r\n".
'Accept-Language: '.$headerstrings['Accept-Language']."\r\n".
'User-Agent: '.$headerstrings['User-Agent']."\r\n";
$contextOptions = array(
'http'=>array(
'method'=>"GET",
'header'=>$setHeaders
)
);
return stream_context_create($contextOptions);
}
}
?>

Datei anzeigen

@ -0,0 +1,2 @@
This folder is marked as deprecated and will be deleted in next versions of ConLite.
Please use folders in data-directory instead!

Datei anzeigen

@ -112,7 +112,7 @@ class cTinyMCEEditor extends cWYSIWYGEditor {
} }
// GZIP // GZIP
if ($this->_aSettings["contenido_gzip"] == "true") { if (isset($this->_aSettings["contenido_gzip"]) && $this->_aSettings["contenido_gzip"] == "true") {
$this->setGZIPMode(true); $this->setGZIPMode(true);
} else { } else {
$this->setGZIPMode(false); $this->setGZIPMode(false);

Datei anzeigen

@ -31,6 +31,8 @@ if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
$bDebug = false;
if (!$idcat) { if (!$idcat) {
$idcat = Contenido_Security::toInteger($_REQUEST['idcat']); $idcat = Contenido_Security::toInteger($_REQUEST['idcat']);
} }

Datei anzeigen

@ -89,12 +89,12 @@ class FrontendList
* @param $endwrap Wrap for the list end * @param $endwrap Wrap for the list end
* @param $itemwrap Wrap for a single item * @param $itemwrap Wrap for a single item
*/ */
function FrontendList ($startwrap, $endwrap, $itemwrap) function __construct($startwrap, $endwrap, $itemwrap)
{ {
$this->resultsPerPage = 0; $this->resultsPerPage = 0;
$this->listStart = 1; $this->listStart = 1;
$this->itemwrap = $itemwrap; $this->itemwrap = (is_null($itemwrap))?'':$itemwrap;
$this->startwrap = $startwrap; $this->startwrap = $startwrap;
$this->endwrap = $endwrap; $this->endwrap = $endwrap;
} }

Datei anzeigen

@ -264,11 +264,10 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$template = $db->f("template"); $template = $db->f("template");
$a_c[$value] = preg_replace("/(&\$)/", "", $a_c[$value]);
$tmp1 = preg_split("/&/", $a_c[$value]);
$varstring = array(); $varstring = array();
if (!empty($a_c[$value])) {
$a_c[$value] = preg_replace("/(&\$)/", "", $a_c[$value]);
$tmp1 = preg_split("/&/", $a_c[$value]);
foreach ($tmp1 as $key1 => $value1) { foreach ($tmp1 as $key1 => $value1) {
@ -277,7 +276,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$varstring["$tmp2[0]"] = $tmp2[1]; $varstring["$tmp2[0]"] = $tmp2[1];
} }
} }
}
$CiCMS_Var = '$C' . $value . 'CMS_VALUE'; $CiCMS_Var = '$C' . $value . 'CMS_VALUE';
$CiCMS_VALUE = ''; $CiCMS_VALUE = '';
@ -305,7 +304,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$output = '<?php $modstart' . $value . ' = getmicrotime(); ?' . '>' . $output . '<?php $modend' . $value . ' = getmicrotime()+0.001; $modtime' . $value . ' = $modend' . $value . ' - $modstart' . $value . '; ?' . '>'; $output = '<?php $modstart' . $value . ' = getmicrotime(); ?' . '>' . $output . '<?php $modend' . $value . ' = getmicrotime()+0.001; $modtime' . $value . ' = $modend' . $value . ' - $modstart' . $value . '; ?' . '>';
} }
if ($fedebug != "") { if (!empty($fedebug)) {
$output = addslashes('<?php echo \'<img onclick="javascript:showmod' . $value . '();" src="' . $cfg['path']['contenido_fullhtml'] . 'images/but_preview.gif">\'; ?' . '>' . "<br>") . $output; $output = addslashes('<?php echo \'<img onclick="javascript:showmod' . $value . '();" src="' . $cfg['path']['contenido_fullhtml'] . 'images/but_preview.gif">\'; ?' . '>' . "<br>") . $output;
$output = $output . addslashes('<?php echo \'<script language="javascript">function showmod' . $value . ' () { window.alert(\\\'\'. "' . addslashes($fedebug) . '".\'\\\');} </script>\'; ?' . '>'); $output = $output . addslashes('<?php echo \'<script language="javascript">function showmod' . $value . ' () { window.alert(\\\'\'. "' . addslashes($fedebug) . '".\'\\\');} </script>\'; ?' . '>');
} }
@ -471,7 +470,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
} }
//add system meta tag if there is no user meta tag //add system meta tag if there is no user meta tag
if ($bExists == false && strlen($aAutValue['content']) > 0) { if ($bExists == false && isset($aAutValue['content']) && strlen($aAutValue['content']) > 0) {
array_push($metatags, $aAutValue); array_push($metatags, $aAutValue);
} }
} }
@ -481,7 +480,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
foreach ($metatags as $value) { foreach ($metatags as $value) {
if (getEffectiveSetting('generator', 'html5', "false") == "true") { if (getEffectiveSetting('generator', 'html5', "false") == "true") {
if ($value['name'] == 'date') if (isset($value['name']) && $value['name'] == 'date')
continue; continue;
} }
if (!empty($value['content'])) { if (!empty($value['content'])) {
@ -497,7 +496,7 @@ function conGenerateCode($idcat, $idart, $lang, $client, $layout = false) {
$oMetaTagGen->removeAttribute("id"); $oMetaTagGen->removeAttribute("id");
/* Check if metatag already exists */ /* Check if metatag already exists */
if (preg_match('/(<meta(?:\s+)name(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)' . $value["name"] . '(?:\s*)(?:\\\\"|\\\\\')(?:[^>]+)>\r?\n?)/i', $code, $aTmetatagfound)) { if (isset($value["name"]) && preg_match('/(<meta(?:\s+)name(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)' . $value["name"] . '(?:\s*)(?:\\\\"|\\\\\')(?:[^>]+)>\r?\n?)/i', $code, $aTmetatagfound)) {
$code = str_replace($aTmetatagfound[1], $oMetaTagGen->render() . "\n", $code); $code = str_replace($aTmetatagfound[1], $oMetaTagGen->render() . "\n", $code);
} else if (array_key_exists("charset", $value) } else if (array_key_exists("charset", $value)
&& preg_match('/(<meta(?:\s+)charset(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(.*)(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(?:\s*|\/)(?:[\^\>]+)\r?\n?)/i', $code, $aTmetatagfound)) { && preg_match('/(<meta(?:\s+)charset(?:\s*)=(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(.*)(?:\s*)(?:\\\\"|\\\\\')(?:\s*)(?:\s*|\/)(?:[\^\>]+)\r?\n?)/i', $code, $aTmetatagfound)) {

Datei anzeigen

@ -210,7 +210,8 @@ function fileEdit($filename, $sCode, $path) {
if (is_writable($path . $filename)) { if (is_writable($path . $filename)) {
if (strlen(stripslashes(trim($sCode))) > 0) { if (strlen(stripslashes(trim($sCode))) > 0) {
if (!empty($sCode)) { if (!empty($sCode)) {
$sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING'); mb_detect_encoding($sCode);
$sCode = mb_convert_encoding($sCode, 'UTF-8',mb_detect_encoding($sCode));
} }
cFileHandler::write($path . $filename, $sCode); cFileHandler::write($path . $filename, $sCode);
return true; return true;
@ -235,7 +236,8 @@ function fileEdit($filename, $sCode, $path) {
function getFileContent($filename, $path) { function getFileContent($filename, $path) {
$sCode = cFileHandler::read($path . $filename); $sCode = cFileHandler::read($path . $filename);
if (!empty($sCode)) { if (!empty($sCode)) {
$sCode = mb_convert_encoding($sCode, 'UTF-8', 'OLD-ENCODING'); mb_detect_encoding($sCode);
$sCode = mb_convert_encoding($sCode, 'UTF-8', mb_detect_encoding($sCode));
} }
return $sCode; return $sCode;
} }

Datei anzeigen

@ -1732,6 +1732,9 @@ function sendPostRequest($host, $path, $data, $referer = "", $port = 80) {
} }
function is_dbfs($file) { function is_dbfs($file) {
if(is_null($file)) {
$file = '';
}
if (substr($file, 0, 5) == "dbfs:") { if (substr($file, 0, 5) == "dbfs:") {
return true; return true;
} }

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* functions.system.php * functions.system.php
* *
@ -20,7 +21,6 @@
* @link http://www.contenido.org * @link http://www.contenido.org
* @since file available since contenido release <= 4.6 * @since file available since contenido release <= 4.6
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -68,8 +68,7 @@ function emptyLogFile() {
* @return string returns phpinfo() HTML output * @return string returns phpinfo() HTML output
* @author Marco Jahn * @author Marco Jahn
*/ */
function phpInfoToHtml() function phpInfoToHtml() {
{
/* get output */ /* get output */
ob_start(); ob_start();
phpinfo(); phpinfo();
@ -89,27 +88,20 @@ function phpInfoToHtml()
* @return boolean wether user has access or not * @return boolean wether user has access or not
* @author Marco Jahn * @author Marco Jahn
*/ */
function system_have_perm($client) function system_have_perm($client) {
{
global $auth; global $auth;
if (!isset ($auth->perm['perm'])) if (!isset($auth->perm['perm'])) {
{
$auth->perm['perm'] = ''; $auth->perm['perm'] = '';
} }
$userPerm = explode(',', $auth->auth['perm']); $userPerm = explode(',', $auth->auth['perm']);
if (in_array('sysadmin', $userPerm)) if (in_array('sysadmin', $userPerm)) { // is user sysadmin ?
{ // is user sysadmin ?
return true; return true;
} } elseif (in_array('admin[' . $client . ']', $userPerm)) { // is user admin for this client ?
elseif (in_array('admin['.$client.']', $userPerm))
{ // is user admin for this client ?
return true; return true;
} } elseif (in_array('client[' . $client . ']', $userPerm)) { // has user access to this client ?
elseif (in_array('client['.$client.']', $userPerm))
{ // has user access to this client ?
return true; return true;
} }
return false; return false;
@ -122,12 +114,10 @@ function system_have_perm($client)
* *
* @return boolean if string is a valid ip or not * @return boolean if string is a valid ip or not
*/ */
function isIPv4($strHostAdress) function isIPv4($strHostAdress) {
{
// ip pattern needed for validation // ip pattern needed for validation
$ipPattern = "([0-9]|1?\d\d|2[0-4]\d|25[0-5])"; $ipPattern = "([0-9]|1?\d\d|2[0-4]\d|25[0-5])";
if (preg_match("/^$ipPattern\.$ipPattern\.$ipPattern\.$ipPattern?$/", $strHostAdress)) if (preg_match("/^$ipPattern\.$ipPattern\.$ipPattern\.$ipPattern?$/", $strHostAdress)) { // ip is valid
{ // ip is valid
return true; return true;
} }
return false; return false;
@ -139,8 +129,7 @@ function isIPv4($strHostAdress)
* @param string $strBrowserUrl current browser string * @param string $strBrowserUrl current browser string
* @return boolean|string status of path comparement or false * @return boolean|string status of path comparement or false
*/ */
function checkPathInformation($strConUrl, $strBrowserUrl) function checkPathInformation($strConUrl, $strBrowserUrl) {
{
// parse url // parse url
$arrConUrl = parse_url($strConUrl); $arrConUrl = parse_url($strConUrl);
$arrBrowserUrl = parse_url($strBrowserUrl); $arrBrowserUrl = parse_url($strBrowserUrl);
@ -149,54 +138,41 @@ function checkPathInformation($strConUrl, $strBrowserUrl)
return false; return false;
} }
if (isIPv4($arrConUrl['host'])) if (isIPv4($arrConUrl['host'])) { // is
{ // is if (isIPv4($arrBrowserUrl['host'])) { // is
if (isIPv4($arrBrowserUrl['host'])) if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
{ // is
if (compareUrlStrings($arrConUrl, $arrBrowserUrl))
{
return '1'; return '1';
} }
return '2'; return '2';
} else } else { // isn't
{ // isn't
$arrBrowserUrl['host'] = gethostbyname($arrBrowserUrl['host']); $arrBrowserUrl['host'] = gethostbyname($arrBrowserUrl['host']);
if (!isIPv4($arrBrowserUrl['host'])) if (!isIPv4($arrBrowserUrl['host'])) {
{
return '3'; return '3';
} }
if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
{
return '1'; return '1';
} }
return '2'; return '2';
} }
} else } else { // isn't
{ // isn't if (isIPv4($arrBrowserUrl['host'])) { //is
if (isIPv4($arrBrowserUrl['host']))
{ //is
$tmpAddr = gethostbyaddr($arrBrowserUrl['host']); $tmpAddr = gethostbyaddr($arrBrowserUrl['host']);
$arrBrowserUrl['host'] = str_replace('-', '.', substr($tmpAddr, 0, strpos($tmpAddr, "."))); $arrBrowserUrl['host'] = str_replace('-', '.', substr($tmpAddr, 0, strpos($tmpAddr, ".")));
if (isIPv4($arrBrowserUrl['host'])) if (isIPv4($arrBrowserUrl['host'])) {
{
return '3'; return '3';
} }
if (compareUrlStrings($arrConUrl, $arrBrowserUrl, true)) if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
{
return '1'; return '1';
} }
return '2'; return '2';
} else { // isn't
} else if (compareUrlStrings($arrConUrl, $arrBrowserUrl)) {
{ // isn't
if (compareUrlStrings($arrConUrl, $arrBrowserUrl))
{
return '1'; return '1';
} }
@ -210,30 +186,44 @@ function checkPathInformation($strConUrl, $strBrowserUrl)
* *
* @param array $arrConUrl * @param array $arrConUrl
* @param array $arrBrowserUrl * @param array $arrBrowserUrl
* @param boolean $isIP not used, don' t know if needed
* @return boolean * @return boolean
*/ */
function compareUrlStrings($arrConUrl, $arrBrowserUrl, $isIP = false) function compareUrlStrings($arrConUrl, $arrBrowserUrl) {
{
// && $isIP == false
// remove 'www.' if needed // remove 'www.' if needed
if (strpos($arrConUrl['host'], 'www.') == 0 || strpos($arrBrowserUrl['host'], 'www.') == 0) if (strpos($arrConUrl['host'], 'www.') == 0 || strpos($arrBrowserUrl['host'], 'www.') == 0) {
{
$arrConUrl['host'] = str_replace('www.', '', $arrConUrl); $arrConUrl['host'] = str_replace('www.', '', $arrConUrl);
$arrBrowserUrl['host'] = str_replace('www.', '', $arrBrowserUrl); $arrBrowserUrl['host'] = str_replace('www.', '', $arrBrowserUrl);
} }
$strConUrl = $arrConUrl['scheme'].'://'.$arrConUrl['host'].$arrConUrl['path']; $strConUrl = unparse_url($arrConUrl);
$strBrowserUrl = $arrBrowserUrl['scheme'].'://'.$arrBrowserUrl['host'].$arrBrowserUrl['path']; $strBrowserUrl = unparse_url($arrBrowserUrl);
if (strcmp($strConUrl, $strBrowserUrl) != 0) if (strcmp($strConUrl, $strBrowserUrl) != 0) {
{
return false; return false;
} }
return true; return true;
} }
/**
* Convert parse_url array to string
*
* @param array $parsed_url
* @return string URL
*/
function unparse_url($parsed_url) {
$scheme = isset($parsed_url['scheme']) && is_string($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
$host = isset($parsed_url['host']) && is_string($parsed_url['host']) ? $parsed_url['host'] : '';
$port = isset($parsed_url['port']) && is_string($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
$user = isset($parsed_url['user']) && is_string($parsed_url['user']) ? $parsed_url['user'] : '';
$pass = isset($parsed_url['pass']) && is_string($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
$pass = ($user || $pass) ? "$pass@" : '';
$path = isset($parsed_url['path']) && is_string($parsed_url['path']) ? $parsed_url['path'] : '';
$query = isset($parsed_url['query']) && is_string($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
$fragment = isset($parsed_url['fragment']) && is_string($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
return "$scheme$user$pass$host$port$path$query$fragment";
}
/** /**
* writeSystemValuesOutput - get several server and Contenido settings * writeSystemValuesOutput - get several server and Contenido settings
* *
@ -242,8 +232,7 @@ function compareUrlStrings($arrConUrl, $arrBrowserUrl, $isIP = false)
* @return string returns a string containing several server and Contenido settings * @return string returns a string containing several server and Contenido settings
* @author Marco Jahn * @author Marco Jahn
*/ */
function writeSystemValuesOutput($usage) function writeSystemValuesOutput($usage) {
{
global $db, $_SERVER, $cfg, $i18n, $tpl; global $db, $_SERVER, $cfg, $i18n, $tpl;
@ -256,23 +245,15 @@ function writeSystemValuesOutput($usage)
$status = checkPathInformation($contenidoFullHtml, $browserPath); $status = checkPathInformation($contenidoFullHtml, $browserPath);
if ($status == 1) if ($status == 1) { // green
{ // green
$contenidoFullHtml = "<span style=\"color:green;\">" . $contenidoFullHtml . "</span><br>"; $contenidoFullHtml = "<span style=\"color:green;\">" . $contenidoFullHtml . "</span><br>";
$browserPath = "<span style=\"color:green;\">" . $browserPath . "</span>"; $browserPath = "<span style=\"color:green;\">" . $browserPath . "</span>";
} elseif ($status == 2) { // red
}
elseif ($status == 2)
{ // red
$contenidoFullHtml = "<span style=\"color:red;\">" . $contenidoFullHtml . "</span><br>"; $contenidoFullHtml = "<span style=\"color:red;\">" . $contenidoFullHtml . "</span><br>";
$browserPath = "<span style=\"color:red;\">" . $browserPath . "</span>"; $browserPath = "<span style=\"color:red;\">" . $browserPath . "</span>";
} elseif ($status == 3) { //orange
}
elseif ($status == 3)
{ //orange
$contenidoFullHtml = "<span style=\"color:orange;\">" . $contenidoFullHtml . "</span><br>"; $contenidoFullHtml = "<span style=\"color:orange;\">" . $contenidoFullHtml . "</span><br>";
$browserPath = "<span style=\"color:orange;\">" . $browserPath . "</span>"; $browserPath = "<span style=\"color:orange;\">" . $browserPath . "</span>";
} }
/* generate sysvalue output */ /* generate sysvalue output */
@ -327,10 +308,8 @@ function writeSystemValuesOutput($usage)
</tr>"; </tr>";
$clientPermCount = 0; $clientPermCount = 0;
while ($db->next_record()) while ($db->next_record()) {
{ if (system_have_perm($db->f("idclient"))) {
if (system_have_perm($db->f("idclient")))
{
$clientlang = ""; $clientlang = "";
// get client name // get client name
@ -346,8 +325,7 @@ function writeSystemValuesOutput($usage)
LEFT JOIN " . $cfg["tab"]["lang"] . " c ON b.idlang = c.idlang LEFT JOIN " . $cfg["tab"]["lang"] . " c ON b.idlang = c.idlang
WHERE a.idclient=" . Contenido_Security::toInteger($db->f("idclient")) . " AND c.name IS NOT NULL"; WHERE a.idclient=" . Contenido_Security::toInteger($db->f("idclient")) . " AND c.name IS NOT NULL";
$db2->query($sql); $db2->query($sql);
while ($db2->next_record()) while ($db2->next_record()) {
{
$clientlang .= $db2->f("clientlang") . ", "; $clientlang .= $db2->f("clientlang") . ", ";
} }
// cut off last "," // cut off last ","
@ -360,8 +338,7 @@ function writeSystemValuesOutput($usage)
$sql = "SELECT frontendpath, htmlpath FROM " . $cfg["tab"]["clients"] . " WHERE idclient='" . Contenido_Security::toInteger($db->f("idclient")) . "'"; $sql = "SELECT frontendpath, htmlpath FROM " . $cfg["tab"]["clients"] . " WHERE idclient='" . Contenido_Security::toInteger($db->f("idclient")) . "'";
$db2->query($sql); $db2->query($sql);
while ($db2->next_record()) while ($db2->next_record()) {
{
$clientInformation .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" > $clientInformation .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" >
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . i18n("htmlpath") . "</td> <td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . i18n("htmlpath") . "</td>
<td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">" . $db2->f("htmlpath") . "&nbsp;</td> <td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">" . $db2->f("htmlpath") . "&nbsp;</td>
@ -373,11 +350,9 @@ function writeSystemValuesOutput($usage)
} }
$clientPermCount++; $clientPermCount++;
} }
} }
if ($clientPermCount == 0) if ($clientPermCount == 0) {
{
$clientInformation .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" > $clientInformation .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" >
<td colspan=\"2\" class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid; \" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . i18n("No permissions!") . "</td> <td colspan=\"2\" class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid; \" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . i18n("No permissions!") . "</td>
</tr>"; </tr>";
@ -466,8 +441,7 @@ function writeSystemValuesOutput($usage)
} }
} }
foreach ($gdLib as $setting => $value) foreach ($gdLib as $setting => $value) {
{
$gdLibFeatures .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" > $gdLibFeatures .= "<tr class=\"text_medium\" style=\"background-color: {BGCOLOR};\" >
<td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . $setting . "</td> <td class=\"text_medium\" style=\"border:1px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\" align=\"left\" valign=\"top\">" . $setting . "</td>
<td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">" . $value[0] . "</td> <td class=\"text_medium\" width=\"60%\" style=\"border:1px; border-left:0px; border-top:0px; border-color: #B3B3B3; border-style: solid;\" nowrap=\"nowrap\">" . $value[0] . "</td>
@ -484,8 +458,7 @@ function writeSystemValuesOutput($usage)
$iRowId = 1; $iRowId = 1;
$sRowBgColor2 = $sRowBgColor1 = "#fff"; $sRowBgColor2 = $sRowBgColor1 = "#fff";
//loop array for every parameter //loop array for every parameter
foreach ($sysvalues AS $sysvalue) foreach ($sysvalues AS $sysvalue) {
{
$tpl->set('d', 'VARIABLE', $sysvalue['variable']); $tpl->set('d', 'VARIABLE', $sysvalue['variable']);
$tpl->set('d', 'LOCALVALUE', $sysvalue['value']); $tpl->set('d', 'LOCALVALUE', $sysvalue['value']);
$tpl->set('d', 'ROWID', 'sysrow_' . $iRowId); $tpl->set('d', 'ROWID', 'sysrow_' . $iRowId);
@ -499,15 +472,11 @@ $sRowBgColor2 = $sRowBgColor1 = "#fff";
} }
/* irgendwas sinnvolles :) */ /* irgendwas sinnvolles :) */
if ($usage == 'mail') if ($usage == 'mail') {
{
return $tpl->generate($cfg['path']['templates'] . $cfg['templates']['systam_variables_mailattach'], true); return $tpl->generate($cfg['path']['templates'] . $cfg['templates']['systam_variables_mailattach'], true);
} } elseif ($usage == 'output') {
elseif ($usage == 'output')
{
// do nothing // do nothing
} }
} }
/** /**
@ -535,51 +504,43 @@ $sRowBgColor2 = $sRowBgColor1 = "#fff";
* @return string returns several server and Contenido settings * @return string returns several server and Contenido settings
* @author Marco Jahn * @author Marco Jahn
*/ */
function sendBugReport() function sendBugReport() {
{
global $_POST, $notification, $cfg; global $_POST, $notification, $cfg;
/* will be set to another value than 0 if an error attempts */ /* will be set to another value than 0 if an error attempts */
$mailSendError = 0; $mailSendError = 0;
/* check if email is filled out */ /* check if email is filled out */
if (strlen($_POST['sender']) == 0) if (strlen($_POST['sender']) == 0) {
{
$mailSendError = 1; $mailSendError = 1;
} }
/* check if forename is filled out */ /* check if forename is filled out */
if (strlen($_POST['forename']) == 0) if (strlen($_POST['forename']) == 0) {
{
$mailSendError = 1; $mailSendError = 1;
} }
/* check if surname is filled out */ /* check if surname is filled out */
if (strlen($_POST['surname']) == 0) if (strlen($_POST['surname']) == 0) {
{
$mailSendError = 1; $mailSendError = 1;
} }
/* check if bugreport is filled out */ /* check if bugreport is filled out */
if (strlen($_POST['bugreport']) == 0) if (strlen($_POST['bugreport']) == 0) {
{
$mailSendError = 1; $mailSendError = 1;
} }
/* check if email adress is valid */ /* check if email adress is valid */
if (isValidMail($_POST['sender']) == false) if (isValidMail($_POST['sender']) == false) {
{
$mailSendError = 2; $mailSendError = 2;
} }
/* user has not agreed */ /* user has not agreed */
if ($_POST['agreement'] != 'on') if ($_POST['agreement'] != 'on') {
{
$mailSendError = 3; $mailSendError = 3;
} }
if ($mailSendError == 0) if ($mailSendError == 0) {
{
/* send mail */ /* send mail */
/* initialize mail class */ /* initialize mail class */
@ -601,61 +562,46 @@ function sendBugReport()
$mail->AltBody = "Fehlerbereich: " . $_POST['selectarea'] . "\n\n" . strip_tags($_POST['bugreport']); $mail->AltBody = "Fehlerbereich: " . $_POST['selectarea'] . "\n\n" . strip_tags($_POST['bugreport']);
/* add attachements */ /* add attachements */
if ($_POST['errorlog'] == 'on') if ($_POST['errorlog'] == 'on') {
{ if (filesize($cfg['path']['contenido'] . "logs/errorlog.txt") > 0) { //filesize > 0 send alternative attachement
if (filesize($cfg['path']['contenido']."logs/errorlog.txt") > 0)
{ //filesize > 0 send alternative attachement
$mail->AddAttachment($cfg['path']['contenido'] . "logs/errorlog.txt", "errorlog.txt"); $mail->AddAttachment($cfg['path']['contenido'] . "logs/errorlog.txt", "errorlog.txt");
} else } else {
{
$mail->AddStringAttachment("No error log entries found\n", "errorlog.txt"); $mail->AddStringAttachment("No error log entries found\n", "errorlog.txt");
} }
} }
if ($_POST['upgradeerrorlog'] == 'on') if ($_POST['upgradeerrorlog'] == 'on') {
{ if (filesize($cfg['path']['contenido'] . "logs/install.log.txt") > 0) { //filesize > 0 send alternative attachement
if (filesize($cfg['path']['contenido']."logs/install.log.txt") > 0)
{ //filesize > 0 send alternative attachement
$mail->AddAttachment($cfg['path']['contenido'] . "logs/install.log.txt", "install.log.txt"); $mail->AddAttachment($cfg['path']['contenido'] . "logs/install.log.txt", "install.log.txt");
} else } else {
{
$mail->AddStringAttachment("No install error log entries found\n", "install.log.txt"); $mail->AddStringAttachment("No install error log entries found\n", "install.log.txt");
} }
} }
if ($_POST['sysvalues'] == 'on') if ($_POST['sysvalues'] == 'on') {
{
//send sysvalue output //send sysvalue output
$mail->AddStringAttachment(writeSystemValuesOutput($usage = 'mail'), "systemvariables.html"); $mail->AddStringAttachment(writeSystemValuesOutput($usage = 'mail'), "systemvariables.html");
} }
if ($_POST['phpinfo'] == 'on') if ($_POST['phpinfo'] == 'on') {
{
//send phpinfo output //send phpinfo output
$mail->AddStringAttachment(phpInfoToHtml(), "phpinfo.html"); $mail->AddStringAttachment(phpInfoToHtml(), "phpinfo.html");
} }
if (!$mail->Send()) if (!$mail->Send()) {
{
$tmp_notification = $notification->returnNotification("error", i18n("an error occured while sending your bug report! Please try again")); $tmp_notification = $notification->returnNotification("error", i18n("an error occured while sending your bug report! Please try again"));
} else } else {
{
$tmp_notification = $notification->returnNotification("info", i18n("bug report forwarded")); $tmp_notification = $notification->returnNotification("info", i18n("bug report forwarded"));
} }
} } elseif ($mailSendError == 1) {
elseif ($mailSendError == 1)
{
/* user should fill all fields */ /* user should fill all fields */
$tmp_notification = $notification->returnNotification("warning", i18n("please fill out all mandatory fields")); $tmp_notification = $notification->returnNotification("warning", i18n("please fill out all mandatory fields"));
} } elseif ($mailSendError == 2) { /* email adress is not valid */
elseif ($mailSendError == 2)
{ /* email adress is not valid */
$tmp_notification = $notification->returnNotification("warning", i18n("please enter a valid E-Mail adress")); $tmp_notification = $notification->returnNotification("warning", i18n("please enter a valid E-Mail adress"));
} } elseif ($mailSendError == 3) { /* user hasn't agreed to the declaration of consent */
elseif ($mailSendError == 3)
{ /* user hasn't agreed to the declaration of consent */
$tmp_notification = $notification->returnNotification("warning", i18n("you must agree the declaration of consent")); $tmp_notification = $notification->returnNotification("warning", i18n("you must agree the declaration of consent"));
} }
return $mailSendError . "||" . $tmp_notification; return $mailSendError . "||" . $tmp_notification;
} }
?> ?>

Datei anzeigen

@ -208,7 +208,7 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) {
preg_match_all("/CMS_CONTAINER\[([0-9]*)\]/", $code, $a_container); preg_match_all("/CMS_CONTAINER\[([0-9]*)\]/", $code, $a_container);
$iPosBody = stripos($code, '<body>'); $iPosBody = stripos($code, '<body>');
$sCodeBeforeHeader = substr($code, 0, $iPosBody); $sCodeBeforeHeader = substr($code, 0, $iPosBody);
if (!empty($a_container)) {
foreach ($a_container[1] as $value) { foreach ($a_container[1] as $value) {
if (preg_match("/CMS_CONTAINER\[$value\]/", $sCodeBeforeHeader)) { if (preg_match("/CMS_CONTAINER\[$value\]/", $sCodeBeforeHeader)) {
$containerinf[$idlay][$value]["is_body"] = false; $containerinf[$idlay][$value]["is_body"] = false;
@ -216,6 +216,7 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) {
$containerinf[$idlay][$value]["is_body"] = true; $containerinf[$idlay][$value]["is_body"] = true;
} }
} }
}
if (is_array($containerinf[$idlay])) { if (is_array($containerinf[$idlay])) {
foreach ($containerinf[$idlay] as $key => $value) { foreach ($containerinf[$idlay] as $key => $value) {
@ -233,8 +234,10 @@ function tplBrowseLayoutForContainers($idlay, $raw_code = NULL) {
asort($container); asort($container);
if (is_array($container)) { if (is_array($container) && !empty($container)) {
$tmp_returnstring = implode("&", $container); $tmp_returnstring = implode("&", $container);
} else {
$tmp_returnstring = "";
} }
return $tmp_returnstring; return $tmp_returnstring;
} }
@ -359,16 +362,14 @@ function tplPreparseLayout($idlay, $raw_code = NULL) {
if ($parser->iNodeName == "container" && $parser->iNodeType == NODE_TYPE_ELEMENT) { if ($parser->iNodeName == "container" && $parser->iNodeType == NODE_TYPE_ELEMENT) {
$idcontainer = $parser->iNodeAttributes["id"]; $idcontainer = $parser->iNodeAttributes["id"];
$mode = $parser->iNodeAttributes["mode"]; $sMode = (isset($parser->iNodeAttributes["mode"]))?$parser->iNodeAttributes["mode"]:'optional';
$sDefault = (isset($parser->iNodeAttributes["default"]))?$parser->iNodeAttributes["default"]:'';
if ($mode == "") { $sTypes = (isset($parser->iNodeAttributes["types"]))?$parser->iNodeAttributes["types"]:'';
$mode = "optional";
}
$containerinf[$idlay][$idcontainer]["name"] = $parser->iNodeAttributes["name"]; $containerinf[$idlay][$idcontainer]["name"] = $parser->iNodeAttributes["name"];
$containerinf[$idlay][$idcontainer]["mode"] = $mode; $containerinf[$idlay][$idcontainer]["mode"] = $sMode;
$containerinf[$idlay][$idcontainer]["default"] = $parser->iNodeAttributes["default"]; $containerinf[$idlay][$idcontainer]["default"] = $sDefault;
$containerinf[$idlay][$idcontainer]["types"] = $parser->iNodeAttributes["types"]; $containerinf[$idlay][$idcontainer]["types"] = $sTypes;
$containerinf[$idlay][$idcontainer]["is_body"] = $bIsBody; $containerinf[$idlay][$idcontainer]["is_body"] = $bIsBody;
} }
} }
@ -726,7 +727,6 @@ function tplAutoFillModules($idtpl) {
if ($db_autofill->next_record()) { if ($db_autofill->next_record()) {
$idmod = $db_autofill->f("idmod"); $idmod = $db_autofill->f("idmod");
$sql = "SELECT idcontainer FROM " . $cfg["tab"]["container"] . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'"; $sql = "SELECT idcontainer FROM " . $cfg["tab"]["container"] . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'";
$db_autofill->query($sql); $db_autofill->query($sql);
@ -760,7 +760,6 @@ function tplAutoFillModules($idtpl) {
if ($db_autofill->next_record()) { if ($db_autofill->next_record()) {
$idmod = $db_autofill->f("idmod"); $idmod = $db_autofill->f("idmod");
$sql = "SELECT idcontainer, idmod FROM " . $cfg["tab"]["container"] $sql = "SELECT idcontainer, idmod FROM " . $cfg["tab"]["container"]
. " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'"; . " WHERE idtpl = '" . Contenido_Security::toInteger($idtpl) . "' AND number = '" . Contenido_Security::toInteger($container) . "'";

Datei anzeigen

@ -46,9 +46,13 @@ if (!defined('CON_FRAMEWORK')) {
* string is shorter there will be no tooltipp * string is shorter there will be no tooltipp
* @return string - string, which contains short path name and tooltipp if neccessary * @return string - string, which contains short path name and tooltipp if neccessary
*/ */
function generateDisplayFilePath($sDisplayPath, $iLimit) { function generateDisplayFilePath($mDisplayPath, $mLimit) {
$sDisplayPath = (string) trim($sDisplayPath); if(is_null($mDisplayPath)) {
$iLimit = (int) $iLimit; $sDisplayPath = '';
} else {
$sDisplayPath = (string) trim($mDisplayPath);
}
$iLimit = intval($mLimit);
if (strlen($sDisplayPath) > $iLimit) { if (strlen($sDisplayPath) > $iLimit) {
$sDisplayPathShort = capiStrTrimHard($sDisplayPath, $iLimit); $sDisplayPathShort = capiStrTrimHard($sDisplayPath, $iLimit);
@ -58,12 +62,13 @@ function generateDisplayFilePath($sDisplayPath, $iLimit) {
$aPathFragments = explode('/', $sDisplayPath); $aPathFragments = explode('/', $sDisplayPath);
foreach ($aPathFragments as $sFragment) { foreach ($aPathFragments as $sFragment) {
if ($sFragment != '') { if (empty($sFragment)) {
if (strlen($sFragment) > ($iLimit - 5)) { continue;
$sFragment = capiStrTrimHard($sFragment, $iLimit);
} }
if ($iCharcount + strlen($sFragment) + 1 > $iLimit) { if (strlen($sFragment) > ($iLimit - 5)) {
$sFragment = capiStrTrimHard($sFragment, $iLimit);
} else if ($iCharcount + strlen($sFragment) + 1 > $iLimit) {
$sTooltippString .= '<br>' . $sFragment . '/'; $sTooltippString .= '<br>' . $sFragment . '/';
$iCharcount = strlen($sFragment); $iCharcount = strlen($sFragment);
} else { } else {
@ -71,7 +76,6 @@ function generateDisplayFilePath($sDisplayPath, $iLimit) {
$sTooltippString .= $sFragment . '/'; $sTooltippString .= $sFragment . '/';
} }
} }
}
$sDisplayPath = '<span onmouseover="Tip(\'' . $sTooltippString . '\', BALLOON, true, ABOVE, true);">' . $sDisplayPathShort . '</span>'; $sDisplayPath = '<span onmouseover="Tip(\'' . $sTooltippString . '\', BALLOON, true, ABOVE, true);">' . $sDisplayPathShort . '</span>';
} }
@ -111,8 +115,7 @@ function uplDirectoryListRecursive($currentdir, $startdir = NULL, $files = array
foreach ($sorted_files as $file) { foreach ($sorted_files as $file) {
if ($file != ".." && $file != ".") { if ($file != ".." && $file != ".") {
if ((filetype(getcwd() . "/" . $file) == "dir") && if ((filetype(getcwd() . "/" . $file) == "dir") && (opendir(getcwd() . "/" . $file) !== false)) {
(opendir(getcwd() . "/" . $file) !== false)) {
$a_file['name'] = $file; $a_file['name'] = $file;
$a_file['depth'] = $depth; $a_file['depth'] = $depth;
$a_file['pathstring'] = $pathstring . $file . '/'; $a_file['pathstring'] = $pathstring . $file . '/';
@ -802,7 +805,7 @@ function uplCreateFriendlyName($filename, $spacer = "_") {
$newfilename = ""; $newfilename = "";
if (!is_array($cfg['upl']['allow_additional_chars'])) { if (!isset($cfg['upl']['allow_additional_chars']) || !is_array($cfg['upl']['allow_additional_chars'])) {
$filename = str_replace(" ", $spacer, $filename); $filename = str_replace(" ", $spacer, $filename);
} elseif (in_array(' ', $cfg['upl']['allow_additional_chars']) === FALSE) { } elseif (in_array(' ', $cfg['upl']['allow_additional_chars']) === FALSE) {
$filename = str_replace(" ", $spacer, $filename); $filename = str_replace(" ", $spacer, $filename);
@ -823,7 +826,7 @@ function uplCreateFriendlyName($filename, $spacer = "_") {
} }
#Check for additionally allowed charcaters in $cfg['upl']['allow_additional_chars'] (must be array of chars allowed) #Check for additionally allowed charcaters in $cfg['upl']['allow_additional_chars'] (must be array of chars allowed)
if (is_array($cfg['upl']['allow_additional_chars']) && !$bFound) { if (isset($cfg['upl']['allow_additional_chars']) && is_array($cfg['upl']['allow_additional_chars']) && !$bFound) {
if (in_array($atom, $cfg['upl']['allow_additional_chars'])) { if (in_array($atom, $cfg['upl']['allow_additional_chars'])) {
$newfilename .= $atom; $newfilename .= $atom;
} }

Datei anzeigen

@ -475,7 +475,7 @@ if (is_numeric($idcat) && ($idcat >= 0)) {
} }
$imgsrc .= '.gif'; $imgsrc .= '.gif';
$tmp_img = '';
if (($perm->have_perm_area_action("con", "con_makestart") || $perm->have_perm_area_action_item("con", "con_makestart", $idcat)) && $idcat != 0) { if (($perm->have_perm_area_action("con", "con_makestart") || $perm->have_perm_area_action_item("con", "con_makestart", $idcat)) && $idcat != 0) {
if ($is_start == false) { if ($is_start == false) {
$tmp_link = '<a href="' . $sess->url("main.php?area=con&amp;idcat=$idcat&amp;action=con_makestart&amp;idcatart=$idcatart&amp;frame=4&is_start=1&amp;next=$next") . '" title="' . i18n("Flag as start article") . '"><img src="images/' . $imgsrc . '" border="0" title="' . i18n("Flag as start article") . '" alt="' . i18n("Flag as start article") . '" style="margin-left:3px;"></a>'; $tmp_link = '<a href="' . $sess->url("main.php?area=con&amp;idcat=$idcat&amp;action=con_makestart&amp;idcatart=$idcatart&amp;frame=4&is_start=1&amp;next=$next") . '" title="' . i18n("Flag as start article") . '"><img src="images/' . $imgsrc . '" border="0" title="' . i18n("Flag as start article") . '" alt="' . i18n("Flag as start article") . '" style="margin-left:3px;"></a>';

Datei anzeigen

@ -596,7 +596,8 @@ if ($action == "con_newart" && $newart != true) {
</script>'; </script>';
foreach ($availableTags as $key => $value) { foreach ($availableTags as $key => $value) {
$tpl->set('d', 'METAINPUT', 'META' . $value); // @todo seems to be unused, check if we can delete it (op 17.05.2022)
//$tpl->set('d', 'METAINPUT', 'META' . $value);
switch ($value["fieldtype"]) { switch ($value["fieldtype"]) {
case "text": case "text":

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -32,7 +33,6 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -50,14 +50,12 @@ global $sess, $frame, $area;
$idcat = ( isset($_GET['idcat']) && is_numeric($_GET['idcat'])) ? $_GET['idcat'] : -1; $idcat = ( isset($_GET['idcat']) && is_numeric($_GET['idcat'])) ? $_GET['idcat'] : -1;
//Get sync options //Get sync options
if (isset($syncoptions)) if (isset($syncoptions)) {
{
$syncfrom = (int) $syncoptions; $syncfrom = (int) $syncoptions;
$remakeCatTable = true; $remakeCatTable = true;
} }
if (!isset($syncfrom)) if (!isset($syncfrom)) {
{
$syncfrom = -1; $syncfrom = -1;
} }
@ -65,15 +63,12 @@ $syncoptions = $syncfrom;
$oTpl->set('s', 'SYNC_LANG', $syncfrom); $oTpl->set('s', 'SYNC_LANG', $syncfrom);
########################################## ##########################################
# Delete a saved search # Delete a saved search
########################################## ##########################################
$bShowArticleSearch = false; $bShowArticleSearch = false;
if( isset($_GET['delsavedsearch']) ) if (isset($_GET['delsavedsearch'])) {
{ if (isset($_GET['itemtype']) && sizeof($_GET['itemtype']) > 0 && isset($_GET['itemid']) && sizeof($_GET['itemid']) > 0) {
if( isset($_GET['itemtype']) && sizeof($_GET['itemtype'])>0 && isset($_GET['itemid']) && sizeof($_GET['itemid'])>0 )
{
$propertyCollection = new PropertyCollection; $propertyCollection = new PropertyCollection;
$propertyCollection->deleteProperties($_GET['itemtype'], $_GET['itemid']); $propertyCollection->deleteProperties($_GET['itemtype'], $_GET['itemid']);
$bShowArticleSearch = true; $bShowArticleSearch = true;
@ -239,7 +234,6 @@ $oSubmit = new cHTMLButton("submit", i18n("Search"));
$content = '<div id="artsearch" style="border: 1px solid #B3B3B3; border-top: none; margin:0;padding:0; padding-bottom: 10px;background: ' . $cfg['color']['table_dark'] . ';">'; $content = '<div id="artsearch" style="border: 1px solid #B3B3B3; border-top: none; margin:0;padding:0; padding-bottom: 10px;background: ' . $cfg['color']['table_dark'] . ';">';
$content .= '<form action="backend_search.php" method="post" name="backend_search" target="right_bottom" id="backend_search">'; $content .= '<form action="backend_search.php" method="post" name="backend_search" target="right_bottom" id="backend_search">';
$content .= '<table dir="' . langGetTextDirection($lang) . '">'; $content .= '<table dir="' . langGetTextDirection($lang) . '">';
$content .= '<input type="hidden" name="area" value="' . $area . '">'; $content .= '<input type="hidden" name="area" value="' . $area . '">';
$content .= '<input type="hidden" name="frame" value="' . $frame . '">'; $content .= '<input type="hidden" name="frame" value="' . $frame . '">';
@ -310,10 +304,8 @@ $link = $sess->url("main.php?area=con_workflow&frame=4");
$sWorflowLink = 'conMultiLink(\'right_bottom\', \'' . $link . '\'); resetSearchForm();'; $sWorflowLink = 'conMultiLink(\'right_bottom\', \'' . $link . '\'); resetSearchForm();';
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="javascript:' . $sWorflowLink . '">' . i18n("Workflow") . '</a></li>'; $content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="javascript:' . $sWorflowLink . '">' . i18n("Workflow") . '</a></li>';
foreach ($savedSearchList as $value) foreach ($savedSearchList as $value) {
{ if (($init_itemid != $value['itemid']) && ($init_itemtype != $value['itemtype'])) {
if( ($init_itemid != $value['itemid']) && ($init_itemtype != $value['itemtype']) )
{
$init_itemid = $value['itemid']; $init_itemid = $value['itemid'];
$init_itemtype = $value['itemtype']; $init_itemtype = $value['itemtype'];
@ -327,8 +319,7 @@ foreach ($savedSearchList as $value)
$content .= '<a style="padding-left: 3px;" href="' . $savedSearchLink . '">'; $content .= '<a style="padding-left: 3px;" href="' . $savedSearchLink . '">';
} }
// Name the link // Name the link
if($value['name'] == 'save_name') if ($value['name'] == 'save_name') {
{
$content .= $value['value'] . '</a>'; $content .= $value['value'] . '</a>';
$content .= '</li>'; $content .= '</li>';
} }
@ -381,8 +372,7 @@ $editCategory = new cFoldingRow("3498dbbb-ed4a-4618-8e49-3a3635396e22", i18n("Ed
while ($db->next_record()) { while ($db->next_record()) {
$oTplname = $db->f('name'); $oTplname = $db->f('name');
if (strlen($oTplname) > 18) if (strlen($oTplname) > 18) {
{
$oTplname = substr($oTplname, 0, 15) . "..."; $oTplname = substr($oTplname, 0, 15) . "...";
} }
$oTpl->set('d', 'VALUE', $db->f('idtpl')); $oTpl->set('d', 'VALUE', $db->f('idtpl'));
@ -418,7 +408,6 @@ $editCategory->setContentData($editCat);
$oTpl->set('s', 'EDIT', $editCategory->render()); $oTpl->set('s', 'EDIT', $editCategory->render());
$oTpl->set('s', 'CATEGORYLINK', $categoryLink); $oTpl->set('s', 'CATEGORYLINK', $categoryLink);
##################################### #####################################
# Collapse / Expand / Config Category # Collapse / Expand / Config Category
##################################### #####################################
@ -434,6 +423,7 @@ $oTpl->set('s', 'PLUS', $expandimg);
/* SYNCSTUFF */ /* SYNCSTUFF */
/* * *********** */ /* * *********** */
$languages = getLanguageNamesByClient($client); $languages = getLanguageNamesByClient($client);
$sListId = '';
if (count($languages) > 1 && $perm->have_perm_area_action($area, "con_synccat")) { if (count($languages) > 1 && $perm->have_perm_area_action($area, "con_synccat")) {
$sListId = 'sync'; $sListId = 'sync';
$oListOptionRow = new cFoldingRow("4808dbba-ed4a-4618-8e49-3a3635396e22", i18n("Synchronize from"), $sListId); $oListOptionRow = new cFoldingRow("4808dbba-ed4a-4618-8e49-3a3635396e22", i18n("Synchronize from"), $sListId);
@ -449,10 +439,8 @@ if (count($languages) > 1 && $perm->have_perm_area_action($area, "con_synccat"))
$option = new cHTMLOptionElement("--- " . i18n("None") . " ---", -1); $option = new cHTMLOptionElement("--- " . i18n("None") . " ---", -1);
$selectbox->addOptionElement(-1, $option); $selectbox->addOptionElement(-1, $option);
foreach ($languages as $languageid => $languagename) foreach ($languages as $languageid => $languagename) {
{ if ($lang != $languageid && $perm->have_perm_client_lang($client, $languageid)) {
if ($lang != $languageid && $perm->have_perm_client_lang($client, $languageid))
{
$option = new cHTMLOptionElement($languagename . " (" . $languageid . ")", $languageid); $option = new cHTMLOptionElement($languagename . " (" . $languageid . ")", $languageid);
$selectbox->addOptionElement($languageid, $option); $selectbox->addOptionElement($languageid, $option);
} }
@ -489,7 +477,6 @@ if (count($languages) > 1 && $perm->have_perm_area_action($area, "con_synccat"))
$oTpl->set('s', 'SYNCLINK', $sListId); $oTpl->set('s', 'SYNCLINK', $sListId);
$sSyncLink = $sess->url($selflink . "?area=$area&frame=2&action=con_synccat"); $sSyncLink = $sess->url($selflink . "?area=$area&frame=2&action=con_synccat");
$oTpl->set('s', 'SYNC_HREF', $sSyncLink); $oTpl->set('s', 'SYNC_HREF', $sSyncLink);
} else { } else {
$oTpl->set('s', 'SYNCRONIZATION', ''); $oTpl->set('s', 'SYNCRONIZATION', '');
$oTpl->set('s', 'SYNCLINK', $sListId); $oTpl->set('s', 'SYNCLINK', $sListId);
@ -508,5 +495,3 @@ $oTpl->set('s', 'AJAXURL', $cfg['path']['contenido_fullhtml'].'ajaxmain.php');
########################################## ##########################################
$oTpl->set('s', 'HELPSCRIPT', setHelpContext("con")); $oTpl->set('s', 'HELPSCRIPT', setHelpContext("con"));
$oTpl->generate($cfg['path']['templates'] . $cfg['templates']['con_left_top']); $oTpl->generate($cfg['path']['templates'] . $cfg['templates']['con_left_top']);
?>

Datei anzeigen

@ -158,7 +158,7 @@ if ($fegroup->virgin == false && $fegroup->get("idclient") == $client)
$fegroup->store(); $fegroup->store();
} }
if (count($messages) > 0) if (is_array($messages) && count($messages) > 0)
{ {
$notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>"; $notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>";
} }

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -29,7 +30,6 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -42,10 +42,8 @@ if ($_REQUEST['useplugin'] != "category") {
$page = new cPage; $page = new cPage;
if (!in_array($useplugin, $cfg['plugins']['frontendlogic'])) if (!in_array($useplugin, $cfg['plugins']['frontendlogic'])) {
{
$page->setContent(i18n("Invalid plugin")); $page->setContent(i18n("Invalid plugin"));
} else { } else {
cInclude("plugins", "frontendlogic/$useplugin/" . $useplugin . ".php"); cInclude("plugins", "frontendlogic/$useplugin/" . $useplugin . ".php");
@ -54,7 +52,6 @@ if (!in_array($useplugin, $cfg['plugins']['frontendlogic']))
$class = new $className; $class = new $className;
$perms = new FrontendPermissionCollection; $perms = new FrontendPermissionCollection;
$rights = new UI_Table_Form("rights"); $rights = new UI_Table_Form("rights");
$rights->setVar("area", $area); $rights->setVar("area", $area);
$rights->setVar("frame", $frame); $rights->setVar("frame", $frame);
@ -65,65 +62,52 @@ if (!in_array($useplugin, $cfg['plugins']['frontendlogic']))
$actions = $class->listActions(); $actions = $class->listActions();
$items = $class->listItems(); $items = $class->listItems();
if ($action == "fegroups_save_perm") if ($action == "fegroups_save_perm") {
{
$myitems = $items; $myitems = $items;
$myitems["__GLOBAL__"] = "__GLOBAL__"; $myitems["__GLOBAL__"] = "__GLOBAL__";
foreach ($actions as $action => $text) foreach ($actions as $action => $text) {
{ foreach ($myitems as $item => $text) {
foreach ($myitems as $item => $text)
{
if ($item === "__GLOBAL__") if ($item === "__GLOBAL__") {
{
$varname = "action_$action"; $varname = "action_$action";
} else { } else {
$varname = "item_" . $item . "_$action"; $varname = "item_" . $item . "_$action";
} }
if ($_POST[$varname] == 1) if ($_POST[$varname] == 1) {
{
$perms->setPerm($idfrontendgroup, $useplugin, $action, $item); $perms->setPerm($idfrontendgroup, $useplugin, $action, $item);
} else { } else {
$perms->removePerm($idfrontendgroup, $useplugin, $action, $item); $perms->removePerm($idfrontendgroup, $useplugin, $action, $item);
} }
} }
} }
} }
$rights->addHeader(sprintf(i18n("Permissions for plugin '%s'"), $class->getFriendlyName())); $rights->addHeader(sprintf(i18n("Permissions for plugin '%s'"), $class->getFriendlyName()));
foreach ($actions as $key => $action) foreach ($actions as $key => $action) {
{
$check[$key] = new cHTMLCheckbox("action_$key", 1); $check[$key] = new cHTMLCheckbox("action_$key", 1);
$check[$key]->setLabelText($action . " " . i18n("(All)")); $check[$key]->setLabelText($action . " " . i18n("(All)"));
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, "__GLOBAL__")) if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, "__GLOBAL__")) {
{
$check[$key]->setChecked(true); $check[$key]->setChecked(true);
} }
} }
$rights->add(i18n("Global rights"), $check); $rights->add(i18n("Global rights"), $check);
foreach ($actions as $key => $action) foreach ($actions as $key => $action) {
{
unset($check); unset($check);
if (count($items) > 0) if (is_array($items) && count($items) > 0) {
{ foreach ($items as $item => $value) {
foreach ($items as $item => $value)
{
$check[$item] = new cHTMLCheckbox("item_" . $item . "_" . $key, 1); $check[$item] = new cHTMLCheckbox("item_" . $item . "_" . $key, 1);
$check[$item]->setLabelText($value); $check[$item]->setLabelText($value);
if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, $item)) if ($perms->checkPerm($idfrontendgroup, $useplugin, $key, $item)) {
{
$check[$item]->setChecked(true); $check[$item]->setChecked(true);
} }
} }
$rights->add($action, $check); $rights->add($action, $check);
@ -136,4 +120,3 @@ if (!in_array($useplugin, $cfg['plugins']['frontendlogic']))
} }
$page->render(); $page->render();
?>

Datei anzeigen

@ -162,7 +162,7 @@ if ($oFeUser->virgin == false && $oFeUser->get("idclient") == $client) {
if($bStore) $oFeUser->store(); if($bStore) $oFeUser->store();
} }
if (count($messages) > 0) { if (is_array($messages) && count($messages) > 0) {
$notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>"; $notis = $notification->returnNotification("warning", implode("<br>", $messages)) . "<br>";
} }

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,7 +28,6 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -42,7 +42,6 @@ $tpl->set('s', 'SID', $sess->id);
$clients = $classclient->getAccessibleClients(); $clients = $classclient->getAccessibleClients();
$tpl2 = new Template; $tpl2 = new Template;
$tpl2->set('s', 'ID', 'editclient'); $tpl2->set('s', 'ID', 'editclient');
$tpl2->set('s', 'NAME', 'editclient'); $tpl2->set('s', 'NAME', 'editclient');
@ -53,15 +52,13 @@ $iClientcount = count($clients);
foreach ($clients as $key => $value) { foreach ($clients as $key => $value) {
if ($client == $key) if ($client == $key) {
{
$selected = "selected"; $selected = "selected";
} else { } else {
$selected = ""; $selected = "";
} }
if (strlen($value['name']) > 15) if (strlen($value['name']) > 15) {
{
$value['name'] = substr($value['name'], 0, 12) . "..."; $value['name'] = substr($value['name'], 0, 12) . "...";
} }
@ -69,7 +66,6 @@ foreach ($clients as $key => $value) {
$tpl2->set('d', 'CAPTION', $value['name']); $tpl2->set('d', 'CAPTION', $value['name']);
$tpl2->set('d', 'SELECTED', $selected); $tpl2->set('d', 'SELECTED', $selected);
$tpl2->next(); $tpl2->next();
} }
$select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true); $select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true);
@ -85,5 +81,3 @@ if ($perm->have_perm_area_action($area, "lang_newlanguage") && $iClientcount > 0
} }
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['lang_left_top']); $tpl->generate($cfg['path']['templates'] . $cfg['templates']['lang_left_top']);
?>

Datei anzeigen

@ -107,7 +107,11 @@ if (!$layout->virgin) {
} }
$types = array_unique($types); $types = array_unique($types);
if (version_compare(PHP_VERSION, '7.4.0', '>=')) {
$layout->setProperty("layout", "used-types", implode(";", $types));
} else {
$layout->setProperty("layout", "used-types", implode($types, ";")); $layout->setProperty("layout", "used-types", implode($types, ";"));
}
$msg = ""; $msg = "";

Datei anzeigen

@ -49,7 +49,7 @@ while ($layout = $oLayouts->next()) {
} }
$name = $layout->get('name'); $name = $layout->get('name');
$descr = $layout->get('description'); $descr = cString::nullToString($layout->get('description'));
$idlay = $layout->get('idlay'); $idlay = $layout->get('idlay');
if (strlen($descr) > 64) { if (strlen($descr) > 64) {
@ -102,7 +102,7 @@ while ($layout = $oLayouts->next()) {
$tpl->set('d', 'TODO', $todo->render()); $tpl->set('d', 'TODO', $todo->render());
if (stripslashes($_REQUEST['idlay']) == $idlay) { if (filter_var($_REQUEST['idlay'], FILTER_SANITIZE_NUMBER_INT) == $idlay) {
$tpl->set('d', 'ID', 'marked'); $tpl->set('d', 'ID', 'marked');
} else { } else {
$tpl->set('d', 'ID', ''); $tpl->set('d', 'ID', '');

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,15 +28,17 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
// check request
$_REQUEST["sortby"] = (empty($_REQUEST["sortby"]))?'': htmlspecialchars($_REQUEST["sortby"]);
$_REQUEST["sortorder"] = (empty($_REQUEST["sortorder"]))?'': htmlspecialchars($_REQUEST["sortorder"]);
$_REQUEST["filter"] = (empty($_REQUEST["filter"]))?'': htmlspecialchars($_REQUEST["filter"]);
$oUser = new cApiUser($auth->auth["uid"]); $oUser = new cApiUser($auth->auth["uid"]);
if (!isset($elemperpage) || !is_numeric($elemperpage) || $elemperpage < 0) if (!isset($elemperpage) || !is_numeric($elemperpage) || $elemperpage < 0) {
{
$elemperpage = $oUser->getProperty("itemsperpage", $area); $elemperpage = $oUser->getProperty("itemsperpage", $area);
$_REQUEST['elemperpage'] = $elemperpage; $_REQUEST['elemperpage'] = $elemperpage;
if ((int) $elemperpage <= 0) { if ((int) $elemperpage <= 0) {
@ -66,7 +69,6 @@ $tpl->set('s', 'OPTIONS', '');
$tpl->set('s', 'SID', $sess->id); $tpl->set('s', 'SID', $sess->id);
$tpl->set('s', 'SESSID', $sess->id); $tpl->set('s', 'SESSID', $sess->id);
$tpl2 = new Template; $tpl2 = new Template;
$tpl2->set('s', 'NAME', 'restrict'); $tpl2->set('s', 'NAME', 'restrict');
$tpl2->set('s', 'CLASS', 'text_medium'); $tpl2->set('s', 'CLASS', 'text_medium');
@ -79,8 +81,7 @@ $limit = array(
foreach ($limit as $key => $value) { foreach ($limit as $key => $value) {
if ($restrict == $key) if (!empty($restrict) && $restrict == $key) {
{
$selected = "selected"; $selected = "selected";
} else { } else {
$selected = ""; $selected = "";
@ -90,7 +91,6 @@ foreach ($limit as $key => $value) {
$tpl2->set('d', 'CAPTION', $value); $tpl2->set('d', 'CAPTION', $value);
$tpl2->set('d', 'SELECTED', $selected); $tpl2->set('d', 'SELECTED', $selected);
$tpl2->next(); $tpl2->next();
} }
$select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true); $select = $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true);
@ -189,11 +189,11 @@ $oPagerLink->enableAutomaticParameterAppend();
$oPagerLink->setCustom("contenido", $sess->id); $oPagerLink->setCustom("contenido", $sess->id);
$pagerID = "pager"; $pagerID = "pager";
$page = (isset($page))?$page:1;
$oPager = new cObjectPager("44b41691-0dd4-443c-a594-66a8164e25fd", $iItemCount, $elemperpage, $page, $oPagerLink, "page", $pagerID); $oPager = new cObjectPager("44b41691-0dd4-443c-a594-66a8164e25fd", $iItemCount, $elemperpage, $page, $oPagerLink, "page", $pagerID);
$oPager->setExpanded('true'); $oPager->setExpanded('true');
$tpl->set('s', 'PAGINGLINK', $pagerID); $tpl->set('s', 'PAGINGLINK', $pagerID);
$tpl->set('s', 'PAGING', $oPager->render()); $tpl->set('s', 'PAGING', $oPager->render());
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['rights_left_top']); $tpl->generate($cfg['path']['templates'] . $cfg['templates']['rights_left_top']);
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -28,7 +29,6 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -40,15 +40,15 @@ $cApiUserCollection = new cApiUserCollection;
$cApiUserCollection->query(); $cApiUserCollection->query();
$iSumUsers = $cApiUserCollection->count(); $iSumUsers = $cApiUserCollection->count();
if (isset($_REQUEST["sortby"]) && $_REQUEST["sortby"] != "") if (empty($_REQUEST["sortby"])) {
{ $_REQUEST["sortby"] = 'username';
$cApiUserCollection->setOrder($_REQUEST["sortby"]. " ". $_REQUEST["sortorder"]); $_REQUEST["sortorder"] = 'asc';
} else {
$cApiUserCollection->setOrder("username asc"); $cApiUserCollection->setOrder("username asc");
} }
if (isset($_REQUEST["filter"]) && $_REQUEST["filter"] != "") $cApiUserCollection->setOrder($_REQUEST["sortby"] . " " . $_REQUEST["sortorder"]);
{
if (!empty($_REQUEST["filter"])) {
$cApiUserCollection->setWhereGroup("default", "username", "%" . $_REQUEST["filter"] . "%", "LIKE"); $cApiUserCollection->setWhereGroup("default", "username", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "realname", "%" . $_REQUEST["filter"] . "%", "LIKE"); $cApiUserCollection->setWhereGroup("default", "realname", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setWhereGroup("default", "email", "%" . $_REQUEST["filter"] . "%", "LIKE"); $cApiUserCollection->setWhereGroup("default", "email", "%" . $_REQUEST["filter"] . "%", "LIKE");
@ -59,6 +59,8 @@ if (isset($_REQUEST["filter"]) && $_REQUEST["filter"] != "")
$cApiUserCollection->setWhereGroup("default", "address_country", "%" . $_REQUEST["filter"] . "%", "LIKE"); $cApiUserCollection->setWhereGroup("default", "address_country", "%" . $_REQUEST["filter"] . "%", "LIKE");
$cApiUserCollection->setInnerGroupCondition("default", "OR"); $cApiUserCollection->setInnerGroupCondition("default", "OR");
} else {
$_REQUEST["filter"] = '';
} }
$cApiUserCollection->query(); $cApiUserCollection->query();
@ -67,54 +69,37 @@ $aCurrentUserAccessibleClients = $classclient->getAccessibleClients();
$iMenu = 0; $iMenu = 0;
$iItemCount = 0; $iItemCount = 0;
$mPage = $_REQUEST["page"]; $mPage = (isset($_REQUEST["page"])) ? (int) $_REQUEST["page"] : 1;
if ($mPage == 0) $elemperpage = (isset($_REQUEST["elemperpage"])) ? (int) $_REQUEST["elemperpage"] : 25;
{
$mPage = 1;
}
$elemperpage = $_REQUEST["elemperpage"];
if ($elemperpage == 0)
{
$elemperpage = 25;
}
$mlist = new UI_Menu; $mlist = new UI_Menu;
$sToday = date('Y-m-d'); $sToday = date('Y-m-d');
if (($elemperpage * $mPage) >= $iSumUsers + $elemperpage && $mPage != 1) { if (($elemperpage * $mPage) >= $iSumUsers + $elemperpage && $mPage != 1) {
$_REQUEST["page"]--; $_REQUEST["page"]--;
$mPage--; $mPage--;
} }
while ($cApiUser = $cApiUserCollection->next()) while ($cApiUser = $cApiUserCollection->next()) {
{
$userid = $cApiUser->get("user_id"); $userid = $cApiUser->get("user_id");
$aUserPermissions = explode(',', $cApiUser->get('perms')); $aUserPermissions = explode(',', $cApiUser->get('perms'));
$bDisplayUser = false; $bDisplayUser = false;
if (in_array("sysadmin", $aCurrentUserPermissions)) if (in_array("sysadmin", $aCurrentUserPermissions)) {
{
$bDisplayUser = true; $bDisplayUser = true;
} }
foreach ($aCurrentUserAccessibleClients as $key => $value) foreach ($aCurrentUserAccessibleClients as $key => $value) {
{ if (in_array("client[$key]", $aUserPermissions)) {
if (in_array("client[$key]", $aUserPermissions))
{
$bDisplayUser = true; $bDisplayUser = true;
} }
} }
foreach ($aUserPermissions as $sLocalPermission) foreach ($aUserPermissions as $sLocalPermission) {
{ if (in_array($sLocalPermission, $aCurrentUserPermissions)) {
if (in_array($sLocalPermission, $aCurrentUserPermissions))
{
$bDisplayUser = true; $bDisplayUser = true;
} }
} }
@ -123,18 +108,15 @@ while ($cApiUser = $cApiUserCollection->next())
$link->setMultiLink("user", "", "user_overview", ""); $link->setMultiLink("user", "", "user_overview", "");
$link->setCustom("userid", $cApiUser->get("user_id")); $link->setCustom("userid", $cApiUser->get("user_id"));
if ($bDisplayUser == true) if ($bDisplayUser == true) {
{
$iItemCount++; $iItemCount++;
if ($iItemCount > ($elemperpage * ($mPage - 1)) && $iItemCount < (($elemperpage * $mPage) + 1)) if ($iItemCount > ($elemperpage * ($mPage - 1)) && $iItemCount < (($elemperpage * $mPage) + 1)) {
{
if ($perm->have_perm_area_action('user', "user_delete")) { if ($perm->have_perm_area_action('user', "user_delete")) {
$message = sprintf(i18n("Do you really want to delete the user %s?"), $cApiUser->get("username")); $message = sprintf(i18n("Do you really want to delete the user %s?"), $cApiUser->get("username"));
$delTitle = i18n("Delete user"); $delTitle = i18n("Delete user");
$deletebutton = '<a title="' . $delTitle . '" href="javascript://" onclick="box.confirm(\'' . $delTitle . '\', \'' . $message . '\', \'deleteBackenduser(\\\'' . $userid . '\\\')\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $delTitle . '" alt="' . $delTitle . '"></a>'; $deletebutton = '<a title="' . $delTitle . '" href="javascript://" onclick="box.confirm(\'' . $delTitle . '\', \'' . $message . '\', \'deleteBackenduser(\\\'' . $userid . '\\\')\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $delTitle . '" alt="' . $delTitle . '"></a>';
} else { } else {
$deletebutton = ""; $deletebutton = "";
} }
@ -157,12 +139,11 @@ while ($cApiUser = $cApiUserCollection->next())
$mlist->setLink($iMenu, $link); $mlist->setLink($iMenu, $link);
$mlist->setActions($iMenu, "delete", $deletebutton); $mlist->setActions($iMenu, "delete", $deletebutton);
if ($_GET['userid'] == $cApiUser->get("user_id")) { if (!empty($_GET['userid']) && $_GET['userid'] == $cApiUser->get("user_id")) {
$mlist->setExtra($iMenu, 'id="marked" '); $mlist->setExtra($iMenu, 'id="marked" ');
} }
} }
} }
} }
$deleteScript = '<script type="text/javascript"> $deleteScript = '<script type="text/javascript">
@ -226,9 +207,9 @@ $oPagerLink->enableAutomaticParameterAppend();
$oPagerLink->setCustom("contenido", $sess->id); $oPagerLink->setCustom("contenido", $sess->id);
$pagerID = "pager"; $pagerID = "pager";
$page = (empty($page))?1:(int)$page;
$oPager = new cObjectPager("44b41691-0dd4-443c-a594-66a8164e25fd", $iItemCount, $elemperpage, $page, $oPagerLink, "page", $pagerID); $oPager = new cObjectPager("44b41691-0dd4-443c-a594-66a8164e25fd", $iItemCount, $elemperpage, $page, $oPagerLink, "page", $pagerID);
//add slashes, to insert in javascript //add slashes, to insert in javascript
$sPagerContent = $oPager->render(1); $sPagerContent = $oPager->render(1);
$sPagerContent = str_replace('\\', '\\\\', $sPagerContent); $sPagerContent = str_replace('\\', '\\\\', $sPagerContent);
@ -252,5 +233,3 @@ $sRefreshPager = '
$oPage->addScript('refreshpager', $sRefreshPager); $oPage->addScript('refreshpager', $sRefreshPager);
$oPage->render(); $oPage->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -35,7 +36,6 @@
* TODO error handling!!! * TODO error handling!!!
* TODO export functions to new ConUser object! * TODO export functions to new ConUser object!
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -43,7 +43,6 @@ if(!defined('CON_FRAMEWORK')) {
cInclude('includes', 'functions.rights.php'); cInclude('includes', 'functions.rights.php');
if (!($perm->have_perm_area_action($area, $action) || $perm->have_perm_area_action('user', $action))) { if (!($perm->have_perm_area_action($area, $action) || $perm->have_perm_area_action('user', $action))) {
// access denied // access denied
$notification->displayNotification("error", i18n("Permission denied")); $notification->displayNotification("error", i18n("Permission denied"));
@ -158,13 +157,19 @@ $oUser = new User();
$oUser->loadUserByUserID(Contenido_Security::escapeDB($userid, $db)); $oUser->loadUserByUserID(Contenido_Security::escapeDB($userid, $db));
// delete user property // delete user property
if (is_string($del_userprop_type) && is_string($del_userprop_name)) { if (!empty($del_userprop_type)
&& !empty($del_userprop_name)
&& is_string($del_userprop_type)
&& is_string($del_userprop_name)) {
$oUser->deleteUserProperty($del_userprop_type, $del_userprop_name); $oUser->deleteUserProperty($del_userprop_type, $del_userprop_name);
} }
// edit user property // edit user property
if (is_string($userprop_type) && is_string($userprop_name) && is_string($userprop_value) if (!empty($userprop_type)
&& !empty($userprop_type) && !empty($userprop_name)) { && !empty($userprop_name)
&& is_string($userprop_type)
&& is_string($userprop_name)
&& is_string($userprop_value)) {
$oUser->setUserProperty($userprop_type, $userprop_name, $userprop_value); $oUser->setUserProperty($userprop_type, $userprop_name, $userprop_value);
} }
@ -193,7 +198,6 @@ $tpl->set('s', 'SUBMITTEXT', i18n("Save changes"));
$tpl->set('s', 'CANCELTEXT', i18n("Discard changes")); $tpl->set('s', 'CANCELTEXT', i18n("Discard changes"));
$tpl->set('s', 'CANCELLINK', $sess->url("main.php?area=$area&frame=4&userid=$userid")); $tpl->set('s', 'CANCELLINK', $sess->url("main.php?area=$area&frame=4&userid=$userid"));
$tpl->set('d', 'CATNAME', i18n("Property")); $tpl->set('d', 'CATNAME', i18n("Property"));
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_header"]); $tpl->set('d', 'BGCOLOR', $cfg["color"]["table_header"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]); $tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
@ -213,7 +217,7 @@ $tpl->set('d', 'CATFIELD', formGenerateField("text", "realname", $oUser->getFiel
$tpl->next(); $tpl->next();
// @since 2006-07-04 Display password fields only if not authenticated via LDAP/AD // @since 2006-07-04 Display password fields only if not authenticated via LDAP/AD
if ($msysadmin || $oUser->getField('password') != 'active_directory_auth') { if ((isset($msysadmin) && $msysadmin) || $oUser->getField('password') != 'active_directory_auth') {
$tpl->set('d', 'CATNAME', i18n("New password")); $tpl->set('d', 'CATNAME', i18n("New password"));
$tpl->set('d', 'BGCOLOR', $cfg["color"]["table_light"]); $tpl->set('d', 'BGCOLOR', $cfg["color"]["table_light"]);
$tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]); $tpl->set('d', 'BORDERCOLOR', $cfg["color"]["table_border"]);
@ -465,5 +469,4 @@ $tpl->next();
// Generate template // Generate template
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['rights_overview']); $tpl->generate($cfg['path']['templates'] . $cfg['templates']['rights_overview']);
?> ?>

Datei anzeigen

@ -111,6 +111,7 @@ $aManagedProperties = array(
); );
$aSettings = getSystemProperties(1); $aSettings = getSystemProperties(1);
$sNotification = '';
if (isset($_POST['action']) && $_POST['action'] == 'edit_sysconf' && $perm->have_perm_area_action($area, 'edit_sysconf')) { if (isset($_POST['action']) && $_POST['action'] == 'edit_sysconf' && $perm->have_perm_area_action($area, 'edit_sysconf')) {
$bStored = false; $bStored = false;
@ -193,4 +194,3 @@ if ($perm->have_perm_area_action($area, 'edit_sysconf')) {
} }
$oPage->addScript('setMenu', $sJs); $oPage->addScript('setMenu', $sJs);
$oPage->render(); $oPage->render();
?>

Datei anzeigen

@ -38,6 +38,7 @@ $aManagedValues = array('versioning_prune_limit', 'update_check', 'update_news_f
'system_mail_sender_name', 'pw_request_enable', 'maintenance_mode', 'edit_area_activated', 'system_mail_sender_name', 'pw_request_enable', 'maintenance_mode', 'edit_area_activated',
'backend_preferred_idclient', 'generator_basehref', 'generator_xhtml', 'imagemagick_available', 'backend_preferred_idclient', 'generator_basehref', 'generator_xhtml', 'imagemagick_available',
'system_insight_editing_activated'); 'system_insight_editing_activated');
$sWarning = '';
if ($action == "systemsettings_save_item") { if ($action == "systemsettings_save_item") {
if (!in_array($systype . '_' . $sysname, $aManagedValues)) { if (!in_array($systype . '_' . $sysname, $aManagedValues)) {

Datei anzeigen

@ -153,7 +153,6 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$descr = new cHTMLTextarea("description", $description); $descr = new cHTMLTextarea("description", $description);
$form->add(i18n("Description"), $descr->render()); $form->add(i18n("Description"), $descr->render());
$standardcb = new cHTMLCheckbox("vdefault", 1, "", $vdefault); $standardcb = new cHTMLCheckbox("vdefault", 1, "", $vdefault);
$form->add(i18n("Default"), $standardcb->toHTML(false)); $form->add(i18n("Default"), $standardcb->toHTML(false));
@ -165,7 +164,13 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$raw_code = ($oLayout->virgin) ? "" : $oLayout->getLayout(); $raw_code = ($oLayout->virgin) ? "" : $oLayout->getLayout();
tplPreparseLayout($idlay, $raw_code); tplPreparseLayout($idlay, $raw_code);
$tmp_returnstring = tplBrowseLayoutForContainers($idlay, $raw_code); $tmp_returnstring = tplBrowseLayoutForContainers($idlay, $raw_code);
var_dump($tmp_returnstring);
if(empty($tmp_returnstring)) {
$a_container = [];
} else {
$a_container = explode("&", $tmp_returnstring); $a_container = explode("&", $tmp_returnstring);
}
foreach ($a_container as $key => $value) { foreach ($a_container as $key => $value) {
if ($value != 0) { if ($value != 0) {
// Loop through containers **************** // Loop through containers ****************
@ -251,4 +256,3 @@ if (($action == "tpl_new") && (!$perm->have_perm_area_action_anyitem($area, $act
$page->render(); $page->render();
} }
?>

Datei anzeigen

@ -278,7 +278,7 @@ $tpl->set('s', 'TEMPLATECAPTION', i18n("Template"));
$tpl2 = new Template; $tpl2 = new Template;
$tpl2->set('s', 'NAME', 'idtpl'); $tpl2->set('s', 'NAME', 'idtpl');
$tpl2->set('s', 'CLASS', 'text_medium'); $tpl2->set('s', 'CLASS', 'text_medium');
$disabled2 = '';
if (!$perm->have_perm_area_action_item("con", "con_changetemplate", $idcat)) { if (!$perm->have_perm_area_action_item("con", "con_changetemplate", $idcat)) {
$disabled2 = 'disabled="disabled"'; $disabled2 = 'disabled="disabled"';
} }

Datei anzeigen

@ -73,6 +73,10 @@ if (!isset($path) && $sess->is_registered("upl_last_path")) {
$path = $upl_last_path; $path = $upl_last_path;
} }
if(is_null($path)) {
$path = '';
}
$appendparameters = $_REQUEST["appendparameters"]; $appendparameters = $_REQUEST["appendparameters"];
if (!isset($action)) if (!isset($action))

Datei anzeigen

@ -347,7 +347,7 @@ class UploadList extends FrontendList {
case "xbm": case "xbm":
case "wbmp": case "wbmp":
$sCacheThumbnail = uplGetThumbnail($data, 150); $sCacheThumbnail = uplGetThumbnail($data, 150);
$sCacheName = substr($sCacheThumbnail, strrpos($sCacheThumbnail, "/") + 1, strlen($sCacheThumbnail) - (strrchr($sCacheThumbnail, '/') + 1)); $sCacheName = substr($sCacheThumbnail, strrpos($sCacheThumbnail, "/") + 1, strlen($sCacheThumbnail) - (strlen(strrchr($sCacheThumbnail, '/')) + 1));
$sFullPath = $cfgClient[$client]['path']['frontend'] . 'cache/' . $sCacheName; $sFullPath = $cfgClient[$client]['path']['frontend'] . 'cache/' . $sCacheName;
if (file_exists($sFullPath)) { if (file_exists($sFullPath)) {
$aDimensions = getimagesize($sFullPath); $aDimensions = getimagesize($sFullPath);
@ -430,18 +430,22 @@ class UploadList extends FrontendList {
* @param type $sErrorMessage * @param type $sErrorMessage
* @return type * @return type
*/ */
function uplRender($path, $sortby, $sortmode, $startpage = 1, $thumbnailmode, $sErrorMessage) { function uplRender($path, $sortby, $sortmode, $startpage, $thumbnailmode, $sErrorMessage) {
global $cfg, $client, $cfgClient, $area, $frame, $sess, $browserparameters, $appendparameters, $perm, $auth, $sReloadScript, $notification, $bDirectoryIsWritable; global $cfg, $client, $cfgClient, $area, $frame, $sess, $browserparameters, $appendparameters, $perm, $auth, $sReloadScript, $notification, $bDirectoryIsWritable;
if ($sortby == "") { if(empty($sortby)) {
$sortby = 3; $sortby = 3;
$sortmode = "ASC"; $sortmode = "ASC";
} }
if ($startpage == "") { if(empty($startpage)) {
$startpage = 1; $startpage = 1;
} }
if(is_null($path)) {
$path = '';
}
$thisfile = $sess->url("main.php?idarea=$area&frame=$frame&path=$path&thumbnailmode=$thumbnailmode&appendparameters=$appendparameters"); $thisfile = $sess->url("main.php?idarea=$area&frame=$frame&path=$path&thumbnailmode=$thumbnailmode&appendparameters=$appendparameters");
$scrollthisfile = $thisfile . "&sortmode=$sortmode&sortby=$sortby&appendparameters=$appendparameters"; $scrollthisfile = $thisfile . "&sortmode=$sortmode&sortby=$sortby&appendparameters=$appendparameters";

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -31,7 +32,6 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -56,7 +56,6 @@ if ($saveLoginTime == true) {
$timestamp = date("Y-m-d H:i:s"); $timestamp = date("Y-m-d H:i:s");
$vuser->setUserProperty("system", "currentlogintime", $timestamp); $vuser->setUserProperty("system", "currentlogintime", $timestamp);
$vuser->setUserProperty("system", "lastlogintime", $lastTime); $vuser->setUserProperty("system", "lastlogintime", $lastTime);
} }
$vuser = new User(); $vuser = new User();
@ -127,7 +126,6 @@ if (count($clients) > 1) {
} else { } else {
$warnings[] = sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key); $warnings[] = sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key);
} }
} }
} }
@ -155,7 +153,6 @@ if (count($clients) > 1) {
$oTpl->set('s', 'CLIENTFORM', $sClientForm); $oTpl->set('s', 'CLIENTFORM', $sClientForm);
$oTpl->set('s', 'CLIENTFORMCLOSE', ''); $oTpl->set('s', 'CLIENTFORMCLOSE', '');
foreach ($clients as $key => $v_client) { foreach ($clients as $key => $v_client) {
if ($perm->hasClientPermission($key)) { if ($perm->hasClientPermission($key)) {
$cApiClient->loadByPrimaryKey($key); $cApiClient->loadByPrimaryKey($key);
@ -179,29 +176,30 @@ if (count($clients) > 1) {
$props = new PropertyCollection; $props = new PropertyCollection;
$props->select("itemtype = 'idcommunication' AND idclient='$client' AND type = 'todo' AND name = 'status' AND value != 'done'"); $props->select("itemtype = 'idcommunication' AND idclient='$client' AND type = 'todo' AND name = 'status' AND value != 'done'");
$todoitems= array (); $aItemsTodo = [];
while ($prop = $props->next()) { while ($prop = $props->next()) {
$todoitems[]= $prop->get("itemid"); $aItemsTodo[] = $prop->get("itemid");
} }
if (count($todoitems) > 0) { if (count($aItemsTodo) > 0) {
$in= "idcommunication IN (" . implode(",", $todoitems) . ")"; $in = "idcommunication IN (" . implode(",", $aItemsTodo) . ")";
} else { } else {
$in = 1; $in = 1;
} }
$todoitems= new TODOCollection; $todoitems = new TODOCollection();
$recipient = $auth->auth["uid"]; $recipient = $auth->auth["uid"];
$todoitems->select("recipient = '$recipient' AND idclient='$client' AND $in"); $todoitems->select("recipient = '$recipient' AND idclient='$client' AND $in");
$iItemsTodoOpen = 0;
while ($todo = $todoitems->next()) { while ($todo = $todoitems->next()) {
if ($todo->getProperty("todo", "status") != "done") { if ($todo->getProperty("todo", "status") != "done") {
$todoitems++; $iItemsTodoOpen++;
} }
} }
$sTaskTranslation = ''; $sTaskTranslation = '';
if ($todoitems->count() == 1) { if ($iItemsTodoOpen == 1) {
$sTaskTranslation = i18n("Reminder list: %d Task open"); $sTaskTranslation = i18n("Reminder list: %d Task open");
} else { } else {
$sTaskTranslation = i18n("Reminder list: %d Tasks open"); $sTaskTranslation = i18n("Reminder list: %d Tasks open");
@ -209,7 +207,7 @@ if ($todoitems->count() == 1) {
$mycontenido_overview = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido&frame=4") . '">' . i18n("Overview") . '</a>'; $mycontenido_overview = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido&frame=4") . '">' . i18n("Overview") . '</a>';
$mycontenido_lastarticles = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_recent&frame=4") . '">' . i18n("Recently edited articles") . '</a>'; $mycontenido_lastarticles = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_recent&frame=4") . '">' . i18n("Recently edited articles") . '</a>';
$mycontenido_tasks= '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_tasks&frame=4") . '">' . sprintf($sTaskTranslation, $todoitems->count()) . '</a>'; $mycontenido_tasks = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_tasks&frame=4") . '">' . sprintf($sTaskTranslation, $iItemsTodoOpen) . '</a>';
$mycontenido_settings = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_settings&frame=4") . '">' . i18n("Settings") . '</a>'; $mycontenido_settings = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_settings&frame=4") . '">' . i18n("Settings") . '</a>';
$oTpl->set('s', 'MYCONTENIDO_OVERVIEW', $mycontenido_overview); $oTpl->set('s', 'MYCONTENIDO_OVERVIEW', $mycontenido_overview);
@ -224,7 +222,6 @@ $sAdminName= "";
$sAdminEmail = ""; $sAdminEmail = "";
$sOutputAdmin = ""; $sOutputAdmin = "";
foreach ($admins as $key => $value) { foreach ($admins as $key => $value) {
if ($value["email"] != "") { if ($value["email"] != "") {
$sAdminEmail = '<a class="blue" href="mailto:' . $value["email"] . '">' . $value["email"] . '</a>'; $sAdminEmail = '<a class="blue" href="mailto:' . $value["email"] . '">' . $value["email"] . '</a>';
@ -276,8 +273,7 @@ $oTpl->set('s', 'Anzahl', $iNumberOfUsers);
if ($perm->isSysadmin($vuser) && isset($cfg["backend"]["newsfeed"]) && $cfg["backend"]["newsfeed"] == true) { if ($perm->isSysadmin($vuser) && isset($cfg["backend"]["newsfeed"]) && $cfg["backend"]["newsfeed"] == true) {
$newsfeed = 'some news'; $newsfeed = 'some news';
$oTpl->set('s', 'CONTENIDO_NEWS', $newsfeed); $oTpl->set('s', 'CONTENIDO_NEWS', $newsfeed);
} } else {
else{
$oTpl->set('s', 'CONTENIDO_NEWS', ''); $oTpl->set('s', 'CONTENIDO_NEWS', '');
} }
@ -287,5 +283,4 @@ $sUpdateNotifierOutput = $oUpdateNotifier->displayOutput();
$oTpl->set('s', 'UPDATENOTIFICATION', $sUpdateNotifierOutput); $oTpl->set('s', 'UPDATENOTIFICATION', $sUpdateNotifierOutput);
$oTpl->generate($cfg["path"]["templates"] . $cfg["templates"]["welcome"]); $oTpl->generate($cfg["path"]["templates"] . $cfg["templates"]["welcome"]);
?> ?>

Datei anzeigen

@ -194,9 +194,15 @@ function logMessage($msg, $PC_writeDir, $PC_useLog, $PC_debug) {
} }
function lTrimZeros($number) { function lTrimZeros($number) {
/*
while ($number[0] == '0') { while ($number[0] == '0') {
$number = substr($number, 1); $number = substr($number, 1);
} }
*
*/
$number = intval(ltrim($number, '0'));
return (is_numeric($number))?$number:0; return (is_numeric($number))?$number:0;
} }

2
conlite/includes/startup.php Ausführbare Datei → Normale Datei
Datei anzeigen

@ -71,7 +71,7 @@ if (!defined('CL_ENVIRONMENT')) {
*/ */
if (!defined('CL_VERSION')) { if (!defined('CL_VERSION')) {
define('CL_VERSION', '2.1.3'); define('CL_VERSION', '2.2.0 beta');
} }

Datei anzeigen

@ -225,7 +225,7 @@ class MetaTagCreatorHtml5 {
* @return boolean * @return boolean
*/ */
protected function _addFacebookMetaTags() { protected function _addFacebookMetaTags() {
if(!$this->_aConfig['add_facebook_meta']) return; if(empty($this->_aConfig['add_facebook_meta'])) return;
// add always article data, cause they needed for fb-meta // add always article data, cause they needed for fb-meta
if($this->_aConfig['add_article_meta'] === false) { if($this->_aConfig['add_article_meta'] === false) {
$this->_aConfig['add_article_meta'] = true; $this->_aConfig['add_article_meta'] = true;

@ -1 +1 @@
Subproject commit 3217b73d08e1b76193f02d2d912134320ef40bfe Subproject commit 91b0fd8c15cdf1b5e9704c8720a40f959e7eb4fe

Datei anzeigen

@ -212,7 +212,7 @@ class pimSetupPluginInstall extends pimSetupBase {
private function _addNavMain() { private function _addNavMain() {
$aAttributes = array(); $aAttributes = array();
$iCountNavMain = count(self::$XmlNavMain->nav); $iCountNavMain = (is_countable(self::$XmlNavMain->nav))?count(self::$XmlNavMain->nav):0;
if ($iCountNavMain > 0) { if ($iCountNavMain > 0) {
$oNavMainColl = new cApiNavMainCollection(); $oNavMainColl = new cApiNavMainCollection();

Datei anzeigen

@ -1,106 +0,0 @@
var display_url;
function createMenu (menuname, items, links)
{
document.writeln('<div id="' + menuname + '" class="skin0" onMouseover="highlightie5(event)" onMouseout="lowlightie5(event)" onClick="jumptoie5(event)" display:none>');
document.writeln('<div class="skin1">Context Menu</div>');
for (var i = 0; i < items.length; i++)
{
if (items[i] == "--")
{
document.writeln('<hr style="line-height:4px;border: 0px;border-bottom:1px;border-color: black; border-style: solid;">');
} else {
document.writeln('<div class="menuitems" url="' + links[i] + '">' + items[i] + '</div>');
}
}
document.writeln('</div>');
document.getElementById(menuname).style.display = '';
}
var ie5 = document.all && document.getElementById
var ns6 = document.getElementById && !document.all
if (ie5 || ns6)
//var menuobj=document.getElementById("ie5menu")
function showmenuie5(e){
if (ie5)
{
menuobj = document.getElementById(window.event.srcElement.getAttribute("helpid"));
} else
{
menuobj = document.getElementById(e.target.getAttribute("helpid"));
}
//Find out how close the mouse is to the corner of the window
var rightedge = ie5? document.body.clientWidth - event.clientX : window.innerWidth - e.clientX
var bottomedge = ie5? document.body.clientHeight - event.clientY : window.innerHeight - e.clientY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge < menuobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left = ie5? document.body.scrollLeft + event.clientX - menuobj.offsetWidth : window.pageXOffset + e.clientX - menuobj.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left = ie5? document.body.scrollLeft + event.clientX : window.pageXOffset + e.clientX
//same concept with the vertical position
if (bottomedge < menuobj.offsetHeight)
menuobj.style.top = ie5? document.body.scrollTop + event.clientY - menuobj.offsetHeight : window.pageYOffset + e.clientY - menuobj.offsetHeight
else
menuobj.style.top = ie5? document.body.scrollTop + event.clientY : window.pageYOffset + e.clientY
menuobj.style.visibility = "visible"
return false;
}
function hidemenuie5(e){
if (typeof menuobj == "object")
{
menuobj.style.visibility = "hidden"
}
}
function highlightie5(e){
var firingobj = ie5? event.srcElement : e.target
if (firingobj.className == "menuitems" || ns6 && firingobj.parentNode.className == "menuitems"){
if (ns6 && firingobj.parentNode.className == "menuitems") firingobj = firingobj.parentNode //up one node
firingobj.style.backgroundColor = "#F4F8BD"
firingobj.style.color = "black"
firingobj.style.cursor = "pointer"
if (display_url == 1)
window.status = event.srcElement.url
}
}
function lowlightie5(e){
var firingobj = ie5? event.srcElement : e.target
if (firingobj.className == "menuitems" || ns6 && firingobj.parentNode.className == "menuitems"){
if (ns6 && firingobj.parentNode.className == "menuitems") firingobj = firingobj.parentNode //up one node
firingobj.style.backgroundColor = ""
firingobj.style.color = "black"
window.status = ''
}
}
function jumptoie5(e){
var firingobj = ie5? event.srcElement : e.target
if (firingobj.className == "menuitems" || ns6 && firingobj.parentNode.className == "menuitems"){
if (ns6 && firingobj.parentNode.className == "menuitems") firingobj = firingobj.parentNode
if (firingobj.getAttribute("target"))
window.open(firingobj.getAttribute("url"), firingobj.getAttribute("target"))
else
window.location = firingobj.getAttribute("url")
}
}
var menuobj;
if (ie5 || ns6){
//menuobj.style.display=''
document.oncontextmenu = showmenuie5
document.onclick = hidemenuie5
}

Datei anzeigen

@ -220,7 +220,9 @@
parent.parent.frames["right"].frames["right_top"].sub.clicked(menuItem.firstChild); parent.parent.frames["right"].frames["right_top"].sub.clicked(menuItem.firstChild);
} }
{DATAPUSH} {
DATAPUSH
}
</script> </script>
</body> </body>

Datei anzeigen

@ -18,10 +18,10 @@
<tr> <tr>
<td class="text_medium" style="border: 0px; border-bottom:1px; border-color: #a9aec2; border-style: solid"> <td class="text_medium" style="border: 0px; border-bottom:1px; border-color: #a9aec2; border-style: solid">
<br><b>Current version:</b><br> <br><b>Current version:</b><br>
Carsten Peters, Markus H&uuml;bner, Ortwin Pinke, Ren&eacute; Mansveld, Steffen Reddig, Thomas Dubbert Carsten Peters, Markus H&uuml;bner, Ortwin Pinke, Lars Lämmerhirt
<br><br> <br><br>
<b>Special thanks to all contributors of the former releases and bugreporters.</b><br> <b>Special thanks to all contributors of the former releases and bugreporters.</b><br>
- Ren&eacute; Mansveld, Steffen Reddig, Thomas Dubbert
<br><br> <br><br>
<b>Special thanks to all contributors of Contenido up to 4.8.15, which ConLite is based upon.</b><br> <b>Special thanks to all contributors of Contenido up to 4.8.15, which ConLite is based upon.</b><br>
Andreas Kummer, Andreas Lindner, Bilal Arslan, Bj&ouml;rn Behrens, Christa Tabara, Christian End, Conrad Leu, Dominik Ziegler, Frederic Schneider, Harald Wirths, Holger Librenz, Ingo van Peeren, Jonas Vogel, Kristina Birkenbeul, Marco Prey, Martin Horwath, Murat Pur&ccedil;, Oliver Lohkemper, Rudi Bieller, Timo Trautmann, Thorsten Granz, Thomas Sch&auml;fer-Tertilt, Tobias Klonk, Daniel Rothmaler, Guido, i-fekt, Helen Sch&auml;fer, Jan Lengowski, John van Aerle, Maria Martha Sanchez-Straub, Marco Jahn, Martin Hahn, Marion Fischer, Olaf Niemann, Robert Herbert, Stefan Jelner, Timo A. Hummel, Willi Man Andreas Kummer, Andreas Lindner, Bilal Arslan, Bj&ouml;rn Behrens, Christa Tabara, Christian End, Conrad Leu, Dominik Ziegler, Frederic Schneider, Harald Wirths, Holger Librenz, Ingo van Peeren, Jonas Vogel, Kristina Birkenbeul, Marco Prey, Martin Horwath, Murat Pur&ccedil;, Oliver Lohkemper, Rudi Bieller, Timo Trautmann, Thorsten Granz, Thomas Sch&auml;fer-Tertilt, Tobias Klonk, Daniel Rothmaler, Guido, i-fekt, Helen Sch&auml;fer, Jan Lengowski, John van Aerle, Maria Martha Sanchez-Straub, Marco Jahn, Martin Hahn, Marion Fischer, Olaf Niemann, Robert Herbert, Stefan Jelner, Timo A. Hummel, Willi Man

Datei anzeigen

@ -174,6 +174,7 @@ return array(
'cHTML5Button' => 'conlite/classes/cHTML5/class.chtml5.button.php', 'cHTML5Button' => 'conlite/classes/cHTML5/class.chtml5.button.php',
'cHTML5Meta' => 'conlite/classes/cHTML5/class.chtml5.meta.php', 'cHTML5Meta' => 'conlite/classes/cHTML5/class.chtml5.meta.php',
'cHTML' => 'conlite/classes/cHTML5/class.chtml.php', 'cHTML' => 'conlite/classes/cHTML5/class.chtml.php',
'cHTML5Common' => 'conlite/classes/cHTML5/class.chtml5.common.php',
'cHTML5List' => 'conlite/classes/cHTML5/class.chtml5.list.php', 'cHTML5List' => 'conlite/classes/cHTML5/class.chtml5.list.php',
'XML_doc' => 'conlite/classes/class.xml.php', 'XML_doc' => 'conlite/classes/class.xml.php',
'Contenido_FrontendNavigation_Breadcrumb' => 'conlite/classes/Contenido_FrontendNavigation/Contenido_FrontendNavigation_Breadcrumb.class.php', 'Contenido_FrontendNavigation_Breadcrumb' => 'conlite/classes/Contenido_FrontendNavigation/Contenido_FrontendNavigation_Breadcrumb.class.php',

Datei anzeigen

@ -139,27 +139,28 @@ $cfg['native_i18n'] = false;
*/ */
/* Don't display errors */ /* Don't display errors */
@ini_set("display_errors", false); ini_set("display_errors", false);
/* Log errors to a file */ /* Log errors to a file */
@ini_set("log_errors", true); ini_set("log_errors", true);
/* The file in which we write the error log */ /* The file in which we write the error log */
@ini_set("error_log", $cfg['path']['conlite_logs'] . "errorlog.txt"); ini_set("error_log", $cfg['path']['conlite_logs'] . "errorlog.txt");
/* Report all errors except warnings */ /**
if ($cfg["develop"]["show_errors"] && $_SERVER['SERVER_NAME'] == "local.dceserver.de") { * Report all errors except warnings
* @todo change first if to use a local config var for servername
*
**/
if ($cfg["develop"]["show_errors"]
&& filter_input(INPUT_SERVER, 'SERVER_NAME', FILTER_SANITIZE_STRING) == "local.dceserver.de") {
error_reporting(E_ALL); error_reporting(E_ALL);
} else { } else {
if ($cfg["develop"]["show_deprecated"]) { if ($cfg["develop"]["show_deprecated"]) {
error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL ^ E_NOTICE);
} else { } else {
if (version_compare(PHP_VERSION, '5.3.0', '<')) { // remove unknown deprecated for PHP < 5.3 if (version_compare(PHP_VERSION, '7.4.0', '>=')) {
error_reporting(E_ALL ^ E_NOTICE);
} else if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_USER_DEPRECATED ^ E_WARNING); error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_USER_DEPRECATED ^ E_WARNING);
} else if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_USER_DEPRECATED ^ E_STRICT);
} else { } else {
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_USER_DEPRECATED); error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_USER_DEPRECATED);
} }
@ -322,4 +323,3 @@ $cfg['password']['numbers_mandatory'] = 3;
*/ */
// Define here all content types which includes special module translations (dont forget the prefix "CMS_"!) // Define here all content types which includes special module translations (dont forget the prefix "CMS_"!)
$cfg['translatable_content_types'] = array('CMS_TEASER', 'CMS_FILELIST'); $cfg['translatable_content_types'] = array('CMS_TEASER', 'CMS_FILELIST');
?>

Datei anzeigen

@ -1,6 +1,6 @@
auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true
include.path=${php.global.include.path} include.path=${php.global.include.path}
php.version=PHP_73 php.version=PHP_81
source.encoding=UTF-8 source.encoding=UTF-8
src.dir=. src.dir=.
tags.asp=false tags.asp=false

Datei anzeigen

@ -513,6 +513,7 @@ abstract class HTML_Common2 implements ArrayAccess
* @return boolean Returns true on success or false on failure. * @return boolean Returns true on success or false on failure.
* @link http://php.net/manual/en/arrayaccess.offsetexists.php * @link http://php.net/manual/en/arrayaccess.offsetexists.php
*/ */
#[ReturnTypeWillChange]
public function offsetExists($offset) public function offsetExists($offset)
{ {
return isset($this->attributes[strtolower($offset)]); return isset($this->attributes[strtolower($offset)]);
@ -527,6 +528,7 @@ abstract class HTML_Common2 implements ArrayAccess
* @link http://php.net/manual/en/arrayaccess.offsetget.php * @link http://php.net/manual/en/arrayaccess.offsetget.php
* @see getAttribute() * @see getAttribute()
*/ */
#[ReturnTypeWillChange]
public function offsetGet($offset) public function offsetGet($offset)
{ {
return $this->getAttribute($offset); return $this->getAttribute($offset);
@ -542,6 +544,7 @@ abstract class HTML_Common2 implements ArrayAccess
* @link http://php.net/manual/en/arrayaccess.offsetset.php * @link http://php.net/manual/en/arrayaccess.offsetset.php
* @see setAttribute() * @see setAttribute()
*/ */
#[ReturnTypeWillChange]
public function offsetSet($offset, $value) public function offsetSet($offset, $value)
{ {
if (null !== $offset) { if (null !== $offset) {
@ -561,6 +564,7 @@ abstract class HTML_Common2 implements ArrayAccess
* @link http://php.net/manual/en/arrayaccess.offsetunset.php * @link http://php.net/manual/en/arrayaccess.offsetunset.php
* @see removeAttribute * @see removeAttribute
*/ */
#[ReturnTypeWillChange]
public function offsetUnset($offset) public function offsetUnset($offset)
{ {
$this->removeAttribute($offset); $this->removeAttribute($offset);

Datei anzeigen

@ -180,7 +180,7 @@ INSERT INTO !PREFIX!_files VALUES('402', '402', 'include.js_history.php', 'main'
INSERT INTO !PREFIX!_files VALUES('403', '403', 'include.html_tpl_history.php', 'main'); INSERT INTO !PREFIX!_files VALUES('403', '403', 'include.html_tpl_history.php', 'main');
INSERT INTO !PREFIX!_files VALUES('415', '415', 'include.system_configuration.php', 'main'); INSERT INTO !PREFIX!_files VALUES('415', '415', 'include.system_configuration.php', 'main');
INSERT INTO !PREFIX!_files VALUES('503', '52', 'include.subnav.php', 'main'); INSERT INTO !PREFIX!_files VALUES('503', '52', 'include.subnav.php', 'main');
INSERT INTO !PREFIX!_files VALUES('700', '52', 'include.subnav_blank.php', 'main'); INSERT INTO !PREFIX!_files VALUES('700', '52', 'include.subnav.php', 'main');
INSERT INTO !PREFIX!_files VALUES('813', '811', 'include.system_purge.php', 'main'); INSERT INTO !PREFIX!_files VALUES('813', '811', 'include.system_purge.php', 'main');
INSERT INTO !PREFIX!_files VALUES('814', '812', 'include.system_db_backup.php', 'main'); INSERT INTO !PREFIX!_files VALUES('814', '812', 'include.system_db_backup.php', 'main');
INSERT INTO !PREFIX!_files VALUES('990', '990', 'pluginmanager/includes/include.right_bottom.php', 'main'); INSERT INTO !PREFIX!_files VALUES('990', '990', 'pluginmanager/includes/include.right_bottom.php', 'main');

Datei anzeigen

@ -1,23 +1,23 @@
DELETE FROM !PREFIX!_type WHERE idtype < 10000; DELETE FROM !PREFIX!_type WHERE idtype < 10000;
INSERT INTO !PREFIX!_type VALUES('22', 'CMS_QRCODE', '/**\r\n * CMS_QRCODE\r\n */ \r\n$tmp = $a_content[''CMS_QRCODE''][$val];\r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''", "''", $tmp); \r\n$tmp = str_replace("\\$", ''\\\\\\$'', $tmp); \r\n\r\n$q = array("", "L", "M", "Q", "H");\r\n$quality = intval(getEffectiveSetting("qrcode", "quality"));\r\nif ($quality == 0) {\r\n setSystemProperty("qrcode", "quality", 1);\r\n setSystemProperty("qrcode", "blocksize", 3);\r\n setSystemProperty("qrcode", "border", 2);\r\n $quality = 1;\r\n}\r\n$quality = $q[$quality];\r\n$blocksize = intval(getEffectiveSetting("qrcode", "blocksize", 3));\r\n$border = intval(getEffectiveSetting("qrcode", "border", 2));\r\n\r\nif ($edit) {\r\n # In editor we always generate a new image because of possible changes\r\n $tmp2 = "\r\necho ''<strong>QR Code</strong><br />(online only)<br />'';\r\n@unlink(''" . $cfgClient[$client]["path"]["frontend"] . "cache/QR-Code-" . $idart . "-" . $val . ".png'');";\r\n \r\n # Edit anchor and image\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_QRCODE&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_QRCODE_'' . $val . ''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'', ''" . $editLink . "'');");\r\n # Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . "but_edittext.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n # Process for tmp2put with echo\r\n $finalEditButton = $editAnchor->render();\r\n \r\n $tmp2 .= "echo ''" . $finalEditButton . "'';";\r\n} else {\r\n # In frontend and preview we only generate a new image if it was deleted\r\n $tmp2 = "\r\nif (!is_file(''" . $cfgClient[$client][''path''][''frontend''] . "cache/QR-Code-" . $idart . "-" . $val . ".png'')) {\r\n define(''QR_CACHE_DIR'', ''" . $cfgClient[$client][''path''][''frontend''] . "cache/phpqrcode/'');\r\n if (!is_dir(QR_CACHE_DIR)) {\r\n mkdir(QR_CACHE_DIR);\r\n }";\r\n if (isStartArticle($idartlang, $idcat, $lang)) {\r\n $tmp2 .= "\r\n QRcode::png(''" . ((strlen($tmp)) ? $tmp : Contenido_Url::getInstance()->build(array(''idcat'' => $idcat, ''client'' => $client, ''lang'' => $lang), true)) . "'', ''" . $cfgClient[$client][''path''][''frontend''] . ''cache/QR-Code-'' . $idart . ''-'' . $val . ''.png'' . "'', ''" . $quality . "'', " . $blocksize . ", " . $border . ");";\r\n } else {\r\n $tmp2 .= "\r\n QRcode::png(''" . ((strlen($tmp)) ? $tmp : Contenido_Url::getInstance()->build(array(''idcat'' => $idcat, ''idart'' => $idart, ''client'' => $client, ''lang'' => $lang), true)) . "'', ''" . $cfgClient[$client][''path''][''frontend''] . ''cache/QR-Code-'' . $idart . ''-'' . $val . ''.png'' . "'', ''" . $quality . "'', " . $blocksize . ", " . $border . ");";\r\n }\r\n $tmp2 .= "\r\n}\r\necho ''<img src=\\"" . $cfgClient[$client]["path"]["htmlpath"] . "cache/QR-Code-" . $idart . "-" . $val . ".png\\" alt=\\"QR Code\\" /><br />'';";\r\n}\r\n$tmp = $tmp2;', 'QR Code', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); INSERT INTO !PREFIX!_type VALUES('22', 'CMS_QRCODE', '/**\r\n * CMS_QRCODE\r\n */ \r\n$tmp = $a_content[''CMS_QRCODE''][$val];\r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''", "''", $tmp); \r\n$tmp = str_replace("\\$", ''\\\\\\$'', $tmp); \r\n\r\n$q = array("", "L", "M", "Q", "H");\r\n$quality = intval(getEffectiveSetting("qrcode", "quality"));\r\nif ($quality == 0) {\r\n setSystemProperty("qrcode", "quality", 1);\r\n setSystemProperty("qrcode", "blocksize", 3);\r\n setSystemProperty("qrcode", "border", 2);\r\n $quality = 1;\r\n}\r\n$quality = $q[$quality];\r\n$blocksize = intval(getEffectiveSetting("qrcode", "blocksize", 3));\r\n$border = intval(getEffectiveSetting("qrcode", "border", 2));\r\n\r\nif (!empty($edit)) {\r\n # In editor we always generate a new image because of possible changes\r\n $tmp2 = "\r\necho ''<strong>QR Code</strong><br />(online only)<br />'';\r\n@unlink(''" . $cfgClient[$client]["path"]["frontend"] . "cache/QR-Code-" . $idart . "-" . $val . ".png'');";\r\n \r\n # Edit anchor and image\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_QRCODE&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_QRCODE_'' . $val . ''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'', ''" . $editLink . "'');");\r\n # Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . "but_edittext.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n # Process for tmp2put with echo\r\n $finalEditButton = $editAnchor->render();\r\n \r\n $tmp2 .= "echo ''" . $finalEditButton . "'';";\r\n} else {\r\n # In frontend and preview we only generate a new image if it was deleted\r\n $tmp2 = "\r\nif (!is_file(''" . $cfgClient[$client][''path''][''frontend''] . "cache/QR-Code-" . $idart . "-" . $val . ".png'')) {\r\n define(''QR_CACHE_DIR'', ''" . $cfgClient[$client][''path''][''frontend''] . "cache/phpqrcode/'');\r\n if (!is_dir(QR_CACHE_DIR)) {\r\n mkdir(QR_CACHE_DIR);\r\n }";\r\n if (isStartArticle($idartlang, $idcat, $lang)) {\r\n $tmp2 .= "\r\n QRcode::png(''" . ((strlen($tmp)) ? $tmp : Contenido_Url::getInstance()->build(array(''idcat'' => $idcat, ''client'' => $client, ''lang'' => $lang), true)) . "'', ''" . $cfgClient[$client][''path''][''frontend''] . ''cache/QR-Code-'' . $idart . ''-'' . $val . ''.png'' . "'', ''" . $quality . "'', " . $blocksize . ", " . $border . ");";\r\n } else {\r\n $tmp2 .= "\r\n QRcode::png(''" . ((strlen($tmp)) ? $tmp : Contenido_Url::getInstance()->build(array(''idcat'' => $idcat, ''idart'' => $idart, ''client'' => $client, ''lang'' => $lang), true)) . "'', ''" . $cfgClient[$client][''path''][''frontend''] . ''cache/QR-Code-'' . $idart . ''-'' . $val . ''.png'' . "'', ''" . $quality . "'', " . $blocksize . ", " . $border . ");";\r\n }\r\n $tmp2 .= "\r\n}\r\necho ''<img src=\\"" . $cfgClient[$client]["path"]["htmlpath"] . "cache/QR-Code-" . $idart . "-" . $val . ".png\\" alt=\\"QR Code\\" /><br />'';";\r\n}\r\n$tmp = $tmp2;', 'QR Code', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('18', 'CMS_EASYIMGEDIT', '/**\r\n * CMS_EASYIMGEDIT\r\n */\r\n$tmp = "";\r\nif ($edit) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_EASYIMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_EASYIMGEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', '', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('18', 'CMS_EASYIMGEDIT', '/**\r\n * CMS_EASYIMGEDIT\r\n */\r\n$tmp = "";\r\nif (!empty($edit)) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_EASYIMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_EASYIMGEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', '', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('19', 'CMS_DATE', '$tmp = $a_content["CMS_DATE"][$val];\r\n\r\n$oCmsDate = new Cms_Date($tmp, $val, $idartlang, $editLink, $cfg, $db, count($a_content["CMS_DATE"]), $belang);\r\n\r\nif($edit){\r\n\r\n$tmp = $oCmsDate->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsDate->getAllWidgetView();\r\n\r\n}', 'Date', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); INSERT INTO !PREFIX!_type VALUES('19', 'CMS_DATE', '$tmp = $a_content["CMS_DATE"][$val];\r\n\r\n$oCmsDate = new Cms_Date($tmp, $val, $idartlang, $editLink, $cfg, $db, count($a_content["CMS_DATE"]), $belang);\r\n\r\nif(!empty($edit)){\r\n\r\n$tmp = $oCmsDate->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsDate->getAllWidgetView();\r\n\r\n}', 'Date', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('20', 'CMS_TEASER', '$tmp = $a_content["CMS_TEASER"][$val];\r\n\r\n$oCmsTeaser = new Cms_Teaser($tmp, $val, $idartlang, $editLink, $cfg, $db, $belang, $client, $lang, $cfgClient, $sess);\r\n\r\nif($edit){\r\n\r\n$tmp = $oCmsTeaser->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsTeaser->getAllWidgetView();\r\n\r\n}', 'Teaser', '0', '', '2009-04-20 13:12:14', '0000-00-00 00:00:00'); INSERT INTO !PREFIX!_type VALUES('20', 'CMS_TEASER', '$tmp = $a_content["CMS_TEASER"][$val];\r\n\r\n$oCmsTeaser = new Cms_Teaser($tmp, $val, $idartlang, $editLink, $cfg, $db, $belang, $client, $lang, $cfgClient, $sess);\r\n\r\nif(!empty($edit)){\r\n\r\n$tmp = $oCmsTeaser->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsTeaser->getAllWidgetView();\r\n\r\n}', 'Teaser', '0', '', '2009-04-20 13:12:14', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('21', 'CMS_FILELIST', '$tmp = $a_content["CMS_FILELIST"][$val];\r\n\r\n$oCmsFileList = new Cms_FileList($tmp, $val, $idartlang, $editLink, $cfg, $db, $belang, $client, $lang, $cfgClient, $sess);\r\n\r\nif($edit){\r\n\r\n$tmp = $oCmsFileList->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsFileList->getAllWidgetView();\r\n\r\n}', '', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); INSERT INTO !PREFIX!_type VALUES('21', 'CMS_FILELIST', '$tmp = $a_content["CMS_FILELIST"][$val];\r\n\r\n$oCmsFileList = new Cms_FileList($tmp, $val, $idartlang, $editLink, $cfg, $db, $belang, $client, $lang, $cfgClient, $sess);\r\n\r\nif(!empty($edit)){\r\n\r\n$tmp = $oCmsFileList->getAllWidgetEdit();\r\n\r\n}else{\r\n\r\n$tmp = $oCmsFileList->getAllWidgetView();\r\n\r\n}', '', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('17', 'CMS_HTMLTEXT', '/**\r\n * CMS_HTMLTEXT\r\n */\r\ncInclude("includes", "functions.lang.php");\r\n\r\n$content = $a_content[''CMS_HTMLTEXT''][$val];\r\n$content = urldecode($content);\r\n$content = htmldecode($content);\r\n$content = strip_tags($content);\r\n\r\n$content = str_replace("&nbsp;", " ", $content);\r\n\r\n$content = htmlspecialchars($content);\r\nif ($content == "")\r\n{\r\n $content = "&nbsp;";\r\n}\r\n\r\n$content = nl2br($content);\r\n\r\nif ($edit) {\r\n\r\n $div = new cHTMLDiv;\r\n $div->setID("HTMLTEXT_".$db->f("idtype")."_".$val);\r\n $div->setEvent("focus", "this.style.border=''1px solid #bb5577''");\r\n $div->setEvent("blur", "this.style.border=''1px dashed #bfbfbf''");\r\n $div->setStyleDefinition("border", "1px dashed #bfbfbf");\r\n $div->updateAttributes(array("contentEditable" => "true"));\r\n $div->setStyleDefinition("direction", langGetTextDirection($lang));\r\n \r\n $editlink = new cHTMLLink;\r\n $editlink->setClass(''CMS_HTMLTEXT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editlink->setLink($sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLTEXT&typenr=$val&lang=$lang"));\r\n \r\n $editimg = new cHTMLImage;\r\n $editimg->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edittext.gif");\r\n \r\n $savelink = new cHTMLLink;\r\n $savelink->setClass(''CMS_HTMLTEXT_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $savelink->setLink("javascript:setcontent(''$idartlang'',''0'')");\r\n \r\n $saveimg = new cHTMLImage;\r\n $saveimg->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif");\r\n \r\n $savelink->setContent($saveimg);\r\n \r\n $editlink->setContent($editimg);\r\n \r\n $div->setContent($content);\r\n\r\n $tmp = implode("", array($div->render(), $editlink->render(), " ", $savelink->render()));\r\n $tmp = str_replace(''"'', ''\\"'', $tmp);\r\n} else {\r\n $tmp = $content;\r\n $tmp = str_replace(''"'', ''\\"'', $tmp);\r\n}\r\n\r\n\r\n$tmp = addslashes($tmp);\r\n$tmp = str_replace(''$'', ''\\\\\\$'', $tmp);', 'Text / Standard', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('17', 'CMS_HTMLTEXT', '/**\r\n * CMS_HTMLTEXT\r\n */\r\ncInclude("includes", "functions.lang.php");\r\n\r\n$content = $a_content[''CMS_HTMLTEXT''][$val];\r\n$content = urldecode($content);\r\n$content = htmldecode($content);\r\n$content = strip_tags($content);\r\n\r\n$content = str_replace("&nbsp;", " ", $content);\r\n\r\n$content = htmlspecialchars($content);\r\nif ($content == "")\r\n{\r\n $content = "&nbsp;";\r\n}\r\n\r\n$content = nl2br($content);\r\n\r\nif (!empty($edit)) {\r\n\r\n $div = new cHTMLDiv;\r\n $div->setID("HTMLTEXT_".$db->f("idtype")."_".$val);\r\n $div->setEvent("focus", "this.style.border=''1px solid #bb5577''");\r\n $div->setEvent("blur", "this.style.border=''1px dashed #bfbfbf''");\r\n $div->setStyleDefinition("border", "1px dashed #bfbfbf");\r\n $div->updateAttributes(array("contentEditable" => "true"));\r\n $div->setStyleDefinition("direction", langGetTextDirection($lang));\r\n \r\n $editlink = new cHTMLLink;\r\n $editlink->setClass(''CMS_HTMLTEXT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editlink->setLink($sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLTEXT&typenr=$val&lang=$lang"));\r\n \r\n $editimg = new cHTMLImage;\r\n $editimg->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edittext.gif");\r\n \r\n $savelink = new cHTMLLink;\r\n $savelink->setClass(''CMS_HTMLTEXT_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $savelink->setLink("javascript:setcontent(''$idartlang'',''0'')");\r\n \r\n $saveimg = new cHTMLImage;\r\n $saveimg->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif");\r\n \r\n $savelink->setContent($saveimg);\r\n \r\n $editlink->setContent($editimg);\r\n \r\n $div->setContent($content);\r\n\r\n $tmp = implode("", array($div->render(), $editlink->render(), " ", $savelink->render()));\r\n $tmp = str_replace(''"'', ''\\"'', $tmp);\r\n} else {\r\n $tmp = $content;\r\n $tmp = str_replace(''"'', ''\\"'', $tmp);\r\n}\r\n\r\n\r\n$tmp = addslashes($tmp);\r\n$tmp = str_replace(''$'', ''\\\\\\$'', $tmp);', 'Text / Standard', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('16', 'CMS_SIMPLELINKEDIT', '/**\r\n * CMS_LINKEDIT\r\n */\r\n$tmp = "";\r\nif ($edit) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_SIMPLELINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_SIMPLELINKEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', '', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('16', 'CMS_SIMPLELINKEDIT', '/**\r\n * CMS_LINKEDIT\r\n */\r\n$tmp = "";\r\nif (!empty($edit)) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_SIMPLELINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_SIMPLELINKEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', '', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('14', 'CMS_IMGEDIT', '/**\r\n * CMS_IMGEDIT\r\n */\r\n$tmp = '''';\r\n\r\nif ($edit) {\r\n \r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_IMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_IMGEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Edit button for an image', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:58:44'); INSERT INTO !PREFIX!_type VALUES('14', 'CMS_IMGEDIT', '/**\r\n * CMS_IMGEDIT\r\n */\r\n$tmp = '''';\r\n\r\nif (!empty($edit)) {\r\n \r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_IMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_IMGEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Edit button for an image', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:58:44');
INSERT INTO !PREFIX!_type VALUES('15', 'CMS_IMGTITLE', '/**\r\n * CMS_IMGTITLE\r\n */\r\n$tmp = $a_content["CMS_IMGDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = addslashes($tmp);', 'Title of an image', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); INSERT INTO !PREFIX!_type VALUES('15', 'CMS_IMGTITLE', '/**\r\n * CMS_IMGTITLE\r\n */\r\n$tmp = $a_content["CMS_IMGDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = addslashes($tmp);', 'Title of an image', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('13', 'CMS_RAWLINK', '/**\r\n* CMS_RAWLINK\r\n*/\r\nglobal $cfgClient;\r\nglobal $client;\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n $tmp = "front_content.php?idcatart=". $tmp."&client=".$client."&lang=".$lang;\r\n if ($edit) $tmp = $sess->url("$tmp");\r\n\r\n}', 'Raw Link without transformation', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); INSERT INTO !PREFIX!_type VALUES('13', 'CMS_RAWLINK', '/**\r\n* CMS_RAWLINK\r\n*/\r\nglobal $cfgClient;\r\nglobal $client;\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n $tmp = "front_content.php?idcatart=". $tmp."&client=".$client."&lang=".$lang;\r\n if (!empty($edit)) $tmp = $sess->url("$tmp");\r\n\r\n}', 'Raw Link without transformation', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('11', 'CMS_LINKTITLE', '/**\r\n * CMS_LINKTITLE\r\n */\r\n$tmp = $a_content["CMS_LINKDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = addslashes($tmp);\r\n\r\n', 'Title of a Link', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00'); INSERT INTO !PREFIX!_type VALUES('11', 'CMS_LINKTITLE', '/**\r\n * CMS_LINKTITLE\r\n */\r\n$tmp = $a_content["CMS_LINKDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = addslashes($tmp);\r\n\r\n', 'Title of a Link', '0', '', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
INSERT INTO !PREFIX!_type VALUES('12', 'CMS_LINKEDIT', '/**\r\n * CMS_LINKEDIT\r\n */\r\n$tmp = "";\r\n\r\nif ($edit) {\r\n \r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_LINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_LINKEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $finalEditButton;\r\n \r\n}', 'Link edit button', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('12', 'CMS_LINKEDIT', '/**\r\n * CMS_LINKEDIT\r\n */\r\n$tmp = "";\r\n\r\nif (!empty($edit)) {\r\n \r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_LINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_LINKEDIT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $finalEditButton;\r\n \r\n}', 'Link edit button', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('9', 'CMS_HEAD', '/**\r\n * CMS_HEAD\r\n */\r\n$tmp = $a_content["CMS_HEAD"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\nif ($edit) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HEAD&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_HEAD_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithead.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Headline / Standard', '0', '', '2002-05-13 19:02:34', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('9', 'CMS_HEAD', '/**\r\n * CMS_HEAD\r\n */\r\n$tmp = $a_content["CMS_HEAD"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\nif (!empty($edit)) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HEAD&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_HEAD_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithead.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Headline / Standard', '0', '', '2002-05-13 19:02:34', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('10', 'CMS_SWF', '/**\r\n * CMS_SWF\r\n */\r\n\r\nif ( !is_object($db2) ) $db2 = new DB_Contenido;\r\n\r\n$tmp_id = $a_content[''CMS_SWF''][$val];\r\n\r\n$sql = "SELECT * FROM ".$cfg["tab"]["upl"]." WHERE idclient=''".$client."'' AND idupl=''".$tmp_id."'' AND filetype = ''swf''";\r\n\r\n$db2->query($sql);\r\n\r\nif ( $db2->next_record() ) {\r\n\r\n $tmp_swf = $cfgClient[$client]["upload"] . $db2->f("dirname") . $db2->f("filename");\r\n \r\n $aImgSize = @getimagesize($tmp_swf);\r\n\r\n $width = $aImgSize[0];\r\n $height = $aImgSize[1];\r\n\r\n $tmp = ''<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\r\n codebase="http://download.macromedia.com\r\n /pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"\r\n width="''.$width.''" height="''.$height.''" id="movie" align="">\r\n <param name="movie" value="''.$tmp_swf.''">\r\n <embed src="''.$tmp_swf.''" quality="high" width="''.$width.''"\r\n height="''.$height.''" name="movie" align="" type="application/x-shockwave-flash"\r\n plug inspage="http://www.macromedia.com/go/getflashplayer">\r\n </object>'';\r\n} else {\r\n $tmp = '''';\r\n}\r\n\r\n\r\nif( $edit ) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_SWF&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_SWF_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editswf.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n \r\n $tmp = ''<table cellspacing="0" cellpadding="0" border="0"><tr><td>''.$tmp.''</td></tr><tr><td>''.$finalEditButton.''</td></tr></table>'';\r\n}\r\n\r\n$tmp = addslashes( addslashes($tmp) ); \r\n$tmp = str_replace( "\\\\\\''", "''", $tmp ); ', 'Flash Movie', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('10', 'CMS_SWF', '/**\r\n * CMS_SWF\r\n */\r\n\r\nif ( !is_object($db2) ) $db2 = new DB_Contenido;\r\n\r\n$tmp_id = $a_content[''CMS_SWF''][$val];\r\n\r\n$sql = "SELECT * FROM ".$cfg["tab"]["upl"]." WHERE idclient=''".$client."'' AND idupl=''".$tmp_id."'' AND filetype = ''swf''";\r\n\r\n$db2->query($sql);\r\n\r\nif ( $db2->next_record() ) {\r\n\r\n $tmp_swf = $cfgClient[$client]["upload"] . $db2->f("dirname") . $db2->f("filename");\r\n \r\n $aImgSize = @getimagesize($tmp_swf);\r\n\r\n $width = $aImgSize[0];\r\n $height = $aImgSize[1];\r\n\r\n $tmp = ''<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\r\n codebase="http://download.macromedia.com\r\n /pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"\r\n width="''.$width.''" height="''.$height.''" id="movie" align="">\r\n <param name="movie" value="''.$tmp_swf.''">\r\n <embed src="''.$tmp_swf.''" quality="high" width="''.$width.''"\r\n height="''.$height.''" name="movie" align="" type="application/x-shockwave-flash"\r\n plug inspage="http://www.macromedia.com/go/getflashplayer">\r\n </object>'';\r\n} else {\r\n $tmp = '''';\r\n}\r\n\r\n\r\nif( !empty($edit) ) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_SWF&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_SWF_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editswf.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n \r\n $tmp = ''<table cellspacing="0" cellpadding="0" border="0"><tr><td>''.$tmp.''</td></tr><tr><td>''.$finalEditButton.''</td></tr></table>'';\r\n}\r\n\r\n$tmp = addslashes( addslashes($tmp) ); \r\n$tmp = str_replace( "\\\\\\''", "''", $tmp ); ', 'Flash Movie', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('7', 'CMS_LINKTARGET', '/**\r\n * CMS_LINKTARGET\r\n */\r\n$tmp = $a_content["CMS_LINKTARGET"][$val];\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = urldecode($tmp);', 'Frame', '0', '', '2002-05-13 19:04:43', '2002-05-13 19:04:43'); INSERT INTO !PREFIX!_type VALUES('7', 'CMS_LINKTARGET', '/**\r\n * CMS_LINKTARGET\r\n */\r\n$tmp = $a_content["CMS_LINKTARGET"][$val];\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = urldecode($tmp);', 'Frame', '0', '', '2002-05-13 19:04:43', '2002-05-13 19:04:43');
INSERT INTO !PREFIX!_type VALUES('8', 'CMS_LINKDESCR', '/**\r\n * CMS_LINKDESCR\r\n */\r\n$tmp = $a_content["CMS_LINKDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\nif ($edit) {\r\n\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_LINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_LINKDESCR_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Description', '0', '', '2002-05-13 19:05:00', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('8', 'CMS_LINKDESCR', '/**\r\n * CMS_LINKDESCR\r\n */\r\n$tmp = $a_content["CMS_LINKDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\nif (!empty($edit)) {\r\n\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_LINK&typenr=$val");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_LINKDESCR_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editlink.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Description', '0', '', '2002-05-13 19:05:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('6', 'CMS_LINK', '/**\r\n* CMS_LINK\r\n*/\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n $tmp = "front_content.php?idcatart=". $tmp."&client=".$client."&lang=".$lang;\r\n if ($edit) $tmp = $sess->url("$tmp");\r\n\r\n} else {\r\n\r\n if (!preg_match(''/^(http|https|ftp|telnet|gopher):\\/\\/((?:[a-zA-Z0-9_-]+\\.?)+):?(\\d*)/'', $tmp)) {\r\n // it''s a relative link, or an absolute link with unsupported protocol\r\n if (substr($tmp,0,4) == "www." || $tmp == "") { // only check if it could be a domainname\r\n $tmp = "http://".$tmp;\r\n }\r\n }\r\n\r\n}', 'Link', '0', '', '2002-05-13 19:04:36', '2002-05-13 19:04:36'); INSERT INTO !PREFIX!_type VALUES('6', 'CMS_LINK', '/**\r\n* CMS_LINK\r\n*/\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n $tmp = "front_content.php?idcatart=". $tmp."&client=".$client."&lang=".$lang;\r\n if (!empty($edit)) $tmp = $sess->url("$tmp");\r\n\r\n} else {\r\n\r\n if (!preg_match(''/^(http|https|ftp|telnet|gopher):\\/\\/((?:[a-zA-Z0-9_-]+\\.?)+):?(\\d*)/'', $tmp)) {\r\n // it''s a relative link, or an absolute link with unsupported protocol\r\n if (substr($tmp,0,4) == "www." || $tmp == "") { // only check if it could be a domainname\r\n $tmp = "http://".$tmp;\r\n }\r\n }\r\n\r\n}', 'Link', '0', '', '2002-05-13 19:04:36', '2002-05-13 19:04:36');
INSERT INTO !PREFIX!_type VALUES('4', 'CMS_IMG', '/**\r\n * CMS_IMG\r\n */\r\n \r\n$tmp = $a_content["CMS_IMG"][$val];\r\n$tmp = urldecode($tmp);\r\nif($tmp==""||$tmp=="0"){\r\n$tmp="";\r\n\r\n}else{\r\n\r\nif (is_numeric($tmp))\r\n{\r\n$sql = "SELECT * FROM ".$cfg["tab"]["upl"]." WHERE idclient=''".$client."'' AND idupl=''".$tmp."''";\r\n\r\n$db2 = new DB_Contenido;\r\n$db2->query($sql);\r\n\r\nif ( $db2->next_record() ) {\r\n\r\n $tmp = $cfgClient[$client]["path"]["htmlpath"].$cfgClient[$client]["upload"].$db2->f("dirname").$db2->f("filename");\r\n }\r\n}\r\n\r\n $tmp = htmlspecialchars($tmp);\r\n$tmp = urldecode($tmp);\r\n $tmp = str_replace("''", "\\''", $tmp);\r\n}', 'Image', '0', '', '2002-05-13 19:04:21', '2002-05-13 19:04:21'); INSERT INTO !PREFIX!_type VALUES('4', 'CMS_IMG', '/**\r\n * CMS_IMG\r\n */\r\n \r\n$tmp = $a_content["CMS_IMG"][$val];\r\n$tmp = urldecode($tmp);\r\nif($tmp==""||$tmp=="0"){\r\n$tmp="";\r\n\r\n}else{\r\n\r\nif (is_numeric($tmp))\r\n{\r\n$sql = "SELECT * FROM ".$cfg["tab"]["upl"]." WHERE idclient=''".$client."'' AND idupl=''".$tmp."''";\r\n\r\n$db2 = new DB_Contenido;\r\n$db2->query($sql);\r\n\r\nif ( $db2->next_record() ) {\r\n\r\n $tmp = $cfgClient[$client]["path"]["htmlpath"].$cfgClient[$client]["upload"].$db2->f("dirname").$db2->f("filename");\r\n }\r\n}\r\n\r\n $tmp = htmlspecialchars($tmp);\r\n$tmp = urldecode($tmp);\r\n $tmp = str_replace("''", "\\''", $tmp);\r\n}', 'Image', '0', '', '2002-05-13 19:04:21', '2002-05-13 19:04:21');
INSERT INTO !PREFIX!_type VALUES('5', 'CMS_IMGDESCR', '/**\r\n * CMS_IMGDESCR\r\n */\r\n$tmp = $a_content["CMS_IMGDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlentities($tmp,ENT_QUOTES);\r\n\r\n\r\nif ($edit) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_IMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_IMGDESCR_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Description', '0', '', '2002-05-13 19:04:28', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('5', 'CMS_IMGDESCR', '/**\r\n * CMS_IMGDESCR\r\n */\r\n$tmp = $a_content["CMS_IMGDESCR"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlentities($tmp,ENT_QUOTES);\r\n\r\n\r\nif (!empty($edit)) {\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_IMG&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_IMGDESCR_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editimage.gif");\r\n $editButton->setBorder(0);\r\n \r\n $editAnchor->setContent($editButton);\r\n\r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Description', '0', '', '2002-05-13 19:04:28', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('3', 'CMS_TEXT', '/**\r\n * CMS_TEXT\r\n */\r\ncInclude("includes", "functions.lang.php");\r\n\r\n$tmp = $a_content["CMS_TEXT"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = nl2br($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp);\r\n\r\n$tmp = str_replace("<br />","<br>", $tmp);\r\nif ($edit) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_TEXT&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_TEXT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edittext.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Text / Standard', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('3', 'CMS_TEXT', '/**\r\n * CMS_TEXT\r\n */\r\ncInclude("includes", "functions.lang.php");\r\n\r\n$tmp = $a_content["CMS_TEXT"][$val];\r\n$tmp = urldecode($tmp);\r\n$tmp = htmlspecialchars($tmp);\r\n$tmp = nl2br($tmp);\r\n$tmp = str_replace("''", "\\''", $tmp);\r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp);\r\n\r\n$tmp = str_replace("<br />","<br>", $tmp);\r\nif (!empty($edit)) {\r\n\r\n /* Edit anchor and image */\r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_TEXT&typenr=$val&lang=$lang");\r\n $editAnchor = new cHTMLLink;\r\n $editAnchor->setClass(''CMS_TEXT_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''".$editLink."'');");\r\n //Save all content\r\n \r\n $editButton = new cHTMLImage;\r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edittext.gif");\r\n $editButton->setBorder(0);\r\n $editButton->setStyleDefinition("margin-right", "2px");\r\n \r\n $editAnchor->setContent($editButton);\r\n \r\n /* Process for output with echo */\r\n $finalEditButton = $editAnchor->render();\r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton));\r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton);\r\n\r\n $tmp = $tmp.$finalEditButton;\r\n}', 'Text / Standard', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('1', 'CMS_HTMLHEAD', '/**\r\n * CMS_HTMLHEAD\r\n */ \r\n$tmp = $a_content[''CMS_HTMLHEAD''][$val];\r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''","''",$tmp); \r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\ncInclude("includes", "functions.lang.php"); \r\n\r\nif ($edit) {\r\n if ($tmp == "") { \r\n $tmp = "&nbsp;"; \r\n } \r\n $insiteEditingDIV = new cHTMLDiv; \r\n $insiteEditingDIV->setId("HTMLHEAD_".$db->f("idtype")."_".$val);\r\n $insiteEditingDIV->setEvent("Focus", "this.style.border=''1px solid #bb5577'';"); \r\n $insiteEditingDIV->setEvent("Blur", "this.style.border=''1px dashed #bfbfbf'';"); \r\n $insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf"); \r\n $insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang)); \r\n \r\n $insiteEditingDIV->updateAttributes(array("contentEditable" => "true")); \r\n \r\n $insiteEditingDIV->setContent("_REPLACEMENT_"); \r\n \r\n\r\n /* Edit anchor and image */ \r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLHEAD&typenr=$val");\r\n $editAnchor = new cHTMLLink; \r\n $editAnchor->setClass(''CMS_HTMLHEAD_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''" . $editLink . "'');"); \r\n \r\n $editButton = new cHTMLImage; \r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithead.gif");\r\n $editButton->setBorder(0); \r\n $editButton->setStyleDefinition("margin-right", "2px"); \r\n \r\n $editAnchor->setContent($editButton); \r\n \r\n \r\n /* Save anchor and image */ \r\n $saveAnchor = new cHTMLLink; \r\n $saveAnchor->setClass(''CMS_HTMLHEAD_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $saveAnchor->setLink("javascript:setcontent(''$idartlang'',''0'')"); \r\n \r\n $saveButton = new cHTMLImage; \r\n $saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif"); \r\n $saveButton->setBorder(0); \r\n \r\n $saveAnchor->setContent($saveButton); \r\n\r\n /* Process for output with echo */ \r\n $finalEditButton = $editAnchor->render(); \r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton)); \r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton); \r\n \r\n $finalEditingDiv = $insiteEditingDIV->render(); \r\n $finalEditingDiv = AddSlashes(AddSlashes($finalEditingDiv)); \r\n $finalEditingDiv = str_replace("\\\\\\''","''",$finalEditingDiv); \r\n \r\n $finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv); \r\n \r\n $finalSaveButton = $saveAnchor->render(); \r\n $finalSaveButton = AddSlashes(AddSlashes($finalSaveButton)); \r\n $finalSaveButton = str_replace("\\\\\\''","''",$finalSaveButton); \r\n \r\n $tmp = $finalEditingDiv . $finalEditButton . $finalSaveButton;\r\n}', 'Headline / HTML', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('1', 'CMS_HTMLHEAD', '/**\r\n * CMS_HTMLHEAD\r\n */ \r\n$tmp = $a_content[''CMS_HTMLHEAD''][$val];\r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''","''",$tmp); \r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\ncInclude("includes", "functions.lang.php"); \r\n\r\nif (!empty($edit)) {\r\n if ($tmp == "") { \r\n $tmp = "&nbsp;"; \r\n } \r\n $insiteEditingDIV = new cHTMLDiv; \r\n $insiteEditingDIV->setId("HTMLHEAD_".$db->f("idtype")."_".$val);\r\n $insiteEditingDIV->setEvent("Focus", "this.style.border=''1px solid #bb5577'';"); \r\n $insiteEditingDIV->setEvent("Blur", "this.style.border=''1px dashed #bfbfbf'';"); \r\n $insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf"); \r\n $insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang)); \r\n \r\n $insiteEditingDIV->updateAttributes(array("contentEditable" => "true")); \r\n \r\n $insiteEditingDIV->setContent("_REPLACEMENT_"); \r\n \r\n\r\n /* Edit anchor and image */ \r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTMLHEAD&typenr=$val");\r\n $editAnchor = new cHTMLLink; \r\n $editAnchor->setClass(''CMS_HTMLHEAD_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''" . $editLink . "'');"); \r\n \r\n $editButton = new cHTMLImage; \r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithead.gif");\r\n $editButton->setBorder(0); \r\n $editButton->setStyleDefinition("margin-right", "2px"); \r\n \r\n $editAnchor->setContent($editButton); \r\n \r\n \r\n /* Save anchor and image */ \r\n $saveAnchor = new cHTMLLink; \r\n $saveAnchor->setClass(''CMS_HTMLHEAD_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $saveAnchor->setLink("javascript:setcontent(''$idartlang'',''0'')"); \r\n \r\n $saveButton = new cHTMLImage; \r\n $saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif"); \r\n $saveButton->setBorder(0); \r\n \r\n $saveAnchor->setContent($saveButton); \r\n\r\n /* Process for output with echo */ \r\n $finalEditButton = $editAnchor->render(); \r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton)); \r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton); \r\n \r\n $finalEditingDiv = $insiteEditingDIV->render(); \r\n $finalEditingDiv = AddSlashes(AddSlashes($finalEditingDiv)); \r\n $finalEditingDiv = str_replace("\\\\\\''","''",$finalEditingDiv); \r\n \r\n $finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv); \r\n \r\n $finalSaveButton = $saveAnchor->render(); \r\n $finalSaveButton = AddSlashes(AddSlashes($finalSaveButton)); \r\n $finalSaveButton = str_replace("\\\\\\''","''",$finalSaveButton); \r\n \r\n $tmp = $finalEditingDiv . $finalEditButton . $finalSaveButton;\r\n}', 'Headline / HTML', '0', '', '0000-00-00 00:00:00', '2009-04-14 13:56:58');
INSERT INTO !PREFIX!_type VALUES('2', 'CMS_HTML', '/** \r\n * CMS_HTML \r\n */ \r\n$tmp = $a_content[''CMS_HTML''][$val]; \r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''","''",$tmp); \r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\ncInclude("includes", "functions.lang.php"); \r\n\r\nif ($edit) { \r\n if ($tmp == "") { \r\n $tmp = "&nbsp;"; \r\n } \r\n $insiteEditingDIV = new cHTMLDiv; \r\n $insiteEditingDIV->setId("HTML_".$db->f("idtype")."_".$val); \r\n $insiteEditingDIV->setEvent("Focus", "this.style.border=''1px solid #bb5577'';"); \r\n $insiteEditingDIV->setEvent("Blur", "this.style.border=''1px dashed #bfbfbf'';"); \r\n $insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf"); \r\n $insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang)); \r\n \r\n $insiteEditingDIV->updateAttributes(array("contentEditable" => "true")); \r\n \r\n $insiteEditingDIV->setContent("_REPLACEMENT_"); \r\n \r\n\r\n /* Edit anchor and image */ \r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTML&typenr=$val"); \r\n $editAnchor = new cHTMLLink; \r\n $editAnchor->setClass(''CMS_HTML_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''" . $editLink . "'');"); \r\n \r\n $editButton = new cHTMLImage; \r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithtml.gif"); \r\n $editButton->setBorder(0); \r\n $editButton->setStyleDefinition("margin-right", "2px"); \r\n \r\n $editAnchor->setContent($editButton); \r\n \r\n \r\n /* Save anchor and image */ \r\n $saveAnchor = new cHTMLLink; \r\n $saveAnchor->setClass(''CMS_HTML_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $saveAnchor->setLink("javascript:setcontent(''$idartlang'',''0'')"); \r\n \r\n $saveButton = new cHTMLImage; \r\n $saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif"); \r\n $saveButton->setBorder(0); \r\n \r\n $saveAnchor->setContent($saveButton); \r\n\r\n /* Process for output with echo */ \r\n $finalEditButton = $editAnchor->render(); \r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton)); \r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton); \r\n \r\n $finalEditingDiv = $insiteEditingDIV->render(); \r\n $finalEditingDiv = AddSlashes(AddSlashes($finalEditingDiv)); \r\n $finalEditingDiv = str_replace("\\\\\\''","''",$finalEditingDiv); \r\n \r\n $finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv); \r\n \r\n $finalSaveButton = $saveAnchor->render(); \r\n $finalSaveButton = AddSlashes(AddSlashes($finalSaveButton)); \r\n $finalSaveButton = str_replace("\\\\\\''","''",$finalSaveButton); \r\n \r\n $tmp = $finalEditingDiv . $finalEditButton . $finalSaveButton;\r\n}', 'Text / HTML', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58'); INSERT INTO !PREFIX!_type VALUES('2', 'CMS_HTML', '/** \r\n * CMS_HTML \r\n */ \r\n$tmp = $a_content[''CMS_HTML''][$val]; \r\n$tmp = urldecode($tmp); \r\n\r\n$tmp = AddSlashes(AddSlashes($tmp)); \r\n$tmp = str_replace("\\\\\\''","''",$tmp); \r\n$tmp = str_replace("\\$",''\\\\\\$'',$tmp); \r\n\r\ncInclude("includes", "functions.lang.php"); \r\n\r\nif (!empty($edit)) { \r\n if ($tmp == "") { \r\n $tmp = "&nbsp;"; \r\n } \r\n $insiteEditingDIV = new cHTMLDiv; \r\n $insiteEditingDIV->setId("HTML_".$db->f("idtype")."_".$val); \r\n $insiteEditingDIV->setEvent("Focus", "this.style.border=''1px solid #bb5577'';"); \r\n $insiteEditingDIV->setEvent("Blur", "this.style.border=''1px dashed #bfbfbf'';"); \r\n $insiteEditingDIV->setStyleDefinition("border", "1px dashed #bfbfbf"); \r\n $insiteEditingDIV->setStyleDefinition("direction", langGetTextDirection($lang)); \r\n \r\n $insiteEditingDIV->updateAttributes(array("contentEditable" => "true")); \r\n \r\n $insiteEditingDIV->setContent("_REPLACEMENT_"); \r\n \r\n\r\n /* Edit anchor and image */ \r\n $editLink = $sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_HTML&typenr=$val"); \r\n $editAnchor = new cHTMLLink; \r\n $editAnchor->setClass(''CMS_HTML_''.$val.''_EDIT CMS_LINK_EDIT'');\r\n $editAnchor->setLink("javascript:setcontent(''$idartlang'',''" . $editLink . "'');"); \r\n \r\n $editButton = new cHTMLImage; \r\n $editButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_edithtml.gif"); \r\n $editButton->setBorder(0); \r\n $editButton->setStyleDefinition("margin-right", "2px"); \r\n \r\n $editAnchor->setContent($editButton); \r\n \r\n \r\n /* Save anchor and image */ \r\n $saveAnchor = new cHTMLLink; \r\n $saveAnchor->setClass(''CMS_HTML_''.$val.''_SAVE CMS_LINK_SAVE'');\r\n $saveAnchor->setLink("javascript:setcontent(''$idartlang'',''0'')"); \r\n \r\n $saveButton = new cHTMLImage; \r\n $saveButton->setSrc($cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif"); \r\n $saveButton->setBorder(0); \r\n \r\n $saveAnchor->setContent($saveButton); \r\n\r\n /* Process for output with echo */ \r\n $finalEditButton = $editAnchor->render(); \r\n $finalEditButton = AddSlashes(AddSlashes($finalEditButton)); \r\n $finalEditButton = str_replace("\\\\\\''","''",$finalEditButton); \r\n \r\n $finalEditingDiv = $insiteEditingDIV->render(); \r\n $finalEditingDiv = AddSlashes(AddSlashes($finalEditingDiv)); \r\n $finalEditingDiv = str_replace("\\\\\\''","''",$finalEditingDiv); \r\n \r\n $finalEditingDiv = str_replace("_REPLACEMENT_", $tmp, $finalEditingDiv); \r\n \r\n $finalSaveButton = $saveAnchor->render(); \r\n $finalSaveButton = AddSlashes(AddSlashes($finalSaveButton)); \r\n $finalSaveButton = str_replace("\\\\\\''","''",$finalSaveButton); \r\n \r\n $tmp = $finalEditingDiv . $finalEditButton . $finalSaveButton;\r\n}', 'Text / HTML', '0', '', '2002-05-13 19:04:13', '2009-04-14 13:56:58');

Datei anzeigen

@ -37,6 +37,6 @@ define('C_SETUP_STEPFILE', 'images/steps/s%d.png');
define('C_SETUP_STEPFILE_ACTIVE', 'images/steps/s%da.png'); define('C_SETUP_STEPFILE_ACTIVE', 'images/steps/s%da.png');
define('C_SETUP_STEPWIDTH', 28); define('C_SETUP_STEPWIDTH', 28);
define('C_SETUP_STEPHEIGHT', 28); define('C_SETUP_STEPHEIGHT', 28);
define('C_SETUP_MIN_PHP_VERSION', '7.2.0'); define('C_SETUP_MIN_PHP_VERSION', '7.4.0');
define('C_SETUP_MAX_PHP_VERSION', '8.0.3'); define('C_SETUP_MAX_PHP_VERSION', '8.2.0');
define('C_SETUP_VERSION', '2.1.3'); define('C_SETUP_VERSION', '2.2.0 beta');

Datei anzeigen

@ -33,9 +33,10 @@ ini_set("error_log", "../data/logs/setup_errorlog.txt");
header('Content-Type: text/html; charset=UTF-8'); header('Content-Type: text/html; charset=UTF-8');
// Check php version // Check php version
if (version_compare(PHP_VERSION, C_SETUP_MIN_PHP_VERSION, '<') if (version_compare(PHP_VERSION, C_SETUP_MIN_PHP_VERSION, '<')) {
|| version_compare(PHP_VERSION, C_SETUP_MAX_PHP_VERSION, '>')) {
die("You need PHP >= " . C_SETUP_MIN_PHP_VERSION . " to install ConLite " . C_SETUP_VERSION . ". Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n"); die("You need PHP >= " . C_SETUP_MIN_PHP_VERSION . " to install ConLite " . C_SETUP_VERSION . ". Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
} else if (version_compare(PHP_VERSION, C_SETUP_MAX_PHP_VERSION, '>=')) {
die("You need PHP < " . C_SETUP_MAX_PHP_VERSION . " to install ConLite " . C_SETUP_VERSION . ". Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
} }

Datei anzeigen

@ -31,6 +31,8 @@ if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
//print_r($_SESSION);
class cSetupSetupSummary extends cSetupMask { class cSetupSetupSummary extends cSetupMask {
public function __construct($step, $previous, $next) { public function __construct($step, $previous, $next) {