Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e46d0fa4a4 | ||
|
|
f7db84c62f | ||
|
|
3267fc0266 |
@@ -56,6 +56,7 @@ return [
|
|||||||
"./www/configs/config.db.php",
|
"./www/configs/config.db.php",
|
||||||
"./www/configs/config.host.php",
|
"./www/configs/config.host.php",
|
||||||
"./www/configs/config.path.php",
|
"./www/configs/config.path.php",
|
||||||
|
"./www/configs/config.other.php",
|
||||||
"./www/configs/config.master.php",
|
"./www/configs/config.master.php",
|
||||||
"./www/includes/admin_header.php",
|
"./www/includes/admin_header.php",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -10,26 +10,28 @@ define('USE_DATABASE', true);
|
|||||||
define('USE_HEADER', true);
|
define('USE_HEADER', true);
|
||||||
require 'config.php';
|
require 'config.php';
|
||||||
require BASE.INCLUDES.'admin_header.php';
|
require BASE.INCLUDES.'admin_header.php';
|
||||||
$smarty->MASTER_TEMPLATE_NAME = 'main_body.tpl';
|
if (is_object($smarty)) {
|
||||||
$smarty->TEMPLATE_NAME = 'smarty_test.tpl';
|
$smarty->MASTER_TEMPLATE_NAME = 'main_body.tpl';
|
||||||
$smarty->CSS_SPECIAL_TEMPLATE_NAME = 'smart_test.css';
|
$smarty->TEMPLATE_NAME = 'smarty_test.tpl';
|
||||||
$smarty->USE_PROTOTYPE = false;
|
$smarty->CSS_SPECIAL_TEMPLATE_NAME = 'smart_test.css';
|
||||||
$smarty->USE_JQUERY = true;
|
$smarty->USE_PROTOTYPE = false;
|
||||||
$smarty->JS_DATEPICKR = false;
|
$smarty->USE_JQUERY = true;
|
||||||
if ($smarty->USE_PROTOTYPE) {
|
$smarty->JS_DATEPICKR = false;
|
||||||
$smarty->ADMIN_JAVASCRIPT = 'edit.pt.js';
|
if ($smarty->USE_PROTOTYPE) {
|
||||||
$smarty->JS_SPECIAL_TEMPLATE_NAME = 'prototype.test.js';
|
$smarty->ADMIN_JAVASCRIPT = 'edit.pt.js';
|
||||||
} elseif ($smarty->USE_JQUERY) {
|
$smarty->JS_SPECIAL_TEMPLATE_NAME = 'prototype.test.js';
|
||||||
$smarty->ADMIN_JAVASCRIPT = 'edit.jq.js';
|
} elseif ($smarty->USE_JQUERY) {
|
||||||
$smarty->JS_SPECIAL_TEMPLATE_NAME = 'jquery.test.js';
|
$smarty->ADMIN_JAVASCRIPT = 'edit.jq.js';
|
||||||
}
|
$smarty->JS_SPECIAL_TEMPLATE_NAME = 'jquery.test.js';
|
||||||
$smarty->PAGE_WIDTH = "100%";
|
}
|
||||||
// require BASE.INCLUDES.'admin_set_paths.php';
|
$smarty->PAGE_WIDTH = '100%';
|
||||||
$smarty->setSmartyPaths();
|
// require BASE.INCLUDES.'admin_set_paths.php';
|
||||||
|
$smarty->setSmartyPaths();
|
||||||
|
|
||||||
// smarty test
|
// smarty test
|
||||||
$smarty->DATA['SMARTY_TEST'] = 'Test Data';
|
$smarty->DATA['SMARTY_TEST'] = 'Test Data';
|
||||||
$smarty->DATA['TRANSLATE_TEST'] = $cms->l->__('Are we translated?');
|
$smarty->DATA['TRANSLATE_TEST'] = $cms->l->__('Are we translated?');
|
||||||
|
}
|
||||||
|
|
||||||
// drop down test with optgroups
|
// drop down test with optgroups
|
||||||
$options = array (
|
$options = array (
|
||||||
@@ -48,8 +50,9 @@ $options = array (
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$smarty->DATA['drop_down_test'] = $options;
|
if (is_object($smarty)) {
|
||||||
|
$smarty->DATA['drop_down_test'] = $options;
|
||||||
// require BASE.INCLUDES.'admin_smarty.php';
|
// require BASE.INCLUDES.'admin_smarty.php';
|
||||||
$smarty->setSmartyVarsAdmin();
|
$smarty->setSmartyVarsAdmin();
|
||||||
|
}
|
||||||
require BASE.INCLUDES.'admin_footer.php';
|
require BASE.INCLUDES.'admin_footer.php';
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
''
|
''
|
||||||
).
|
).
|
||||||
// filename
|
// filename
|
||||||
$data['filename'].
|
(isset($data['filename']) ? $data['filename'] : '').
|
||||||
// query string
|
// query string
|
||||||
(isset($data['query_string']) && $data['query_string'] ?
|
(isset($data['query_string']) && $data['query_string'] ?
|
||||||
$data['query_string'] :
|
$data['query_string'] :
|
||||||
@@ -294,7 +294,8 @@ if ($form->my_page_name == 'edit_order') {
|
|||||||
$menu_data[$i]['splitfactor_in'] = 0;
|
$menu_data[$i]['splitfactor_in'] = 0;
|
||||||
}
|
}
|
||||||
// on matching, we also need to check if we are in the same folder
|
// on matching, we also need to check if we are in the same folder
|
||||||
if ($data['filename'] == $form->getPageName() &&
|
if (isset($data['filename']) &&
|
||||||
|
$data['filename'] == $form->getPageName() &&
|
||||||
(!isset($data['hostname']) || (
|
(!isset($data['hostname']) || (
|
||||||
isset($data['hostname']) &&
|
isset($data['hostname']) &&
|
||||||
(!$data['hostname'] || strstr($data['hostname'], CONTENT_PATH) !== false)
|
(!$data['hostname'] || strstr($data['hostname'], CONTENT_PATH) !== false)
|
||||||
|
|||||||
@@ -86,9 +86,10 @@ function getScrollOffset()
|
|||||||
function setCenter(id, left, top)
|
function setCenter(id, left, top)
|
||||||
{
|
{
|
||||||
// get size of id
|
// get size of id
|
||||||
var dimensions = {};
|
var dimensions = {
|
||||||
dimensions.height = $('#' + id).height();
|
height: $('#' + id).height(),
|
||||||
dimensions.width = $('#' + id).width();
|
width: $('#' + id).width()
|
||||||
|
};
|
||||||
var type = $('#' + id).css('position');
|
var type = $('#' + id).css('position');
|
||||||
var viewport = getWindowSize();
|
var viewport = getWindowSize();
|
||||||
var offset = getScrollOffset();
|
var offset = getScrollOffset();
|
||||||
@@ -474,11 +475,11 @@ function overlayBoxHide()
|
|||||||
*/
|
*/
|
||||||
function setOverlayBox()
|
function setOverlayBox()
|
||||||
{
|
{
|
||||||
var viewport = document.viewport.getDimensions();
|
/* var viewport = document.viewport.getDimensions();
|
||||||
$('#overlayBox').setStyle ({
|
$('#overlayBox').css ({
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%'
|
height: '100%'
|
||||||
});
|
});*/
|
||||||
$('#overlayBox').show();
|
$('#overlayBox').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -256,6 +256,7 @@ class Backend extends \CoreLibs\DB\IO
|
|||||||
$type = 'popup';
|
$type = 'popup';
|
||||||
} else {
|
} else {
|
||||||
$type = 'normal';
|
$type = 'normal';
|
||||||
|
/** @phan-suppress-next-line PhanTypeArraySuspicious */
|
||||||
$data['popup'] = 0;
|
$data['popup'] = 0;
|
||||||
}
|
}
|
||||||
$query_string = '';
|
$query_string = '';
|
||||||
|
|||||||
@@ -686,6 +686,63 @@ class Basic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checks if we have a need to work on certain debug output
|
||||||
|
* Needs debug/echo/print ad target for which of the debug flag groups we check
|
||||||
|
* also needs level string to check in the per level output flag check.
|
||||||
|
* In case we have invalid target it will return false
|
||||||
|
* @param string $target target group to check debug/echo/print
|
||||||
|
* @param string $level level to check in detailed level flag
|
||||||
|
* @return bool true on access allowed or false on no access
|
||||||
|
*/
|
||||||
|
private function doDebugTrigger(string $target, string $level): bool
|
||||||
|
{
|
||||||
|
$access = false;
|
||||||
|
// check if we do debug, echo or print
|
||||||
|
switch ($target) {
|
||||||
|
case 'debug':
|
||||||
|
if ((
|
||||||
|
(isset($this->debug_output[$level]) && $this->debug_output[$level]) ||
|
||||||
|
$this->debug_output_all
|
||||||
|
) &&
|
||||||
|
(!isset($this->debug_output_not[$level]) ||
|
||||||
|
(isset($this->debug_output_not[$level]) && !$this->debug_output_not[$level])
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
$access = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'echo':
|
||||||
|
if ((
|
||||||
|
(isset($this->echo_output[$level]) && $this->echo_output[$level]) ||
|
||||||
|
$this->echo_output_all
|
||||||
|
) &&
|
||||||
|
(!isset($this->echo_output_not[$level]) ||
|
||||||
|
(isset($this->echo_output_not[$level]) && !$this->echo_output_not[$level])
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
$access = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'print':
|
||||||
|
if ((
|
||||||
|
(isset($this->print_output[$level]) && $this->print_output[$level]) ||
|
||||||
|
$this->print_output_all
|
||||||
|
) &&
|
||||||
|
(!isset($this->print_output_not[$level]) ||
|
||||||
|
(isset($this->print_output_not[$level]) && !$this->print_output_not[$level])
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
$access = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// fall through with access false
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $access;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* write debug data to error_msg array
|
* write debug data to error_msg array
|
||||||
* @param string $level id for error message, groups messages together
|
* @param string $level id for error message, groups messages together
|
||||||
@@ -697,7 +754,7 @@ class Basic
|
|||||||
*/
|
*/
|
||||||
public function debug(string $level, string $string, bool $strip = false): void
|
public function debug(string $level, string $string, bool $strip = false): void
|
||||||
{
|
{
|
||||||
if (($this->debug_output[$level] || $this->debug_output_all) && !$this->debug_output_not[$level]) {
|
if ($this->doDebugTrigger('debug', $level)) {
|
||||||
if (!isset($this->error_msg[$level])) {
|
if (!isset($this->error_msg[$level])) {
|
||||||
$this->error_msg[$level] = '';
|
$this->error_msg[$level] = '';
|
||||||
}
|
}
|
||||||
@@ -721,7 +778,7 @@ class Basic
|
|||||||
// write to file if set
|
// write to file if set
|
||||||
$this->writeErrorMsg($level, $error_string_print);
|
$this->writeErrorMsg($level, $error_string_print);
|
||||||
// write to error level
|
// write to error level
|
||||||
if (($this->echo_output[$level] || $this->echo_output_all) && !$this->echo_output_not[$level]) {
|
if ($this->doDebugTrigger('echo', $level)) {
|
||||||
$this->error_msg[$level] .= $error_string;
|
$this->error_msg[$level] .= $error_string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -782,8 +839,8 @@ class Basic
|
|||||||
}
|
}
|
||||||
$script_end = microtime(true) - $this->script_starttime;
|
$script_end = microtime(true) - $this->script_starttime;
|
||||||
foreach ($this->error_msg as $level => $temp_debug_output) {
|
foreach ($this->error_msg as $level => $temp_debug_output) {
|
||||||
if (($this->debug_output[$level] || $this->debug_output_all) && !$this->debug_output_not[$level]) {
|
if ($this->doDebugTrigger('debug', $level)) {
|
||||||
if (($this->echo_output[$level] || $this->echo_output_all) && !$this->echo_output_not[$level]) {
|
if ($this->doDebugTrigger('echo', $level)) {
|
||||||
$string_output .= '<div style="font-size: 12px;">[<span style="font-style: italic; color: #c56c00;">'.$level.'</span>] '.(($string) ? "<b>**** ".$this->htmlent($string)." ****</b>\n" : "").'</div>';
|
$string_output .= '<div style="font-size: 12px;">[<span style="font-style: italic; color: #c56c00;">'.$level.'</span>] '.(($string) ? "<b>**** ".$this->htmlent($string)." ****</b>\n" : "").'</div>';
|
||||||
$string_output .= $temp_debug_output;
|
$string_output .= $temp_debug_output;
|
||||||
} // echo it out
|
} // echo it out
|
||||||
@@ -809,9 +866,9 @@ class Basic
|
|||||||
*/
|
*/
|
||||||
private function writeErrorMsg(string $level, string $error_string): void
|
private function writeErrorMsg(string $level, string $error_string): void
|
||||||
{
|
{
|
||||||
if (($this->debug_output[$level] || $this->debug_output_all) && !$this->debug_output_not[$level]) {
|
if ($this->doDebugTrigger('debug', $level)) {
|
||||||
// only write if write is requested
|
// only write if write is requested
|
||||||
if (($this->print_output[$level] || $this->print_output_all) && !$this->print_output_not[$level]) {
|
if ($this->doDebugTrigger('print', $level)) {
|
||||||
// replace all html tags
|
// replace all html tags
|
||||||
// $error_string = preg_replace("/(<\/?)(\w+)([^>]*>)/", "##\\2##", $error_string);
|
// $error_string = preg_replace("/(<\/?)(\w+)([^>]*>)/", "##\\2##", $error_string);
|
||||||
// $error_string = preg_replace("/(<\/?)(\w+)([^>]*>)/", "", $error_string);
|
// $error_string = preg_replace("/(<\/?)(\w+)([^>]*>)/", "", $error_string);
|
||||||
@@ -2648,6 +2705,35 @@ class Basic
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO: make this a proper uniq ID creation
|
||||||
|
* add uuidv4 subcall to the uuid function too
|
||||||
|
* creates a uniq id
|
||||||
|
* @param string $type uniq id type, currently md5 or sha256 allowed
|
||||||
|
* if not set will use DEFAULT_HASH if set
|
||||||
|
* @return string uniq id
|
||||||
|
*/
|
||||||
|
public function uniqId(string $type = ''): string
|
||||||
|
{
|
||||||
|
$uniq_id = '';
|
||||||
|
switch ($type) {
|
||||||
|
case 'md5':
|
||||||
|
$uniq_id = md5(uniqid((string)rand(), true));
|
||||||
|
break;
|
||||||
|
case 'sha256':
|
||||||
|
$uniq_id = hash('sha256', uniqid((string)rand(), true));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$hash = 'sha256';
|
||||||
|
if (defined(DEFAULT_HASH)) {
|
||||||
|
$hash = DEFAULT_HASH;
|
||||||
|
}
|
||||||
|
$uniq_id = hash($hash, uniqid((string)rand(), true));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $uniq_id;
|
||||||
|
}
|
||||||
|
|
||||||
// [!!! DEPRECATED !!!]
|
// [!!! DEPRECATED !!!]
|
||||||
// ALL crypt* methids are DEPRECATED and SHALL NOT BE USED
|
// ALL crypt* methids are DEPRECATED and SHALL NOT BE USED
|
||||||
// use the new password* instead
|
// use the new password* instead
|
||||||
|
|||||||
@@ -689,7 +689,9 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$t_string .= $field_array['before_value'];
|
$t_string .= $field_array['before_value'];
|
||||||
}
|
}
|
||||||
// must have res element set
|
// must have res element set
|
||||||
if (isset($res[$field_array['name']])) {
|
if (isset($field_array['name']) &&
|
||||||
|
isset($res[$field_array['name']])
|
||||||
|
) {
|
||||||
if (isset($field_array['binary'])) {
|
if (isset($field_array['binary'])) {
|
||||||
if (isset($field_array['binary'][0])) {
|
if (isset($field_array['binary'][0])) {
|
||||||
$t_string .= $field_array['binary'][0];
|
$t_string .= $field_array['binary'][0];
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace FileUpload;
|
namespace FileUpload;
|
||||||
|
|
||||||
use \FileUpload\Core;
|
// use \FileUpload\Core;
|
||||||
|
|
||||||
class qqFileUploader
|
class qqFileUploader
|
||||||
{
|
{
|
||||||
@@ -84,7 +84,7 @@ class qqFileUploader
|
|||||||
$pathinfo = pathinfo($this->file->getName());
|
$pathinfo = pathinfo($this->file->getName());
|
||||||
$filename = $pathinfo['filename'];
|
$filename = $pathinfo['filename'];
|
||||||
//$filename = md5(uniqid());
|
//$filename = md5(uniqid());
|
||||||
$ext = $pathinfo['extension'];
|
$ext = $pathinfo['extension'] ?? '';
|
||||||
|
|
||||||
if ($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)) {
|
if ($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)) {
|
||||||
$these = implode(', ', $this->allowedExtensions);
|
$these = implode(', ', $this->allowedExtensions);
|
||||||
|
|||||||
Reference in New Issue
Block a user