Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd0af5a294 | ||
|
|
fd8caaf5de | ||
|
|
3d842d4107 | ||
|
|
c895beb35f | ||
|
|
b6a35d15cf | ||
|
|
20c44694e8 |
@@ -9,6 +9,7 @@ php_value xdebug.show_local_vars 0
|
||||
# allowed COOKIE, FILES, GET, POST, REQUEST, SERVER, SESSION
|
||||
#php_value xdebug.dump.GET *
|
||||
# PHP ERROR SETTINGS
|
||||
php_flag short_open_tag off
|
||||
php_flag display_startup_errors on
|
||||
php_flag display_errors on
|
||||
php_flag html_errors on
|
||||
|
||||
@@ -82,17 +82,17 @@ return [
|
||||
// A list of directories holding code that we want
|
||||
// to parse, but not analyze
|
||||
"exclude_analysis_directory_list" => [
|
||||
'www/vendor',
|
||||
'www/lib/FileUpload',
|
||||
'www/lib/pChart',
|
||||
'www/lib/pChart2.1.4',
|
||||
'www/lib/Smarty',
|
||||
'www/lib/smarty-3.1.30',
|
||||
'www/templates_c',
|
||||
'www/log',
|
||||
'www/tmp',
|
||||
'www/cache',
|
||||
'www/media',
|
||||
'www/vendor',
|
||||
'www/lib/FileUpload',
|
||||
'www/lib/pChart',
|
||||
'www/lib/pChart2.1.4',
|
||||
'www/lib/Smarty',
|
||||
'www/lib/smarty-3.1.30',
|
||||
'www/templates_c',
|
||||
'www/log',
|
||||
'www/tmp',
|
||||
'www/cache',
|
||||
'www/media',
|
||||
],
|
||||
'exclude_file_list' => [
|
||||
// ignore all symlink files to edit
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2018/10/11
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2018/10/11
|
||||
@@ -7,19 +7,18 @@
|
||||
* - DB access name (array group from config.db)
|
||||
* - location (test/stage/live)
|
||||
* - debug flag (true/false)
|
||||
* - DB path (eg PUBLIC_SCHEMA)
|
||||
* - stie lang
|
||||
* - site lang
|
||||
* HISTORY:
|
||||
*********************************************************************/
|
||||
|
||||
// other master config to attach
|
||||
// $LOCAL_CONFIG = array(
|
||||
// $__LOCAL_CONFIG = array(
|
||||
// 'db_host' => '',
|
||||
// 'location' => '',
|
||||
// 'debug_flag' => true,
|
||||
// 'site_lang' => 'en_utf8',
|
||||
// 'login_enabled' => true
|
||||
// )
|
||||
// );
|
||||
|
||||
// each host has a different db_host
|
||||
$SITE_CONFIG = array(
|
||||
@@ -39,7 +38,7 @@ $SITE_CONFIG = array(
|
||||
// enable/disable login override
|
||||
'login_enabled' => true
|
||||
),
|
||||
// 'other.host.com' => $LOCAL_CONFIG
|
||||
// 'other.host.com' => $__LOCAL_CONFIG
|
||||
);
|
||||
|
||||
// __END__
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2003/06/10
|
||||
@@ -190,24 +190,29 @@ if (file_exists(BASE.CONFIGS.'config.path.php')) {
|
||||
// ** missing live domains **
|
||||
// get the name without the port
|
||||
list($HOST_NAME) = array_pad(explode(':', $_SERVER['HTTP_HOST'], 2), 2, null);
|
||||
// BAIL ON:
|
||||
// set HOST name
|
||||
DEFINE('HOST_NAME', $HOST_NAME);
|
||||
// BAIL ON MISSING MASTER SITE CONFIG
|
||||
if (!isset($SITE_CONFIG[HOST_NAME]['location'])) {
|
||||
echo 'Missing SITE_CONFIG entry for: "'.HOST_NAME.'". Contact Administrator';
|
||||
exit;
|
||||
}
|
||||
// BAIL ON MISSING DB CONFIG:
|
||||
// we have either no db selction for this host but have db config entries
|
||||
// or we have a db selection but no db config as array or empty
|
||||
// or we have a selection but no matching db config entry
|
||||
if ((!isset($SITE_CONFIG[$HOST_NAME]['db_host']) && count($DB_CONFIG)) ||
|
||||
(isset($SITE_CONFIG[$HOST_NAME]['db_host']) &&
|
||||
if ((!isset($SITE_CONFIG[HOST_NAME]['db_host']) && count($DB_CONFIG)) ||
|
||||
(isset($SITE_CONFIG[HOST_NAME]['db_host']) &&
|
||||
// missing DB CONFIG
|
||||
((is_array($DB_CONFIG) && !count($DB_CONFIG)) ||
|
||||
!is_array($DB_CONFIG) ||
|
||||
// has DB CONFIG but no match
|
||||
(is_array($DB_CONFIG) && count($DB_CONFIG) && !isset($DB_CONFIG[$SITE_CONFIG[$HOST_NAME]['db_host']])))
|
||||
(is_array($DB_CONFIG) && count($DB_CONFIG) && !isset($DB_CONFIG[$SITE_CONFIG[HOST_NAME]['db_host']])))
|
||||
)
|
||||
) {
|
||||
echo 'No matching DB config found for: "'.$HOST_NAME.'". Contact Administrator';
|
||||
echo 'No matching DB config found for: "'.HOST_NAME.'". Contact Administrator';
|
||||
exit;
|
||||
}
|
||||
// set HOST name
|
||||
DEFINE('HOST_NAME', $HOST_NAME);
|
||||
// set SSL on
|
||||
if ((array_key_exists('HTTPS', $_SERVER) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
|
||||
$_SERVER['SERVER_PORT'] == 443) {
|
||||
@@ -218,7 +223,7 @@ if ((array_key_exists('HTTPS', $_SERVER) && !empty($_SERVER['HTTPS']) && $_SERVE
|
||||
DEFINE('HOST_PROTOCOL', 'http://');
|
||||
}
|
||||
// define the db config set name, the db config and the db schema
|
||||
DEFINE('DB_CONFIG_NAME', $SITE_CONFIG[$HOST_NAME]['db_host']);
|
||||
DEFINE('DB_CONFIG_NAME', $SITE_CONFIG[HOST_NAME]['db_host']);
|
||||
DEFINE('DB_CONFIG', isset($DB_CONFIG[DB_CONFIG_NAME]) ? $DB_CONFIG[DB_CONFIG_NAME] : array());
|
||||
// DEFINE('DB_CONFIG_TARGET', SITE_CONFIG[$HOST_NAME]['db_host_target']);
|
||||
// DEFINE('DB_CONFIG_OTHER', SITE_CONFIG[$HOST_NAME]['db_host_other']);
|
||||
@@ -226,10 +231,10 @@ DEFINE('DB_CONFIG', isset($DB_CONFIG[DB_CONFIG_NAME]) ? $DB_CONFIG[DB_CONFIG_NAM
|
||||
// DEFINE('LOGIN_DB_SCHEMA', PUBLIC_SCHEMA); // where the edit* tables are
|
||||
// DEFINE('GLOBAL_DB_SCHEMA', PUBLIC_SCHEMA); // where global tables are that are used by all schemas (eg queue tables for online, etc)
|
||||
// debug settings, site lang, etc
|
||||
DEFINE('TARGET', $SITE_CONFIG[$HOST_NAME]['location']);
|
||||
DEFINE('DEBUG', $SITE_CONFIG[$HOST_NAME]['debug_flag']);
|
||||
DEFINE('SITE_LANG', $SITE_CONFIG[$HOST_NAME]['site_lang']);
|
||||
DEFINE('LOGIN_ENABLED', $SITE_CONFIG[$HOST_NAME]['login_enabled']);
|
||||
DEFINE('TARGET', $SITE_CONFIG[HOST_NAME]['location']);
|
||||
DEFINE('DEBUG', $SITE_CONFIG[HOST_NAME]['debug_flag']);
|
||||
DEFINE('SITE_LANG', $SITE_CONFIG[HOST_NAME]['site_lang']);
|
||||
DEFINE('LOGIN_ENABLED', $SITE_CONFIG[HOST_NAME]['login_enabled']);
|
||||
// paths
|
||||
// DEFINE('CSV_PATH', $PATHS[TARGET]['csv_path']);
|
||||
// DEFINE('EXPORT_SCRIPT', $PATHS[TARGET]['perl_bin']);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
/********************************************************************
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2018/10/11
|
||||
|
||||
@@ -27,6 +27,12 @@ $SET_SESSION_NAME = EDIT_SESSION_NAME;
|
||||
//------------------------------ library include end
|
||||
|
||||
//------------------------------ basic variable settings start
|
||||
if (!isset($AJAX_PAGE)) {
|
||||
$AJAX_PAGE = false;
|
||||
}
|
||||
if (!isset($ZIP_STREAM)) {
|
||||
$ZIP_STREAM = false;
|
||||
}
|
||||
// set encoding
|
||||
if (!isset($encoding)) {
|
||||
$encoding = DEFAULT_ENCODING;
|
||||
@@ -38,10 +44,10 @@ if (session_id() && $_SESSION['DEFAULT_LANG']) {
|
||||
$lang = defined('SITE_LANG') ? SITE_LANG : DEFAULT_LANG;
|
||||
}
|
||||
// end the stop of the output flow, but only if we didn't request a csv file download
|
||||
if (array_key_exists('action', $_POST) && $_POST['action'] != 'download_csv') {
|
||||
if (isset($_POST['action']) && $_POST['action'] != 'download_csv' && !$AJAX_PAGE) {
|
||||
header("Content-type: text/html; charset=".$encoding);
|
||||
}
|
||||
if (isset($AJAX_PAGE) && isset($ZIP_STREAM) && $AJAX_PAGE && !$ZIP_STREAM) {
|
||||
if ($AJAX_PAGE && !$ZIP_STREAM) {
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
}
|
||||
//------------------------------ basic variable settings start
|
||||
@@ -86,7 +92,7 @@ if (!$login->login) {
|
||||
//------------------------------ page rights start
|
||||
// flag if to show the edit access id drop down list
|
||||
// check if we have more than one EA ID
|
||||
$cms->DATA['show_ea_extra'] = $login->acl['show_ea_extra'];
|
||||
$cms->DATA['show_ea_extra'] = isset($login->acl['show_ea_extra']) ? $login->acl['show_ea_extra'] : false;
|
||||
//------------------------------ page rights ned
|
||||
|
||||
// automatic hide for DEBUG messages on live server
|
||||
|
||||
@@ -29,21 +29,21 @@ if (isset($_SESSION['DEFAULT_LANG'])) {
|
||||
$lang_short = substr($lang, 0, 2);
|
||||
|
||||
// set include & template names
|
||||
$PAGE_FILE_NAME = str_replace(".php", "", $cms->page_name);
|
||||
$PAGE_FILE_NAME = str_replace('.php', '', $cms->page_name);
|
||||
// set include & template names
|
||||
if (!isset($CONTENT_INCLUDE)) {
|
||||
$CONTENT_INCLUDE = $PAGE_FILE_NAME.'.tpl';
|
||||
}
|
||||
$FORM_NAME = !isset($FORM_NAME) || !$FORM_NAME ? str_replace(".php", "", $cms->page_name) : $FORM_NAME;
|
||||
$FORM_NAME = !isset($FORM_NAME) || !$FORM_NAME ? str_replace('.php', '', $cms->page_name) : $FORM_NAME;
|
||||
// set local page title
|
||||
$L_TITLE = ucfirst(str_replace('_', ' ', $cms->getPageName(1))).(defined(G_TITLE) ? ' - '.G_TITLE : '');
|
||||
// strip tpl and replace it with php
|
||||
// php include file per page
|
||||
$cms->INC_TEMPLATE_NAME = str_replace(".tpl", ".php", $CONTENT_INCLUDE);
|
||||
$cms->INC_TEMPLATE_NAME = str_replace('.tpl', '.php', $CONTENT_INCLUDE);
|
||||
// javascript include per page
|
||||
$cms->JS_TEMPLATE_NAME = str_replace(".tpl", ".js", $CONTENT_INCLUDE);
|
||||
$cms->JS_TEMPLATE_NAME = str_replace('.tpl', '.js', $CONTENT_INCLUDE);
|
||||
// css per page
|
||||
$cms->CSS_TEMPLATE_NAME = str_replace(".tpl", ".css", $CONTENT_INCLUDE);
|
||||
$cms->CSS_TEMPLATE_NAME = str_replace('.tpl', '.css', $CONTENT_INCLUDE);
|
||||
// special CSS file
|
||||
$cms->CSS_SPECIAL_TEMPLATE_NAME = isset($CSS_NAME) ? $CSS_NAME : '';
|
||||
// special JS file
|
||||
|
||||
@@ -69,16 +69,23 @@ $cms->DATA['messages'] = $cms->messages;
|
||||
|
||||
// top menu
|
||||
$cms->DATA['nav_menu'] = $cms->adbTopMenu();
|
||||
$cms->DATA['nav_menu_count'] = is_array($cms->DATA['nav_menu']) ? count($cms->DATA['nav_menu']) : 0;
|
||||
// the page name
|
||||
$cms->DATA['page_name'] = $cms->page_name;
|
||||
// user name
|
||||
$cms->DATA['USER_NAME'] = $_SESSION['USER_NAME'];
|
||||
$cms->DATA['ADMIN'] = $login->acl['admin'];
|
||||
// the template part to include into the body
|
||||
$cms->DATA['TEMPLATE_NAME'] = $TEMPLATE_NAME;
|
||||
$cms->DATA['CONTENT_INCLUDE'] = $CONTENT_INCLUDE;
|
||||
$cms->DATA['TEMPLATE_TRANSLATE'] = $TEMPLATE_TRANSLATE;
|
||||
$cms->DATA['PAGE_FILE_NAME'] = $PAGE_FILE_NAME;
|
||||
// LANG
|
||||
$cms->DATA['LANG'] = $lang;
|
||||
$cms->DATA['TINYMCE_LANG'] = $lang_short;
|
||||
// form name
|
||||
$cms->DATA['FORM_NAME'] = $FORM_NAME;
|
||||
// include flags
|
||||
$cms->DATA['USE_TINY_MCE'] = isset($USE_TINY_MCE) ? $USE_TINY_MCE : false;
|
||||
$cms->DATA['JS_DATEPICKR'] = isset($JS_DATEPICKR) ? $JS_DATEPICKR : false;
|
||||
$cms->DATA['JS_FLATPICKR'] = isset($JS_FLATPICKR) ? $JS_FLATPICKR : false;
|
||||
|
||||
@@ -1 +1 @@
|
||||
../../../admin/default/javascript/debug.js
|
||||
../../admin/javascript/debug.js
|
||||
@@ -1 +1 @@
|
||||
../../../admin/default/javascript/fineuploader/
|
||||
../../admin/javascript/fineuploader/
|
||||
@@ -1 +1 @@
|
||||
../../../admin/default/javascript/firebug.js
|
||||
../../admin/javascript/firebug.js
|
||||
@@ -105,6 +105,9 @@ class Login extends \CoreLibs\DB\IO
|
||||
// acl vars
|
||||
public $acl = array();
|
||||
public $default_acl_list = array();
|
||||
// login html, if we are on an ajax page
|
||||
private $login_html = '';
|
||||
private $login_is_ajax_page = false;
|
||||
|
||||
// language
|
||||
public $l;
|
||||
@@ -145,6 +148,10 @@ class Login extends \CoreLibs\DB\IO
|
||||
exit;
|
||||
}
|
||||
|
||||
// set global is ajax page for if we show the data directly, or need to pass it back
|
||||
// to the continue AJAX class for output back to the user
|
||||
$this->login_is_ajax_page = isset($GLOBALS['AJAX_PAGE']) && $GLOBALS['AJAX_PAGE'] ? true : false;
|
||||
|
||||
$this->l = new \CoreLibs\Language\L10n($lang);
|
||||
|
||||
// if we have a search path we need to set it, to use the correct DB to login
|
||||
@@ -250,22 +257,41 @@ class Login extends \CoreLibs\DB\IO
|
||||
$this->loginPasswordForgot();
|
||||
}
|
||||
// if !$euid || permission not okay, print login screan
|
||||
echo $this->loginPrintLogin();
|
||||
$this->login_html = $this->loginPrintLogin();
|
||||
// closing all connections, depending on error status, exit
|
||||
if (!$this->loginCloseClass()) {
|
||||
// do not go anywhere, quit processing here
|
||||
// do something with possible debug data?
|
||||
if (TARGET == 'live' || TARGET == 'remote') {
|
||||
// login
|
||||
$this->debug_output_all = DEBUG ? 1 : 0;
|
||||
$this->echo_output_all = 0;
|
||||
$this->print_output_all = DEBUG ? 1 : 0;
|
||||
// if variable AJAX flag is not set, show output, else pass through for ajax work
|
||||
if ($this->login_is_ajax_page !== true) {
|
||||
// the login screen if we hav no login permission & login screen html data
|
||||
if ($this->login_html !== null) {
|
||||
echo $this->login_html;
|
||||
}
|
||||
// do not go anywhere, quit processing here
|
||||
// do something with possible debug data?
|
||||
if (TARGET == 'live' || TARGET == 'remote') {
|
||||
// login
|
||||
$this->debug_output_all = DEBUG ? 1 : 0;
|
||||
$this->echo_output_all = 0;
|
||||
$this->print_output_all = DEBUG ? 1 : 0;
|
||||
}
|
||||
$status_msg = $this->printErrorMsg();
|
||||
if ($this->echo_output_all) {
|
||||
echo $status_msg;
|
||||
}
|
||||
// exit so we don't process anything further, at all
|
||||
exit;
|
||||
} else {
|
||||
// if we are on an ajax page reset any POST/GET array data to avoid
|
||||
// any accidentical processing going on
|
||||
$_POST = array();
|
||||
$_GET = array();
|
||||
// set the action to login so we can trigger special login html return
|
||||
$_POST['action'] = 'login';
|
||||
$_POST['login_html'] = $this->login_html;
|
||||
// NOTE: this part needs to be catched by the frontend AJAX
|
||||
// and some function needs to then set something like this
|
||||
// document.getElementsByTagName('html')[0].innerHTML = data.content.login_html;
|
||||
}
|
||||
$status_msg = $this->printErrorMsg();
|
||||
if ($this->echo_output_all) {
|
||||
echo $status_msg;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
// set acls for this user/group and this page
|
||||
$this->loginSetAcl();
|
||||
@@ -737,9 +763,9 @@ class Login extends \CoreLibs\DB\IO
|
||||
}
|
||||
// flag if to show extra edit access drop downs (because user has multiple groups assigned)
|
||||
if (count($_SESSION['UNIT']) > 1) {
|
||||
$this->acl['show_ea_extra'] = 1;
|
||||
$this->acl['show_ea_extra'] = true;
|
||||
} else {
|
||||
$this->acl['show_ea_extra'] = 0;
|
||||
$this->acl['show_ea_extra'] = false;
|
||||
}
|
||||
// set the default edit access
|
||||
$this->acl['default_edit_access'] = $_SESSION['UNIT_DEFAULT'];
|
||||
@@ -902,76 +928,61 @@ class Login extends \CoreLibs\DB\IO
|
||||
{
|
||||
$html_string = null;
|
||||
if (!$this->permission_okay) {
|
||||
// get global AJAX page trigger
|
||||
// if true, return error ajax
|
||||
global $AJAX_PAGE;
|
||||
if ($AJAX_PAGE === true) {
|
||||
$data = array(
|
||||
'status' => 'error',
|
||||
'error_code' => $this->login_error,
|
||||
'msg' => array(
|
||||
'level' => 'error',
|
||||
'str' => $this->l->__('Login necessary')
|
||||
)
|
||||
);
|
||||
$html_string = json_encode($data);
|
||||
// set the templates now
|
||||
$this->loginSetTemplates();
|
||||
// if there is a global logout target ...
|
||||
if (file_exists($this->logout_target) && $this->logout_target) {
|
||||
$LOGOUT_TARGET = $this->logout_target;
|
||||
} else {
|
||||
// set the templates now
|
||||
$this->loginSetTemplates();
|
||||
// if there is a global logout target ...
|
||||
if (file_exists($this->logout_target) && $this->logout_target) {
|
||||
$LOGOUT_TARGET = $this->logout_target;
|
||||
} else {
|
||||
$LOGOUT_TARGET = "";
|
||||
}
|
||||
$LOGOUT_TARGET = "";
|
||||
}
|
||||
|
||||
$html_string = $this->login_template['template'];
|
||||
$html_string = $this->login_template['template'];
|
||||
|
||||
// if password change is okay
|
||||
if ($this->password_change) {
|
||||
$html_string_password_change = $this->login_template['password_change'];
|
||||
// if password change is okay
|
||||
if ($this->password_change) {
|
||||
$html_string_password_change = $this->login_template['password_change'];
|
||||
|
||||
// pre change the data in the PASSWORD_CHANGE_DIV first
|
||||
foreach ($this->login_template['strings'] as $string => $data) {
|
||||
if ($data) {
|
||||
$html_string_password_change = str_replace('{'.$string.'}', $data, $html_string_password_change);
|
||||
}
|
||||
// pre change the data in the PASSWORD_CHANGE_DIV first
|
||||
foreach ($this->login_template['strings'] as $string => $data) {
|
||||
if ($data) {
|
||||
$html_string_password_change = str_replace('{'.$string.'}', $data, $html_string_password_change);
|
||||
}
|
||||
// print error messagae
|
||||
if ($this->login_error) {
|
||||
$html_string_password_change = str_replace('{ERROR_MSG}', $this->login_error_msg[$this->login_error].'<br>', $html_string_password_change);
|
||||
} else {
|
||||
$html_string_password_change = str_replace('{ERROR_MSG}', '<br>', $html_string_password_change);
|
||||
}
|
||||
// if pw change action, show the float again
|
||||
if ($this->change_password && !$this->password_change_ok) {
|
||||
$html_string_password_change = str_replace('{PASSWORD_CHANGE_SHOW}', '<script language="JavaScript">ShowHideDiv(\'pw_change_div\');</script>', $html_string_password_change);
|
||||
} else {
|
||||
$html_string_password_change = str_replace('{PASSWORD_CHANGE_SHOW}', '', $html_string_password_change);
|
||||
}
|
||||
$this->login_template['strings']['PASSWORD_CHANGE_DIV'] = $html_string_password_change;
|
||||
}
|
||||
|
||||
// put in the logout redirect string
|
||||
if ($this->logout && $LOGOUT_TARGET) {
|
||||
$html_string = str_replace('{LOGOUT_TARGET}', '<meta http-equiv="refresh" content="0; URL='.$LOGOUT_TARGET.'">', $html_string);
|
||||
} else {
|
||||
$html_string = str_replace('{LOGOUT_TARGET}', '', $html_string);
|
||||
}
|
||||
|
||||
// print error messagae
|
||||
if ($this->login_error) {
|
||||
$html_string = str_replace('{ERROR_MSG}', $this->login_error_msg[$this->login_error].'<br>', $html_string);
|
||||
} elseif ($this->password_change_ok && $this->password_change) {
|
||||
$html_string = str_replace('{ERROR_MSG}', $this->login_error_msg[300].'<br>', $html_string);
|
||||
$html_string_password_change = str_replace('{ERROR_MSG}', $this->login_error_msg[$this->login_error].'<br>', $html_string_password_change);
|
||||
} else {
|
||||
$html_string = str_replace('{ERROR_MSG}', '<br>', $html_string);
|
||||
$html_string_password_change = str_replace('{ERROR_MSG}', '<br>', $html_string_password_change);
|
||||
}
|
||||
// if pw change action, show the float again
|
||||
if ($this->change_password && !$this->password_change_ok) {
|
||||
$html_string_password_change = str_replace('{PASSWORD_CHANGE_SHOW}', '<script language="JavaScript">ShowHideDiv(\'pw_change_div\');</script>', $html_string_password_change);
|
||||
} else {
|
||||
$html_string_password_change = str_replace('{PASSWORD_CHANGE_SHOW}', '', $html_string_password_change);
|
||||
}
|
||||
$this->login_template['strings']['PASSWORD_CHANGE_DIV'] = $html_string_password_change;
|
||||
}
|
||||
|
||||
// create the replace array context
|
||||
foreach ($this->login_template['strings'] as $string => $data) {
|
||||
$html_string = str_replace('{'.$string.'}', $data, $html_string);
|
||||
}
|
||||
// put in the logout redirect string
|
||||
if ($this->logout && $LOGOUT_TARGET) {
|
||||
$html_string = str_replace('{LOGOUT_TARGET}', '<meta http-equiv="refresh" content="0; URL='.$LOGOUT_TARGET.'">', $html_string);
|
||||
} else {
|
||||
$html_string = str_replace('{LOGOUT_TARGET}', '', $html_string);
|
||||
}
|
||||
|
||||
// print error messagae
|
||||
if ($this->login_error) {
|
||||
$html_string = str_replace('{ERROR_MSG}', $this->login_error_msg[$this->login_error].'<br>', $html_string);
|
||||
} elseif ($this->password_change_ok && $this->password_change) {
|
||||
$html_string = str_replace('{ERROR_MSG}', $this->login_error_msg[300].'<br>', $html_string);
|
||||
} else {
|
||||
$html_string = str_replace('{ERROR_MSG}', '<br>', $html_string);
|
||||
}
|
||||
|
||||
// create the replace array context
|
||||
foreach ($this->login_template['strings'] as $string => $data) {
|
||||
$html_string = str_replace('{'.$string.'}', $data, $html_string);
|
||||
}
|
||||
} // if permission is 0 then print out login
|
||||
// return the created HTML here or null for nothing
|
||||
|
||||
@@ -193,7 +193,7 @@ class Backend extends \CoreLibs\DB\IO
|
||||
}
|
||||
|
||||
// get the session pages array
|
||||
$PAGES = $_SESSION['PAGES'];
|
||||
$PAGES = isset($_SESSION['PAGES']) ? $_SESSION['PAGES'] : null;
|
||||
if (!isset($PAGES) || !is_array($PAGES)) {
|
||||
$PAGES = array();
|
||||
}
|
||||
|
||||
@@ -471,13 +471,22 @@ class Basic
|
||||
* if strict mode is set, throws an error if the class variable is not set
|
||||
* default is strict mode false
|
||||
* @param mixed $name class variable name
|
||||
* @return void
|
||||
* @return mixed return set variable content
|
||||
*/
|
||||
public function __get($name): void
|
||||
public function &__get($name)
|
||||
{
|
||||
if ($this->set_strict_mode === true && !property_exists($this, $name)) {
|
||||
trigger_error('Undefined property via __get(): '.$name, E_USER_NOTICE);
|
||||
}
|
||||
// on set return
|
||||
if (property_exists($this, $name)) {
|
||||
return $this->$name;
|
||||
} elseif ($this->set_compatible === true && !property_exists($this, $name)) {
|
||||
// if it is not set, and we are in compatible mode we need to init.
|
||||
// This is so that $class->array['key'] = 'bar'; works
|
||||
$this->{$name} = null;
|
||||
return $this->$name;
|
||||
}
|
||||
}
|
||||
|
||||
// *************************************************************
|
||||
@@ -1164,18 +1173,19 @@ class Basic
|
||||
/**
|
||||
* searches key = value in an array / array
|
||||
* only returns the first one found
|
||||
* @param string|int $needle needle (search for)
|
||||
* @param array $haystack haystack (search in)
|
||||
* @param string $key_lookin the key to look out for, default empty
|
||||
* @return ?array array with the elements where the needle can be found in the haystack array
|
||||
* @param string|int $needle needle (search for)
|
||||
* @param array $haystack haystack (search in)
|
||||
* @param string|null $key_lookin the key to look out for, default empty
|
||||
* @return array array with the elements where the needle can be
|
||||
* found in the haystack array
|
||||
*/
|
||||
public static function arraySearchRecursive($needle, array $haystack, $key_lookin = ''): ?array
|
||||
public static function arraySearchRecursive($needle, array $haystack, ?string $key_lookin = null): array
|
||||
{
|
||||
$path = array();
|
||||
if (!is_array($haystack)) {
|
||||
$haystack = array();
|
||||
}
|
||||
if (!is_array($key_lookin) &&
|
||||
if ($key_lookin != null &&
|
||||
!empty($key_lookin) &&
|
||||
array_key_exists($key_lookin, $haystack) &&
|
||||
$needle === $haystack[$key_lookin]
|
||||
|
||||
@@ -305,8 +305,8 @@ class IO extends \CoreLibs\Basic
|
||||
|
||||
/**
|
||||
* main DB concstructor with auto connection to DB and failure set on failed connection
|
||||
* @param array $db_config DB configuration array
|
||||
* @param int|integer $set_control_flag Class set control flag
|
||||
* @param array $db_config DB configuration array
|
||||
* @param int $set_control_flag 0/1/2/3 to set internal class parameter check
|
||||
*/
|
||||
public function __construct(array $db_config, int $set_control_flag = 0)
|
||||
{
|
||||
@@ -1056,7 +1056,7 @@ class IO extends \CoreLibs\Basic
|
||||
// if it is a call with reset in it we reset the cursor, so we get an uncached return
|
||||
// but only for the FIRST call (pos == 0)
|
||||
if ($reset && !$this->cursor_ext[$md5]['pos']) {
|
||||
unset($this->cursor_ext[$md5]['cursor']);
|
||||
$this->cursor_ext[$md5]['cursor'] = null;
|
||||
}
|
||||
// $this->debug('MENU', 'Reset: '.$reset.', Cursor: '.$this->cursor_ext[$md5]['cursor'].', Pos: '.$this->cursor_ext[$md5]['pos'].', Query: '.$query);
|
||||
|
||||
@@ -1156,7 +1156,7 @@ class IO extends \CoreLibs\Basic
|
||||
// return row, if last && reset, then unset the hole md5 array
|
||||
if (!$return && ($reset == 1 || $reset == 3) && $this->cursor_ext[$md5]['pos']) {
|
||||
// unset only the field names here of course
|
||||
unset($this->cursor_ext[$md5]['field_names']);
|
||||
$this->cursor_ext[$md5]['field_names'] = null;
|
||||
$this->cursor_ext[$md5]['pos'] = 0;
|
||||
} elseif (!$return && $reset == 2 && $this->cursor_ext[$md5]['pos']) {
|
||||
// at end of read reset pos & set cursor to 1 (so it does not get lost in session transfer)
|
||||
|
||||
@@ -22,7 +22,12 @@ class ProgressBar
|
||||
public $code; // unique code
|
||||
public $status = 'new'; // current status (new,show,hide)
|
||||
public $step = 0; // current step
|
||||
public $position = array(); // current bar position
|
||||
public $position = array( // current bar position
|
||||
'left' => null,
|
||||
'top' => null,
|
||||
'width' => null,
|
||||
'height' => null,
|
||||
);
|
||||
|
||||
public $clear_buffer_size = 1; // we need to send this before the lfush to get browser output
|
||||
public $clear_buffer_size_init = 1024*1024; // if I don't send that junk, it won't send anything
|
||||
|
||||
Reference in New Issue
Block a user