]> lifelog.hopto.org Git - LifeLog.git/commitdiff
DBI_LOG_VAR_SIZE
authorWill Budicm <redacted>
Thu, 10 Dec 2020 13:00:56 +0000 (00:00 +1100)
committerWill Budicm <redacted>
Thu, 10 Dec 2020 13:00:56 +0000 (00:00 +1100)
dbLifeLog/main.cnf
htdocs/cgi-bin/login_ctr.cgi
htdocs/cgi-bin/main.cgi

index c8279085b21d7991e10ef8153d0d6329d8dfa920..272368fd19d68714c55bc7ec6268c0a98db6e49f 100644 (file)
@@ -9,9 +9,10 @@ Credential format:<<AUTO_LOGIN <{alias}/{password}> , don't enable here using AU
 <<BACKUP_ENABLED<1>
 # Default database driver prefix, is SQLite.
 <<DBI_SOURCE<DBI: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.
 <<!DBI_SOURCE<DBI:Pg:host=localhost;>
-
+# LOG actual variable size limit, - 1024 default, 128 minimum value. 
+#<<DBI_LOG_VAR_SIZE<1024>
 # 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:<<AUTO_LOGIN <{alias}/{password}> , don't enable here using AU
 #Timezoning, if set to 1, country locale setting for timezone in config page is ignored.
 <<AUTO_SET_TIMEZONE<0>
 
+
 # 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.
 <<!PUBLIC_CATS<03,06,09>#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;
index 5165ff775c3eccb4330e436283247f3b2fd0104a..3d952aac7f539b97fb4a0dded5c5e562c4cffe75 100755 (executable)
@@ -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'};
index 720a4e1eabccfc8f4f65d0be76f8bd43482ecfc3..84f095e20b6ecdcd8ed82506ed57870b57764666 100755 (executable)
@@ -376,7 +376,7 @@ qq(<FORM id="frm_log" action="data.cgi" onSubmit="return formDelValidation();">
         $stc->finish();
     }
     #
-    #Fetch entries!
+    # Fetch log entries!
     #
     my $CID_EVENT = 9;
     my $tags      = "";
@@ -887,7 +887,6 @@ $log_output .= qq(<form id="frm_srch" action="main.cgi"><TABLE class="tbl" borde
     <tr class="collpsd">
      <td align="right">View by Category:</td>
      <td align="left">
-
             <span id="lcat_v" class="ui-button">$catselected</span>
             <button class="bordered" data-dropdown="#dropdown-standard-v">&#171;</button>
             <div id="dropdown-standard-v" class="dropdown-menu        dropdown-anchor-left-center      dropdown-has-anchor">
@@ -1482,7 +1481,7 @@ sub outputPage {
     $BUFFER = $cgi->start_html(
             -title   => "Personal Log",
             -BGCOLOR => $BGCOL,
-            -onload  => "onBodyLoad('$toggle','".Settings::timezone()."','$today','".&Settings::sessionExprs."',$rs_cur);",
+            -onload  => "onBodyLoad('$toggle','".&Settings::timezone."','$today','".&Settings::sessionExprs."','$rs_cur',".&Settings::dbVLSZ.");",
             -style   => [
             { -type => 'text/css', -src => "wsrc/$TH_CSS" },
             { -type => 'text/css', -src => 'wsrc/jquery-ui.css' },