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,8 +29,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -49,22 +49,20 @@ $sReload = '<script language="javascript">
if (left_bottom) { if (left_bottom) {
var href = left_bottom.location.href; var href = left_bottom.location.href;
href = href.replace(/&idlang[^&]*/, \'\'); href = href.replace(/&idlang[^&]*/, \'\');
left_bottom.location.href = href+"&idlang="+"'.$idlang.'"; left_bottom.location.href = href+"&idlang="+"' . $idlang . '";
} }
</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");
var thepos=""; var thepos="";
for(var i=0;i<langList.length;i++) { for(var i=0;i<langList.length;i++) {
if(langList.options[i].value == '.$idlang.') { if(langList.options[i].value == ' . $idlang . ') {
thepos = langList.options[i].index; thepos = langList.options[i].index;
} }
} }
@ -75,13 +73,13 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
if ($action == "lang_newlanguage") { if ($action == "lang_newlanguage") {
// update language dropdown in header // update language dropdown in header
$new_idlang = 0; $new_idlang = 0;
$db->query( 'SELECT max(idlang) as newlang FROM '.$cfg["tab"]["lang"].';' ); $db->query('SELECT max(idlang) as newlang FROM ' . $cfg["tab"]["lang"] . ';');
if ($db->next_record()) { if ($db->next_record()) {
$new_idlang = $db->f('newlang'); $new_idlang = $db->f('newlang');
} }
$newOption = '<script language="javascript"> $newOption = '<script language="javascript">
var newLang = new Option("'.i18n("New language").' ('.$new_idlang.')", "'.$new_idlang.'", false, false); var newLang = new Option("' . i18n("New language") . ' (' . $new_idlang . ')", "' . $new_idlang . '", false, false);
var langList = top.header.document.getElementById("cLanguageSelect"); var langList = top.header.document.getElementById("cLanguageSelect");
langList.options[langList.options.length] = newLang; langList.options[langList.options.length] = newLang;
</script>'; </script>';
@ -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);
@ -105,8 +101,8 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
$language->setProperty("dateformat", "date", stripslashes($dateformat)); $language->setProperty("dateformat", "date", stripslashes($dateformat));
$language->setProperty("dateformat", "time", stripslashes($timeformat)); $language->setProperty("dateformat", "time", stripslashes($timeformat));
$language->setProperty("language", "code", stripslashes($languagecode) ); $language->setProperty("language", "code", stripslashes($languagecode));
$language->setProperty("country", "code", stripslashes($countrycode) ); $language->setProperty("country", "code", stripslashes($countrycode));
// update dropdown in header // update dropdown in header
$newOption = '<script language="javascript"> $newOption = '<script language="javascript">
@ -114,30 +110,25 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
var thepos=""; var thepos="";
for(var i=0;i<langList.length;i++) for(var i=0;i<langList.length;i++)
{ {
if(langList.options[i].value == '.$idlang.') if(langList.options[i].value == ' . $idlang . ')
{ {
langList.options[i].innerHTML = \''.$langname.' ('.$idlang.')\'; langList.options[i].innerHTML = \'' . $langname . ' (' . $idlang . ')\';
} }
} }
</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>";
} }
@ -147,11 +138,11 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
A.idlang AS idlang, A.name AS name, A.active as active, A.encoding as encoding, A.direction as direction, A.idlang AS idlang, A.name AS name, A.active as active, A.encoding as encoding, A.direction as direction,
B.idclient AS idclient B.idclient AS idclient
FROM FROM
".$cfg["tab"]["lang"]." AS A, " . $cfg["tab"]["lang"] . " AS A,
".$cfg["tab"]["clients_lang"]." AS B " . $cfg["tab"]["clients_lang"] . " AS B
WHERE WHERE
A.idlang = '".Contenido_Security::toInteger($idlang)."' AND A.idlang = '" . Contenido_Security::toInteger($idlang) . "' AND
B.idlang = '".Contenido_Security::toInteger($idlang)."'"; B.idlang = '" . Contenido_Security::toInteger($idlang) . "'";
$db->query($sql); $db->query($sql);
$db->next_record(); $db->next_record();
@ -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;
} }
@ -183,7 +173,7 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
'mo' => 'Moldavian', 'mr' => 'Marathi', 'ms' => 'Malay', 'mt' => 'Maltese', 'my' => 'Burmese', 'na' => 'Nauru', 'ne' => 'Nepali', 'nl' => 'Dutch', 'no' => 'Norwegian', 'oc' => 'Occitan', 'om' => 'Oromo', 'or' => 'Oriya', 'pa' => 'Punjabi', 'pl' => 'Polish', 'ps' => 'Pashto', 'pt' => 'Portuguese', 'mo' => 'Moldavian', 'mr' => 'Marathi', 'ms' => 'Malay', 'mt' => 'Maltese', 'my' => 'Burmese', 'na' => 'Nauru', 'ne' => 'Nepali', 'nl' => 'Dutch', 'no' => 'Norwegian', 'oc' => 'Occitan', 'om' => 'Oromo', 'or' => 'Oriya', 'pa' => 'Punjabi', 'pl' => 'Polish', 'ps' => 'Pashto', 'pt' => 'Portuguese',
'qu' => 'Quechua', 'rm' => 'Rhaeto-Romance', 'rn' => 'Kirundi', 'ro' => 'Romanian', 'ru' => 'Russian', 'rw' => 'Kinyarwanda', 'sa' => 'Sanskrit', 'sd' => 'Sindhi', 'sg' => 'Sangro', 'sh' => 'Serbo-Croatian', 'si' => 'Singhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'sm' => 'Samoan', 'qu' => 'Quechua', 'rm' => 'Rhaeto-Romance', 'rn' => 'Kirundi', 'ro' => 'Romanian', 'ru' => 'Russian', 'rw' => 'Kinyarwanda', 'sa' => 'Sanskrit', 'sd' => 'Sindhi', 'sg' => 'Sangro', 'sh' => 'Serbo-Croatian', 'si' => 'Singhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'sm' => 'Samoan',
'sn' => 'Shona', 'so' => 'Somali', 'sq' => 'Albanian', 'sr' => 'Serbian', 'ss' => 'Siswati', 'st' => 'Sesotho', 'su' => 'Sudanese', 'sv' => 'Swedish', 'sw' => 'Swahili', 'ta' => 'Tamil', 'te' => 'Tegulu', 'tg' => 'Tajik', 'th' => 'Thai', 'ti' => 'Tigtinya', 'tk' => 'Turkmen', 'tl' => 'Tagalog', 'sn' => 'Shona', 'so' => 'Somali', 'sq' => 'Albanian', 'sr' => 'Serbian', 'ss' => 'Siswati', 'st' => 'Sesotho', 'su' => 'Sudanese', 'sv' => 'Swedish', 'sw' => 'Swahili', 'ta' => 'Tamil', 'te' => 'Tegulu', 'tg' => 'Tajik', 'th' => 'Thai', 'ti' => 'Tigtinya', 'tk' => 'Turkmen', 'tl' => 'Tagalog',
'tn' => 'Setswana', 'to' => 'Tonga', 'tr' => 'Turkish', 'ts' => 'Tsonga', 'tt' => 'Tatar', 'tw' => 'Twi', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek', 'vi' => 'Vietnamese', 'vo' => 'Volapuk', 'wo' => 'Wolof', 'xh' => 'Xhosa', 'yo' => 'Yoruba', 'zh' => 'Chinese', 'zu' => 'Zulu' ); 'tn' => 'Setswana', 'to' => 'Tonga', 'tr' => 'Turkish', 'ts' => 'Tsonga', 'tt' => 'Tatar', 'tw' => 'Twi', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek', 'vi' => 'Vietnamese', 'vo' => 'Volapuk', 'wo' => 'Wolof', 'xh' => 'Xhosa', 'yo' => 'Yoruba', 'zh' => 'Chinese', 'zu' => 'Zulu');
$iso_3166_codes = array('af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria', 'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola', 'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua/Barbuda', 'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba', 'au' => 'Australia', 'at' => 'Austria', $iso_3166_codes = array('af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria', 'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola', 'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua/Barbuda', 'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba', 'au' => 'Australia', 'at' => 'Austria',
'az' => 'Azerbaijan', 'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh', 'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium', 'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda', 'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia/Herzegowina', 'bw' => 'Botswana', 'az' => 'Azerbaijan', 'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh', 'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium', 'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda', 'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia/Herzegowina', 'bw' => 'Botswana',
@ -204,7 +194,7 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
'sh' => 'Santa Helena', 'pm' => 'Santa Pierre/Miquelon', 'sd' => 'Sudan', 'sr' => 'Suriname', 'sj' => 'Svalbard/Jan Mayen Islands', 'sz' => 'Swaziland', 'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic', 'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'sh' => 'Santa Helena', 'pm' => 'Santa Pierre/Miquelon', 'sd' => 'Sudan', 'sr' => 'Suriname', 'sj' => 'Svalbard/Jan Mayen Islands', 'sz' => 'Swaziland', 'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic', 'tw' => 'Taiwan', 'tj' => 'Tajikistan',
'tz' => 'Tanzania, United Republic Of', 'th' => 'Thailand', 'tg' => 'Togo', 'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad/Tobago', 'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan', 'tc' => 'Turks/Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda', 'ua' => 'Ukraine', 'tz' => 'Tanzania, United Republic Of', 'th' => 'Thailand', 'tg' => 'Togo', 'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad/Tobago', 'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan', 'tc' => 'Turks/Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda', 'ua' => 'Ukraine',
'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom', 'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay', 'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 'va' => 'Vatican City State -Holy See-', 've' => 'Venezuela', 'vn' => 'Viet Nam', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom', 'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay', 'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 'va' => 'Vatican City State -Holy See-', 've' => 'Venezuela', 'vn' => 'Viet Nam',
'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.', 'wf' => 'Wallis/Futuna Islands', 'eh' => 'Western Sahara', 'ye' => 'Yemen', 'yu' => 'Yougoslavia', 'zm' => 'Zambia', 'zw' => 'Zimbabwe' ); 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.', 'wf' => 'Wallis/Futuna Islands', 'eh' => 'Western Sahara', 'ye' => 'Yemen', 'yu' => 'Yougoslavia', 'zm' => 'Zambia', 'zw' => 'Zimbabwe');
@ -241,8 +231,8 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
$form->addHeader(i18n("Edit language")); $form->addHeader(i18n("Edit language"));
$form->add(i18n("Language name"), formGenerateField ("text", "langname", clHtmlSpecialChars($db->f("name")), 40, 255)); $form->add(i18n("Language name"), formGenerateField("text", "langname", clHtmlSpecialChars($db->f("name")), 40, 255));
$form->add(i18n("Active"), formGenerateCheckbox ("active", "1",$db->f("active"))); $form->add(i18n("Active"), formGenerateCheckbox("active", "1", $db->f("active")));
$form->addSubHeader(i18n("Language")); $form->addSubHeader(i18n("Language"));
$form->add(i18n("Encoding"), $eselect); $form->add(i18n("Encoding"), $eselect);
@ -257,7 +247,7 @@ if ($action == "lang_newlanguage" || $action == "lang_deletelanguage")
$page = new UI_Page; $page = new UI_Page;
$page->setContent($noti.$form->render()); $page->setContent($noti . $form->render());
if ($targetclient == $client) { if ($targetclient == $client) {
$page->addScript('refreshHeader', $newOption); $page->addScript('refreshHeader', $newOption);

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;