]> lifelog.hopto.org Git - LifeLog.git/commitdiff
upd
authorwbudic <redacted>
Sat, 13 Feb 2021 06:09:20 +0000 (17:09 +1100)
committerwbudic <redacted>
Sat, 13 Feb 2021 06:09:20 +0000 (17:09 +1100)
dbLifeLog/main.cnf
htdocs/cgi-bin/login_ctr.cgi

index 8d7830b5ef173c687360c5c2c180e1fac38b12d4..b58940d5e64fdb4387a73aeeff5c02dc25bd35a4 100644 (file)
@@ -1,38 +1,37 @@
-
-!CNF1.0
+!CNF2.0
 This is the main configuration file for the LifeLog applications settings.
 https://github.com/wbudic/LifeLog
 This is an Open Source License project -> https://choosealicense.com/licenses/isc/
 
-# Credential format:<<AUTO_LOGIN <{alias}/{password}> , to enable AUTO_LOGIN option bellow,
+# Credential format:<<AUTO_LOGIN <{alias}/{password}>>> , to enable AUTO_LOGIN option bellow,
  the config in app, has to also be enabled.
-<<AUTO_LOGIN</>
+<<AUTO_LOGIN<>>>
 # BACKUP_ENABLED -> Enable (1), disable (0) backups to be restored from config page.
-<<BACKUP_ENABLED<1>
+<<BACKUP_ENABLED<1>>>
 
 # Default database driver prefix, is SQLite.
 Note Remove -> '!' prefix to tag name, to enable, set,
 and override any previously set from now on, top to end of file approach.
 
-<<!DBI_SOURCE<DBI:SQLite:>
+<<DBI_SOURCE<DBI:SQLite:>>>
 # ProgresSQL DB driver. 
-<<!DBI_SOURCE<DBI:Pg:host=localhost;>
+<<!DBI_SOURCE<DBI:Pg:host=localhost;>>>
 # LOG actual variable size limit, - 1024 default, 128 minimum value. 
-<<!DBI_LOG_VAR_SIZE<8024>
+<<DBI_LOG_VAR_SIZE<8024>>>
 
 # Set the following to an database name, with external managed multiple users, that are to connect to a single database.
 # Users have to be externally set, and alias is then used for their userid to be able to login. (Add user roles to AUTH table).
 # By default this setting is disabled with 0, making alias name, its own log database, per user.
-<<DBI_MULTI_USER_DB<>
+<<DBI_MULTI_USER_DB<>>>
 
 # Timezoning, if set to 1, country locale setting for timezone in config page is ignored.
-<<AUTO_SET_TIMEZONE<0>
+<<AUTO_SET_TIMEZONE<0>>>
 
 # Public, enabled list of categories. Remove -> '!' prefix before 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.
 # Following is similar to AUTO_LOGIN setting above, and must be set.
-<<!PUBLIC_LOGIN</>
+<<!PUBLIC_LOGIN</>>>
 <<TIME_ZONE_MAP<
 Australia/Marsfield=Australia/Sydney
 Australia/Bondi=Australia/Sydney
@@ -43,9 +42,9 @@ America/Texas=America/Chicago
 
 # @See help at bottom of config for all the following.
 
-<<!PAGE_VIEW_EXCLUDES<0=88,6,69> <- (Diary,System Log,Poetry) category id's only, does set in the config page also work.
-<<VIEW_OVERRIDE_SYSLOGS<0>>>
-<<VIEW_OVERRIDE_WHERE<ID_CAT>=6 AND >>>
+<<!PAGE_VIEW_EXCLUDES<0=88,6,69>>> <- (Diary,System Log,Poetry) category id's only, does set in the config page also work.
+<<!VIEW_OVERRIDE_SYSLOGS<0>>>
+<<!VIEW_OVERRIDE_WHERE<ID_CAT>=6 AND >>>
 
 
 <<CONFIG<4>
@@ -70,6 +69,7 @@ America/Texas=America/Chicago
 38|$COMPRESS_ENC=0`Compress Encode pages, default -> 0=false, 1=true.
 40|$SUBPAGEDIR  =docs`Directory to scan for subpages like documents.
 42|$DISP_ALL    = 1`Display whole log entry, default -> 1=true, 0=false for display single line only.
+>>
 <<CAT<3>
 01|Unspecified `For quick uncategorized entries.
 03|File System `Operating file system/Application short log.
@@ -86,6 +86,7 @@ America/Texas=America/Chicago
 60|Online      `Online purchases (ebay, or received/ordered from online source).
 88|Diary       `Diary specific log and entry. Your daily yaddi-yadda that have decided to place here.
 90|Fitness     `Fitness steps, news, info, and useful links. Amount is steps.
+>>
 <<MIG<>
 NOTES|DROP TABLE NOTES;' ver. 1.5 fts4 virtual tables have been scratched as they require special SQLite compilation.
 LOG<5>|Run Query ' ver. 1.5
index fe9f16dde628900de772384c756db44387515098..d7a5eb9f857b23dbbec8515b430ebf1f80a8cd6b 100755 (executable)
@@ -287,7 +287,7 @@ try{
                 TIME_ZONE_MAP=>$TIME_ZONE_MAP, 
                 db_log_var_limit=>Settings::dbVLSZ()
          });    
-    my $DB_VERSION  = Settings::release();
+    my $DB_VERSION  = Settings::release(); #$After loading of config this has now been changed to the current database one.
     my $hasLogTbl   = $curr_tables{'LOG'};
     my $hasNotesTbl = $curr_tables{'NOTES'};
     my @annons = Settings::anons();
@@ -330,7 +330,7 @@ try{
             $db->do('CREATE TABLE life_log_login_ctr_temp_table AS SELECT * FROM LOG;');
             my %notes_ids = ();
             if($hasNotesTbl){
-                $pst =  Settings::selectRecords($db, 'SELECT rowid, DATE FROM LOG WHERE RTF > 0 ORDER BY DATE;');
+                $pst =  Settings::selectRecords($db, 'SELECT rowid, DATE FROM LOG WHERE ID_RTF > 0 ORDER BY DATE;');
                 while(my @row = $pst->fetchrow_array()) {
                         my $sql_date = $row[1];;
                         $sql_date = DateTime::Format::SQLite->parse_datetime($sql_date);
@@ -386,9 +386,16 @@ try{
     elsif($hasLogTbl && $SCRIPT_RELEASE > $DB_VERSION && $DB_VERSION < 2.0){
         #dev 1.9 main log view has changed in 1.8..1.9, above scope will perform anyway, its drop, to be recreated later.
         $db->do('DROP VIEW '.Settings->VW_LOG);delete($curr_tables{Settings->VW_LOG});
+        $db->do('ALTER TABLE "main"."LOG" ADD COLUMN "RTF" BYTE default 0');
         delete($curr_tables{Settings->VW_LOG});
         $changed = 1;
-    }elsif($SCRIPT_RELEASE > $DB_VERSION){$changed = 1;}
+    }
+    elsif($hasLogTbl && $SCRIPT_RELEASE > $DB_VERSION && $DB_VERSION < 2.2){
+        $db->do('ALTER TABLE "main"."LOG" ADD COLUMN "RTF" BYTE default 0');$changed = 1;
+    }    
+    elsif($SCRIPT_RELEASE > $DB_VERSION){$changed = 1;}
+
+    
 
     if(!$hasLogTbl) {