Dieser Commit ist enthalten in:
Oldperl 2019-08-19 03:13:29 +00:00
Ursprung 7e98507e86
Commit 2e57859f6e
6 geänderte Dateien mit 199 neuen und 212 gelöschten Zeilen

Datei anzeigen

@ -160,7 +160,7 @@ class cApiModule extends Item {
} catch (Exception $ex) { } catch (Exception $ex) {
$oWriter = cLogWriter::factory("File", array('destination' => 'contenido.log')); $oWriter = cLogWriter::factory("File", array('destination' => 'contenido.log'));
$oLog = new cLog($oWriter); $oLog = new cLog($oWriter);
$log->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), cLog::WARN); $oLog->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), cLog::WARN);
} }
} }
if ($this->_aModFileEditConf['use'] == TRUE && is_writable($this->_aModFileEditConf['modPath'])) { if ($this->_aModFileEditConf['use'] == TRUE && is_writable($this->_aModFileEditConf['modPath'])) {

Datei anzeigen

@ -246,20 +246,23 @@ function dbUpgradeTable($db, $table, $field, $type, $null, $key, $default, $extr
$structure = dbGetColumns($db, $table); $structure = dbGetColumns($db, $table);
// Third check: Compare field properties // Third check: Compare field properties
if (($structure[$field]['Type'] != $type) || if (($structure[$field]['Type'] != $type) || ($structure[$field]['Null'] != $null) || ($structure[$field]['Key'] != $key) || ($structure[$field]['Default'] != $default) || ($structure[$field]['Extra'] != $extra)) {
($structure[$field]['Null'] != $null) ||
($structure[$field]['Key'] != $key) ||
($structure[$field]['Default'] != $default) ||
($structure[$field]['Extra'] != $extra)) {
if ($structure[$field]['Key'] == "PRI") { if ($structure[$field]['Key'] == "PRI") {
$alterField = " ALTER TABLE " . Contenido_Security::escapeDB($table, $db) . " ADD PRIMARY KEY ('" . Contenido_Security::escapeDB($field, $db) . "') "; $alterField = " ALTER TABLE " . Contenido_Security::escapeDB($table, $db) . " ADD PRIMARY KEY ('" . Contenido_Security::escapeDB($field, $db) . "') ";
} else { } else {
if($type == "datetime" || $type == "date") {
$db->query("SET SESSION sql_mode='ALLOW_INVALID_DATES'");
}
$alterField = " ALTER TABLE " . Contenido_Security::escapeDB($table, $db) . " CHANGE COLUMN $field $field $type " . $parameter['NULL'] . " " . $parameter['DEFAULT'] . " " . $parameter['KEY']; $alterField = " ALTER TABLE " . Contenido_Security::escapeDB($table, $db) . " CHANGE COLUMN $field $field $type " . $parameter['NULL'] . " " . $parameter['DEFAULT'] . " " . $parameter['KEY'];
} }
$db->query($alterField); $db->query($alterField);
if ($bDebug) {
$sDebugData = sprintf("%s:ErrorNo. %s:%s\n", $alterField, $db->getErrorNumber(), $db->getErrorMessage());
file_put_contents('../data/logs/setup_queries.txt', $sDebugData, FILE_APPEND);
echo 'updateField:' . $alterField . '<br />';
}
$columnCache[$table] = ""; $columnCache[$table] = "";
} }

Datei anzeigen

@ -459,18 +459,12 @@ function langDuplicateFromFirstLanguage($client, $idlang) {
* @copyright four for business AG <www.4fb.de> * @copyright four for business AG <www.4fb.de>
*/ */
function langDeleteLanguage($idlang, $idclient = "") { function langDeleteLanguage($idlang, $idclient = "") {
global $db, $sess, $client, $cfg, $notification; global $db, $cfg, $notification;
$deleteok = 1; $deleteok = 1;
// Bugfix: New idclient parameter introduced, as Administration -> Languages
// is used for different clients to delete the language
// Use global client id, if idclient not specified (former behaviour)
// Note, that this check also have been added for the action in the database
// - just to be equal to langNewLanguage
if (!is_numeric($idclient)) { if (!is_numeric($idclient)) {
$idclient = $client; $idclient = cRegistry::getClientId();
} }
//************ check if there are still arts online //************ check if there are still arts online

Datei anzeigen

@ -87,7 +87,7 @@ function statsArchive($yearmonth) {
".Contenido_Security::toInteger($db->f(1)).", ".Contenido_Security::toInteger($db->f(1)).",
".Contenido_Security::toInteger($db->f(2)).", ".Contenido_Security::toInteger($db->f(2)).",
".Contenido_Security::toInteger($db->f(3)).", ".Contenido_Security::toInteger($db->f(3)).",
'".Contenido_Security::escapeDB($db->f(4), $db2)."')"; ".Contenido_Security::escapeDB($db->f(4), $db2).")";
$db2->query($insertSQL); $db2->query($insertSQL);
} }

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');
} }
@ -53,12 +53,10 @@ $sReload = '<script language="javascript">
} }
</script>'; </script>';
if ($action == "lang_newlanguage" || $action == "lang_deletelanguage") if ($action == "lang_newlanguage" || $action == "lang_deletelanguage") {
{
$page = new UI_Page; $page = new UI_Page;
if ($action == "lang_deletelanguage") if ($action == "lang_deletelanguage") {
{
// finally delete from dropdown in header // finally delete from dropdown in header
$newOption = '<script> $newOption = '<script>
var langList = top.header.document.getElementById("cLanguageSelect"); var langList = top.header.document.getElementById("cLanguageSelect");
@ -93,10 +91,8 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
} }
$page->addScript('reload', $sReload); $page->addScript('reload', $sReload);
$page->render(); $page->render();
} else } else {
{ if ($action == "lang_edit") {
if ($action == "lang_edit")
{
callPluginStore("languages"); callPluginStore("languages");
$language = new cApiLanguage($idlang); $language = new cApiLanguage($idlang);
@ -122,20 +118,15 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
</script>'; </script>';
} }
if(!$perm->have_perm_area_action($area, $action)) if (!$perm->have_perm_area_action($area, $action)) {
{
$notification->displayNotification("error", i18n("Permission denied")); $notification->displayNotification("error", i18n("Permission denied"));
} else { } else {
if ( !isset($idlang) && $action != "lang_new") if (!isset($idlang) && $action != "lang_new") {
{
$notification->displayNotification("error", "no language id given. Usually, this shouldn't happen, except if you played around with your system. if you didn't play around, please report a bug."); $notification->displayNotification("error", "no language id given. Usually, this shouldn't happen, except if you played around with your system. if you didn't play around, please report a bug.");
} else { } else {
if (($action == "lang_edit") && ($perm->have_perm_area_action($area, $action))) if (($action == "lang_edit") && ($perm->have_perm_area_action($area, $action))) {
{
langEditLanguage($idlang, $langname, $sencoding, $active, $direction); langEditLanguage($idlang, $langname, $sencoding, $active, $direction);
$noti = $notification->returnNotification("info", i18n("Changes saved")) . "<br>"; $noti = $notification->returnNotification("info", i18n("Changes saved")) . "<br>";
} }
@ -165,8 +156,7 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
$charsets = array(); $charsets = array();
foreach ($cfg['AvailableCharsets'] as $charset) foreach ($cfg['AvailableCharsets'] as $charset) {
{
$charsets[$charset] = $charset; $charsets[$charset] = $charset;
} }

Datei anzeigen

@ -70,7 +70,7 @@ function cecCreateMetatags($metatags) {
if (file_exists($cachefilename)) { if (file_exists($cachefilename)) {
$fileexists = true; $fileexists = true;
$diff = mktime() - filemtime($cachefilename); $diff = time() - filemtime($cachefilename);
if ($diff > $cachetime) { if ($diff > $cachetime) {
$reload = true; $reload = true;