### v.1.7 Encountered
-* ✔ Sticky rows bg colour, to be a shade different to other normal rows.
-* Login system log and out to be implemented. With system variable $TRACK_LOGINS to disable/enable.
+* New Categories dropdown, grouping in ascending order and presenting in columns of five at a time.
+* New CNF Development.
+ * Migration is currently hard to maintain and data export and import is wrongly reliant to CVS.
+ * CVS imports/exports are to be made obsolete in the future. It is not safe.
+ * This will be savailable via command line.
* RTF Documents header lister page, to provide for, new log entry assignment, deletion, edits.
+* ✔ Sticky rows bg colour, to be a shade different to other normal rows.
+* ✔ Login system log and out to be implemented. With system variable $TRACK_LOGINS to disable/enable.
* ✔Change all code to use Exceptions as project is becoming hard to manage.
* The harder it is to foresee possible problems, the less likely you will add unnecessary complexity. -- bud@
* ✔ Notes to Log table should be other way in relationship direction.
* Database backup tar ball 7zipped, upload and download button on config page.
* You must have the password you logged in to unscramble the backup.
* Alias -> pass -> backup password. Information required.
-* New Categories dropdown, grouping in ascending order and presenting in columns of five at a time.
-* New CNF Development.
- * Migration is currently hard to maintain and data export and import is wrongly reliant to CVS.
- * CVS imports/exports are to be made obsolete in the future. It is not safe.
- * This will be savailable via command line.
* ✔ In config page Categories section to appear after system settings. As less likelly to be changed.
* System Configuration section is to be sorted. As in future it is more likelly to grow.
* ✔ New system setting, $VIEW_ALL_LMT=1000. To limit view all records displayed on huge databases.
## Bugs
### v. 1.8 Encountered/Fixed
+
* Bug 18 - Same day datediff is displaying wrong report in time stack on the page.
* ✔ Issue 18 - Setting excludes for views, deliveres page but long delays with server finished exchange (page doesn't hang).
* The page is server delivered, if sections contain external internet links, this timeouts page browser delivery if the internet is down.
30|$DEBUG = 0`Development page additional debug output, off (default) or on.
32|$KEEP_EXCS = 0`Cache excludes between sessions, off (default) or on.
34|$VIEW_ALL_LMT=1000`Limit of all records displayed for large logs. Set to 0, for unlimited.
+36|$TRACK_LOGINS=1`Create system logs on login/logout of Life Log.
<<CAT<3>
01|Unspecified `For quick uncategorised entries.
03|File System `Operating file system/Application short log.
$session->param('passw', $passw);
$session->param('database', 'data_'.$alias.'_log.db');
$session->flush();
+ ### To MAIN PAGE
print $cgi->header(-expires=>"0s", -charset=>"UTF-8", -cookie=>$cookie, -location=>"main.cgi");
+ ###
return 1; #activated redirect to main, main will check credentials.
}
}
my $database = &Settings::logPath.'data_'.$alias.'_log.db';
my $dsn= "DBI:SQLite:dbname=$database";
my $db = DBI->connect($dsn, $alias, $passw, { RaiseError => 1 })
- or die "<p>Error->"& $DBI::errstri &"</p>";
+ or LifeLogException->throw($DBI::errstri);
my $rv;
my $changed = 0;
# We live check database for available tables now only once.
else{
&populate($db);
}
+ Settings::toLog($db, "Log accessed by $alias.") if(&Settings::trackLogins);
#
$db->disconnect();
#
sub logout {
- $session->delete();
- $session->flush();
+ if(&Settings::trackLogins){
+ try{
+ $alias = $session->param('alias');
+ $passw = $session->param('passw');
+ my $database = &Settings::logPath.'data_'.$alias.'_log.db';
+ my $dsn= "DBI:SQLite:dbname=$database";
+ my $db = DBI->connect($dsn, $alias, $passw, { RaiseError => 1 })
+ or LifeLogException->throw($DBI::errstri);
+ Settings::toLog($db, "Log properly loged out by $alias.");
+ $db->disconnect();
+ }catch{
+ my $err = $@;
+ my $dbg = "" ;
+ my $pwd = `pwd`;
+ $pwd =~ s/\s*$//;
+ $dbg = "--DEBUG OUTPUT--\n$debug" if $debug;
+ print $cgi->header,
+ "<font color=red><b>SERVER ERROR</b></font> on ".DateTime->now.
+ "<pre>".$pwd."/$0 -> &".caller." -> [$err]","\n$dbg</pre>",
+ $cgi->end_html;
+ exit;
+ }
+ }
+
+
print $cgi->header(-expires=>"0s", -charset=>"UTF-8", -cookie=>$cookie);
print $cgi->start_html(-title => "Personal Log Login", -BGCOLOR=>"black",
-style =>{-type => 'text/css', -src => 'wsrc/main.css'},
);
print $cgi->end_html;
+
+ $session->delete();
+ $session->flush();
+
+
exit;
}
my $st;
my $str_sqlCat = "SELECT ID, NAME, DESCRIPTION FROM CAT ORDER BY ID;";
-my $str_sql = "SELECT ID, ID_CAT, ID_RTF, DATE, LOG, AMOUNT, AFLAG, STICKY FROM VW_LOG WHERE STICKY = 1;";
+my $str_sql = "SELECT ID, ID_CAT, ID_RTF, DATE, LOG, AMOUNT, AFLAG, STICKY FROM VW_LOG WHERE STICKY = 1 LIMIT ".&Settings::viewAllLimit.";";
print qq(## Using db -> $dsn\n) if $DEBUG;
buildLog(traceDBExe($str_sql));
if(index ($str_sql, 'PID <=') < 1 && !$prm_vc && !$prm_xc && !$rs_keys && !$rs_dat_from){
- $str_sql = "SELECT ID, ID_CAT, ID_RTF, DATE, LOG, AMOUNT, AFLAG, STICKY FROM VW_LOG WHERE STICKY != 1 ORDER BY DATE DESC;";
+ $str_sql = "SELECT ID, ID_CAT, ID_RTF, DATE, LOG, AMOUNT, AFLAG, STICKY FROM VW_LOG WHERE STICKY != 1 ORDER BY DATE DESC LIMIT ".&Settings::viewAllLimit.";";
print $cgi->pre("###2 -> ".$str_sql) if $DEBUG;
;
&buildLog(traceDBExe($str_sql));
}
- $str_sql = qq(SELECT PID, ID_CAT, ID_RTF, DATE, LOG, AMOUNT, AFLAG, STICKY from VW_LOG where PID <= $rs_cur and STICKY != 1 $sand;);
+ $str_sql = qq(SELECT PID, ID_CAT, ID_RTF, DATE, LOG, AMOUNT, AFLAG, STICKY from VW_LOG where PID <= $rs_cur and STICKY != 1 $sand)." LIMIT ".&Settings::viewAllLimit.";";
return;
}
}