Merge latest PHP8 changes to develop #31
10 geänderte Dateien mit 857 neuen und 1021 gelöschten Zeilen
4
cms/cache/.gitignore
gevendort
4
cms/cache/.gitignore
gevendort
|
@ -1,4 +0,0 @@
|
||||||
# Ignore everything in this directory
|
|
||||||
*
|
|
||||||
# Except this file
|
|
||||||
!.gitignore
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Simple Responsive Template v 1.2
|
Simple Responsive Template v 1.2 test
|
||||||
|
|
||||||
|
|
||||||
primary styles
|
primary styles
|
||||||
|
|
|
@ -102,21 +102,12 @@ if (!empty($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");
|
||||||
|
@ -654,7 +645,7 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p
|
||||||
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) {
|
||||||
|
@ -855,4 +846,3 @@ if (isset($savedlang)) {
|
||||||
|
|
||||||
$db->disconnect();
|
$db->disconnect();
|
||||||
page_close();
|
page_close();
|
||||||
?>
|
|
|
@ -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:
|
||||||
|
|
439
conlite/external/backendedit/front_content.php
gevendort
439
conlite/external/backendedit/front_content.php
gevendort
|
@ -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,21 +410,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 */
|
||||||
|
@ -485,8 +432,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;
|
||||||
|
@ -496,8 +442,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 +453,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 +466,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 +478,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 +492,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 +510,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 +549,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 +563,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 +596,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 +617,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 +647,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 +661,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 +676,7 @@ else
|
||||||
$allow = true;
|
$allow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$allow)
|
if (!$allow) {
|
||||||
{
|
|
||||||
header($errsite);
|
header($errsite);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -781,47 +686,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 +715,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 +736,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 +756,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 +773,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 +797,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 +835,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();
|
||||||
?>
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>";
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
?>
|
|
|
@ -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>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ if (!$layout->virgin) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$types = array_unique($types);
|
$types = array_unique($types);
|
||||||
if (version_compare(PHP_VERSION, '8.0.0', '>=')) {
|
if (version_compare(PHP_VERSION, '7.4.0', '>=')) {
|
||||||
$layout->setProperty("layout", "used-types", implode(";", $types));
|
$layout->setProperty("layout", "used-types", implode(";", $types));
|
||||||
} else {
|
} else {
|
||||||
$layout->setProperty("layout", "used-types", implode($types, ";"));
|
$layout->setProperty("layout", "used-types", implode($types, ";"));
|
||||||
|
|
Laden …
In neuem Issue referenzieren