Compare commits

...

1 Commits

Author SHA1 Message Date
Clemens Schwaighofer
5be34453ce Fix in Smarty Template class and PAGE WIDTH set 2022-11-10 10:26:59 +09:00
3 changed files with 21 additions and 21 deletions

View File

@@ -26,22 +26,22 @@ CREATE OR REPLACE FUNCTION set_login_user_id_set_date()
RETURNS TRIGGER AS RETURNS TRIGGER AS
$$ $$
BEGIN BEGIN
-- if new is not null/empty -- if new is not null/empty
-- and old one is null or old one different new one -- and old one is null or old one different new one
-- set NOW() -- set NOW()
-- if new one is NULL -- if new one is NULL
-- set NULL -- set NULL
IF IF
NEW.login_user_id IS NOT NULL AND NEW.login_user_id <> '' AND NEW.login_user_id IS NOT NULL AND NEW.login_user_id <> '' AND
(OLD.login_user_id IS NULL OR NEW.login_user_id <> OLD.login_user_id) (OLD.login_user_id IS NULL OR NEW.login_user_id <> OLD.login_user_id)
THEN THEN
NEW.login_user_id_set_date = NOW(); NEW.login_user_id_set_date = NOW();
NEW.login_user_id_last_revalidate = NOW(); NEW.login_user_id_last_revalidate = NOW();
ELSIF NEW.login_user_id IS NULL OR NEW.login_user_id = '' THEN ELSIF NEW.login_user_id IS NULL OR NEW.login_user_id = '' THEN
NEW.login_user_id_set_date = NULL; NEW.login_user_id_set_date = NULL;
NEW.login_user_id_last_revalidate = NULL; NEW.login_user_id_last_revalidate = NULL;
END IF; END IF;
RETURN NEW; RETURN NEW;
END; END;
$$ $$
LANGUAGE 'plpgsql'; LANGUAGE 'plpgsql';

View File

@@ -249,7 +249,7 @@ if ($is_secure) {
define('HOST_PROTOCOL', 'http://'); define('HOST_PROTOCOL', 'http://');
} }
// define the db config set name, the db config and the db schema // 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', $DB_CONFIG[DB_CONFIG_NAME] ?? []); define('DB_CONFIG', $DB_CONFIG[DB_CONFIG_NAME] ?? []);
// because we can't change constant, but we want to for db debug flag // because we can't change constant, but we want to for db debug flag
$GLOBALS['DB_CONFIG_SET'] = DB_CONFIG; $GLOBALS['DB_CONFIG_SET'] = DB_CONFIG;
@@ -268,9 +268,9 @@ define('SITE_ENCODING', $SITE_CONFIG[HOST_NAME]['site_encoding'] ?? DEFAULT_ENCO
define('LOGIN_ENABLED', $SITE_CONFIG[HOST_NAME]['login_enabled'] ?? false); define('LOGIN_ENABLED', $SITE_CONFIG[HOST_NAME]['login_enabled'] ?? false);
define('AUTH', $SITE_CONFIG[HOST_NAME]['auth'] ?? false); define('AUTH', $SITE_CONFIG[HOST_NAME]['auth'] ?? false);
// paths // paths
// define('CSV_PATH', $PATHS[TARGET]['csv_path']); // define('CSV_PATH', $PATHS[TARGET]['csv_path'] ?? '');
// define('EXPORT_SCRIPT', $PATHS[TARGET]['perl_bin']); // define('EXPORT_SCRIPT', $PATHS[TARGET]['perl_bin'] ?? '');
// define('REDIRECT_URL', $PATHS[TARGET]['redirect_url']); // define('REDIRECT_URL', $PATHS[TARGET]['redirect_url'] ?? '');
// show all errors if debug_all & show_error_handling are enabled // show all errors if debug_all & show_error_handling are enabled
define('SHOW_ALL_ERRORS', true); define('SHOW_ALL_ERRORS', true);

View File

@@ -465,7 +465,7 @@ class SmartyExtend extends \Smarty
$this->HEADER['JAVASCRIPT'] = $this->ADMIN_JAVASCRIPT ? $this->ADMIN_JAVASCRIPT : ADMIN_JAVASCRIPT; $this->HEADER['JAVASCRIPT'] = $this->ADMIN_JAVASCRIPT ? $this->ADMIN_JAVASCRIPT : ADMIN_JAVASCRIPT;
// the page name // the page name
$this->DATA['page_name'] = $this->page_name; $this->DATA['page_name'] = $this->page_name;
$this->DATA['table_width'] = empty($this->PAGE_WIDTH) ?: PAGE_WIDTH; $this->DATA['table_width'] = !empty($this->PAGE_WIDTH) ?: PAGE_WIDTH;
$this->DATA['form_name'] = $this->DATA['FORM_NAME']; $this->DATA['form_name'] = $this->DATA['FORM_NAME'];
// for tinymce special // for tinymce special
$this->DATA['TINYMCE_LANG'] = $this->lang_short; $this->DATA['TINYMCE_LANG'] = $this->lang_short;