From: Will Budic Date: Wed, 19 Feb 2020 17:20:33 +0000 (+1100) Subject: Catch 22, populate, populate not called. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=e62ecdb788bed933e57c41187add23fe8aef1564;p=LifeLog.git Catch 22, populate, populate not called. --- diff --git a/htdocs/cgi-bin/config.cgi b/htdocs/cgi-bin/config.cgi index 9e98885..602bf16 100755 --- a/htdocs/cgi-bin/config.cgi +++ b/htdocs/cgi-bin/config.cgi @@ -257,7 +257,7 @@ while(my @row = $dbs->fetchrow_array()) { Earth ); } - elsif($n eq "KEEP_EXCS"){ + elsif($n eq "KEEP_EXCS" or $n eq 'TRACK_LOGINS' or $n eq 'DEBUG'){ my($l,$u)=("",""); if($v == 0){ $l = "SELECTED" @@ -265,24 +265,12 @@ while(my @row = $dbs->fetchrow_array()) { else{ $u = "SELECTED" } - $v = qq(); - } - elsif($n eq "DEBUG"){ - my($l,$u)=("",""); - if($v == 0){ - $l = "SELECTED" - } - else{ - $u = "SELECTED" - } - $v = qq( ); } + elsif($n ne "RELEASE_VER"){ $v = ''; } @@ -562,7 +550,6 @@ elsif ($change == 1){ if($change > 1){ - my $caid = $cgi->param('caid'); my $canm = $cgi->param('canm'); my $cade = $cgi->param('cade'); @@ -622,30 +609,30 @@ elsif($chdbfix){ } - $dbs = $dbs = Settings::selectRecords($db, "SELECT rowid, ID_CAT, DATE, LOG FROM LOG WHERE $sel ORDER BY DATE;" ); + $dbs = Settings::selectRecords($db, "SELECT rowid, ID_CAT, DATE, LOG FROM LOG WHERE $sel ORDER BY DATE;" ); while(my @row = $dbs->fetchrow_array()) { my $id = $row[0];# rowid - my $ct = $hshCats{$row[1]}; #ID_CAT - my $dt = DateTime::Format::SQLite->parse_datetime( $row[2] ); - my $log = $row[3]; - - my ( $dty, $dtf ) = $dt->ymd; - my $dth = $dt->hms; - if ( &Settings::universalDate == 1 ) { - $dtf = $dty; - } - else { - $dtf = $lang->time2str( "%d %b %Y", $dt->epoch, &Settings::timezone ); - } + my $ct = $hshCats{$row[1]}; #ID_CAT + my $dt = DateTime::Format::SQLite->parse_datetime( $row[2] ); + my $log = $row[3]; + + my ( $dty, $dtf ) = $dt->ymd; + my $dth = $dt->hms; + if ( &Settings::universalDate == 1 ) { + $dtf = $dty; + } + else { + $dtf = $lang->time2str( "%d %b %Y", $dt->epoch, &Settings::timezone ); + } - $output .= qq( - $dtf - $dth - $log - $ct - - - ); + $output .= qq( + $dtf + $dth + $log + $ct + + + ); }#while $output .= qq( diff --git a/htdocs/cgi-bin/login_ctr.cgi b/htdocs/cgi-bin/login_ctr.cgi index 6d3372a..458979f 100755 --- a/htdocs/cgi-bin/login_ctr.cgi +++ b/htdocs/cgi-bin/login_ctr.cgi @@ -326,10 +326,7 @@ sub checkCreateTables { &Settings::configProperty($db, 200, '^REL_RENUM',$pv); &Settings::configProperty($db, $did>0?$did:0, 'RELEASE_VER', $RELEASE); &Settings::toLog($db, "Upgraded Life Log from v.$dnm to v.$RELEASE version, this is the $pv upgrade.") if $pv; - &populate($db); } - } - else{ &populate($db); } Settings::toLog($db, "Log accessed by $alias.") if(&Settings::trackLogins); @@ -365,13 +362,12 @@ sub populate { foreach my $line (@lines) { last if ($line =~ //); - my @tick = split("`",$line); - if( index( $line, '<' ) == 0 ) {next;} #Migration is complex main.cnf might contain SQL alter statements. - + my @tick = split("`",$line); if( scalar @tick == 2 ) { my %hsh = $tick[0] =~ m[(\S+)\s*=\s*(\S+)]g;