From 76eaacf9de0e5b9f341ca52c7444a80295935e8f Mon Sep 17 00:00:00 2001 From: Will Budicm Date: Mon, 23 Nov 2020 11:34:51 +1100 Subject: [PATCH] Upd, and edit button to show log section. --- Current Development Check List.md | 31 ++++++++++++++++--------------- htdocs/cgi-bin/config.cgi | 16 ++++++++-------- htdocs/cgi-bin/login_ctr.cgi | 9 ++++----- htdocs/cgi-bin/wsrc/main.js | 11 +---------- 4 files changed, 29 insertions(+), 38 deletions(-) diff --git a/Current Development Check List.md b/Current Development Check List.md index 167e315..019f893 100644 --- a/Current Development Check List.md +++ b/Current Development Check List.md @@ -9,14 +9,15 @@ * Provide office share link for main.inf linked categories, No login required but not log creation or search is possible. * ✔ Make the dbname uniform across all source types with Settings, as backups use the file format, not the database name. * Static pages setting for the pages directory. -* Search on multiwords should rank by encounter of words specified and display first. (That one is difficult) -* Search button should be an and on previous views settings. Otherwise lists entries of other categories containg an word. -* Provide markdown text functionality to html pages. For quick vanila plain documentation. -* Auto collapse/expand on multi line logs by 0-none as default. Setting to 1 or more showes only that number of lines. (That one is difficult) +* Search on multiple words should rank by encounter of words specified and display first. (That one is difficult) +* Search button should be an and on previous views settings. Otherwise lists entries of other categories containing an word. +* Provide markdown text functionality to html pages. For quick vanilla plain documentation. +* Auto collapse/expand on multi line logs by 0-none as default. Setting to 1 or more shows only that number of lines. (That one is difficult) +* ✔ Edit button to show if hidden is the log entry section. * ✔ Implement title bolding on logs using markdown, so tags can be avoided, for multiline logs. * ✔ Multi db driver type support. Earth stage requires same SQL related code to work on at least one more DBMS type other than SQLight. - * PostgreSQL is most likelly candidate as MySQL is not easy to install for the average user. - * Developing and adopting to MySQL or any other system is not prerogative, as it works well as it is with inbuild simplicity. + * PostgreSQL is most likely candidate as MySQL is not easy to install for the average user. + * Developing and adopting to MySQL or any other system is not prerogative, as it works well as it is with inbuilt simplicity. ### v.2.0 SUN RC2 Encountered @@ -67,7 +68,7 @@ * ✔ Notes to Log table should be other way in relationship direction. * LOG.ID_RTF -> NOTES.rowid * This is currently causing problems when the log renumerates, or entries are imported. -* ✔ In config page Categories section to appear after system settings. As less likelly to be changed. +* ✔ In config page Categories section to appear after system settings. As less likely 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. * ✔ Provide system logs on stats page runs. @@ -75,12 +76,12 @@ * ✔ main.cnf newer versions should have precedence to id and entry name to previously set or stored in db. * ✔ Config stored list of excludes. Provide multiple excludes view. * ✔ Settings module requires subroutines for debug logging and db properties access. -* ✔ LifeLog codebase release verion upgrade tracking and procedures with older databases. +* ✔ LifeLog codebase release version upgrade tracking and procedures with older databases. * ✔ JS based session logout timer warning to be implemented. * ✔ Mutli new alias access flood attack security trigger implementation. -* ✔ Debug system settings implementaiton. +* ✔ Debug system settings implementation. * ✔ Delete page updated to show better display of entries. -* ✔ Login page to indentify host. +* ✔ Login page to identify host. * ✔ Session cleanup on autologin not clearing properly. * A dbfix, should clear older entries as well. @@ -102,10 +103,10 @@ * Plugin subpages. * Configured in main.cnf * Appear on menu or as dropdouwn in the header. - * Downloaded/Configurated from the configuration page. + * Downloaded/Configured from the configuration page. * View save feature. Where you name and save to config or session a dropdown of views. * Fit to page log. Making log subpage scrollable rather than whole page to see the bottom. -* Make session timeot sub pages aware via JSON. +* Make session timeout sub pages aware via JSON. * Multiple category assignment table (set via hashtags and end of a post). * Log cards Export/Import. Send log entries via email or USB, why not? * Provide sub alias login that sets data visible to only a set of categories. @@ -167,11 +168,11 @@ ### v. 1.6 Encountered/Fixed -* ✔ Bug - 11 View runs, brocken since sticky feature implentation. Page record sets don't work. -* ✔ Bug - 10 Expense type entries don't fill ammount field on edit button clicked. +* ✔ Bug - 11 View runs, brocken since sticky feature implementation. Page record sets don't work. +* ✔ Bug - 10 Expense type entries don't fill amount field on edit button clicked. * ✔ Bug - 09 RTF documents lost on data renumeration of log. Data fix options in config. Needs urgent revision. * Bug - 08 CSV imports duplicate on DB Fix in config page. -* ✔ Bug - 07, Editing and RTF entry, Dosen't strip the attached html to view in place. +* ✔ Bug - 07, Editing and RTF entry, doesn't strip the attached html to view in place. * ✔ Bug - 06, Invalid Time 00. Javascript error thrown, when 00am used. * ✔ Bug - 05, CRLF and apostrophe replacement not working. * ✔ Bug - 04, Local not picked up properly on current date. diff --git a/htdocs/cgi-bin/config.cgi b/htdocs/cgi-bin/config.cgi index b629d90..9e8f141 100755 --- a/htdocs/cgi-bin/config.cgi +++ b/htdocs/cgi-bin/config.cgi @@ -347,14 +347,14 @@ my $frmPASS = qq( my @backups = (); -my ($file,$bck_list) =""; +my ($bck_list) =""; opendir my $dir, &Settings::logPath; -while($file = readdir $dir){ +while(my $file = readdir $dir){ next if $file eq '.' or $file eq '..' or index ($file , 'bck_') == -1; push @backups, $file; } close $dir; -foreach $file (sort @backups){ +foreach my $file (sort @backups){ #my $n = substr $file, length(&Settings::logPath); $bck_list .= "$file
"; } @@ -910,7 +910,7 @@ try{ my %nash = $key =~ m[(\S+)\s*\|\$\s*(\S+)]g; if(scalar(%nash)==1){ - for $id (keys %nash) { + for my $id (keys %nash) { $name = $nash{$id}; $value = $hsh{$key}; if($vars{$id}){ @@ -1022,9 +1022,9 @@ sub backup { #print $cgi->header; #print $cgi->start_html; print $cgi->header(-charset=>"UTF-8", -type=>"application/octet-stream", -attachment=>$ball); - open (TAR, "<".Settings::logPath().$ball) or die "Failed creating backup -> $ball"; - while(){print $_;} - close TAR; + open (my $TAR, "<", Settings::logPath().$ball) or die "Failed creating backup -> $ball"; + while(<$TAR>){print $_;} + close $TAR; #print $cgi->end_html; exit; @@ -1045,7 +1045,7 @@ sub restore { my $dbck = &Settings::logPath."bck/"; `mkdir $dbck` if (!-d $dbck); my $tar = $dbck.$hndl; $tar =~ s/osz$/tar/; my $pipe; - open ($pipe, "| openssl enc -d -des-ede3-cfb -salt -S ".Settings->CIPHER_KEY." -pass pass:$pass-$alias -in /dev/stdin 2>/dev/null > $tar"); + open ($pipe, "|" ,"openssl enc -d -des-ede3-cfb -salt -S ".Settings->CIPHER_KEY." -pass pass:$pass-$alias -in /dev/stdin 2>/dev/null > $tar"); while(<$hndl>){print $pipe $_;}; close $pipe; diff --git a/htdocs/cgi-bin/login_ctr.cgi b/htdocs/cgi-bin/login_ctr.cgi index 5e5b557..112868a 100755 --- a/htdocs/cgi-bin/login_ctr.cgi +++ b/htdocs/cgi-bin/login_ctr.cgi @@ -342,11 +342,10 @@ sub checkCreateTables { if(!$hasLogTbl) { if($sssCreatedDB){ - print $cgi->header; - print $cgi->start_html; - print "
A new alias login detect!
- Server security measure has been triggered -> Sorry further new alias login/creation not allowed!


Contact your network admin.
".$_; - print $cgi->end_html; + print $cgi->header, $cgi->start_html, + q(
A new alias login detect!
+ Server security measure has been triggered -> Sorry further new alias login/creation not allowed!
+


Contact your network admin.
).$_,$cgi->end_html; exit; } diff --git a/htdocs/cgi-bin/wsrc/main.js b/htdocs/cgi-bin/wsrc/main.js index 496a958..dba436a 100644 --- a/htdocs/cgi-bin/wsrc/main.js +++ b/htdocs/cgi-bin/wsrc/main.js @@ -497,6 +497,7 @@ function edit(row) { $("#amf").val(ec_v); $("#amf").selectmenu('refresh'); + $("#div_log").show(); $("#el").focus(); return false; @@ -743,16 +744,6 @@ function showAll() { return false; } -// function helpSelCategory(sel) { - -// var desc = _CATS_DESC_MAP.get(sel.options[sel.selectedIndex].value); -// if (!desc) { -// desc = "Please select a Category!"; -// } -// display(desc); -// } - - function display(desc, times){ var pnl = $("#cat_desc"); if(!times){ -- 2.34.1