From 5ab81ad2e2c909cf6fa013e00322ec8dbc9f7329 Mon Sep 17 00:00:00 2001 From: Will Budicm Date: Fri, 11 Dec 2020 00:00:56 +1100 Subject: [PATCH] DBI_LOG_VAR_SIZE --- dbLifeLog/main.cnf | 8 +++++--- htdocs/cgi-bin/login_ctr.cgi | 12 ++++++++---- htdocs/cgi-bin/main.cgi | 5 ++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/dbLifeLog/main.cnf b/dbLifeLog/main.cnf index c827908..272368f 100644 --- a/dbLifeLog/main.cnf +++ b/dbLifeLog/main.cnf @@ -9,9 +9,10 @@ Credential format:< , don't enable here using AU < # Default database driver prefix, is SQLite. < -# ProgresSQL DB driver. Remove -> '!' prefix to tag name, to enable. +# ProgresSQL DB driver. Remove -> '!' prefix to tag name, to enable, and override the above SQLite one. < - +# LOG actual variable size limit, - 1024 default, 128 minimum value. +#< # Set following to an database name, if multiple aliases connect to a single log database. # Users have to be set, and alias is then used for their userid to be able to login. # By default this setting is disabled with 0, making alias, its own log database. @@ -20,6 +21,7 @@ Credential format:< , don't enable here using AU #Timezoning, if set to 1, country locale setting for timezone in config page is ignored. < + # Public, enabled list of categories. Remove -> '!' prefix to tag name, to enable. Be careful what category you add/enable here. # Public records view feature only, it doesn't allow new log entries to be added and have pin point searching of all existing. <#File,System log and Event. @@ -77,7 +79,7 @@ LOG<5>|Run Query ' ver. 1.5 ## Following are historical migration changes. -//ALTER TABLE LOG RENAME AMMOUNT TO AMOUNT; +//ALTER TABLE LOG RENAME AMOUNT TO AMOUNT; CREATE TABLE life_log_temp_table AS SELECT * FROM LOG; DROP TABLE LOG; diff --git a/htdocs/cgi-bin/login_ctr.cgi b/htdocs/cgi-bin/login_ctr.cgi index 5165ff7..3d952aa 100755 --- a/htdocs/cgi-bin/login_ctr.cgi +++ b/htdocs/cgi-bin/login_ctr.cgi @@ -136,8 +136,10 @@ sub checkAutologinSet { if($v){$BACKUP_ENABLED = $v; next} $v = Settings::parseAutonom('DBI_SOURCE',$line); if($v){Settings::dbSrc($v); next} - $v = Settings::parseAutonom('AUTO_SET_TIMEZONE',$line); - if($v){$AUTO_SET_TIMEZONE = $v; next} + $v = Settings::parseAutonom('AUTO_SET_TIMEZONE',$line); + if($v){$AUTO_SET_TIMEZONE = $v; next} + $v = Settings::parseAutonom('DBI_LOG_VAR_SIZE',$line); + if($v){Settings::dbVLSZ($v); next} last if Settings::parseAutonom('CONFIG',$line); #By specs the config tag, is not an autonom, if found we stop reading. So better be last one spec. in file. } close $fh; @@ -201,7 +203,9 @@ sub checkPreparePGDB { CONNECTION LIMIT = -1; )); $db->disconnect(); undef $db; + return 1; } + return 0; } sub checkCreateTables { @@ -214,7 +218,7 @@ sub checkCreateTables { my %curr_tables = (); if(Settings::isProgressDB()){ - checkPreparePGDB(); + $changed = checkPreparePGDB(); $db = Settings::connectDB($alias, $passw); my @tbls = $db->tables(undef, 'public'); foreach (@tbls){ @@ -243,7 +247,7 @@ sub checkCreateTables { # Default version is the scripted current one, which could have been updated. # We need to maybe update further, if these versions differ. # Source default and the one from the CONFIG table in the (present) database. - Settings::getConfiguration($db,{backup_enabled=>$BACKUP_ENABLED,auto_set_timezone=>$AUTO_SET_TIMEZONE}); + Settings::getConfiguration($db,{backup_enabled=>$BACKUP_ENABLED,auto_set_timezone=>$AUTO_SET_TIMEZONE, db_log_var_limit=>Settings::dbVLSZ()}); my $DB_VERSION = Settings::release(); my $hasLogTbl = $curr_tables{'LOG'}; my $hasNotesTbl = $curr_tables{'NOTES'}; diff --git a/htdocs/cgi-bin/main.cgi b/htdocs/cgi-bin/main.cgi index 720a4e1..84f095e 100755 --- a/htdocs/cgi-bin/main.cgi +++ b/htdocs/cgi-bin/main.cgi @@ -376,7 +376,7 @@ qq(
$stc->finish(); } # - #Fetch entries! + # Fetch log entries! # my $CID_EVENT = 9; my $tags = ""; @@ -887,7 +887,6 @@ $log_output .= qq(
View by Category: - $catselected