]> Kevux Git Server - koopa/log
koopa
5 years agoProgress: continue development on database abstraction development master
Kevin Day [Tue, 12 Feb 2019 02:02:58 +0000 (20:02 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Sun, 10 Feb 2019 02:07:32 +0000 (20:07 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Sun, 3 Feb 2019 01:40:45 +0000 (19:40 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Fri, 25 Jan 2019 02:18:02 +0000 (20:18 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Thu, 17 Jan 2019 05:12:45 +0000 (23:12 -0600)]
Progress: continue development on database abstraction

5 years agoCleanup: Rename t_database_reset to t_database_reset_configuration_parameter
Kevin Day [Wed, 16 Jan 2019 01:51:35 +0000 (19:51 -0600)]
Cleanup: Rename t_database_reset to t_database_reset_configuration_parameter

5 years agoCleanup: Rename t_database_set to t_database_set_configuration_parameter
Kevin Day [Wed, 16 Jan 2019 01:41:52 +0000 (19:41 -0600)]
Cleanup: Rename t_database_set to t_database_set_configuration_parameter

5 years agoProgress: continue development on database abstraction
Kevin Day [Fri, 11 Jan 2019 04:35:44 +0000 (22:35 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Mon, 7 Jan 2019 03:12:09 +0000 (21:12 -0600)]
Progress: continue development on database abstraction

Implement query placeholder.
Begin removing alternatives to query placeholder.

5 years agoFeature: t_base_return class objects may now be used directly as strings
Kevin Day [Sun, 6 Jan 2019 01:27:41 +0000 (19:27 -0600)]
Feature: t_base_return class objects may now be used directly as strings

By utilizing __toString(), all classes using t_base_return can now be directly used as a string.
This saves the effort of writing $my_class->get_value() or $my_class->get_value_exact().

This directly returns the private value as a string, which is probably faster than returning an object and then calling a function to convert.

Complex types, such as array, object, or resource, or converted to an empty string and must still be handled via function calls.

5 years agoProgress: continue development on database abstraction
Kevin Day [Thu, 13 Dec 2018 00:28:42 +0000 (18:28 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Tue, 11 Dec 2018 05:48:31 +0000 (23:48 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Sun, 9 Dec 2018 01:06:10 +0000 (19:06 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Fri, 7 Dec 2018 04:57:49 +0000 (22:57 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Thu, 6 Dec 2018 06:08:09 +0000 (00:08 -0600)]
Progress: continue development on database abstraction

5 years agoUpdate: remove $append parameters, simplifying functions
Kevin Day [Thu, 6 Dec 2018 04:57:12 +0000 (22:57 -0600)]
Update: remove $append parameters, simplifying functions

The $append is a convenience variable that does not need to exist.
If an array needs to be reset, one shoud call the function with NULL before adding anything new.

5 years agoProgress: continue development on database abstraction
Kevin Day [Wed, 5 Dec 2018 00:57:50 +0000 (18:57 -0600)]
Progress: continue development on database abstraction

5 years agoProgress: continue development on database abstraction
Kevin Day [Mon, 3 Dec 2018 04:58:47 +0000 (22:58 -0600)]
Progress: continue development on database abstraction

5 years agoCleanup: Rename 'rename column to' to 'rename column'
Kevin Day [Mon, 3 Dec 2018 04:16:54 +0000 (22:16 -0600)]
Cleanup: Rename 'rename column to' to 'rename column'

5 years agoCleanup: remove action_property and action_parameter where not used
Kevin Day [Mon, 3 Dec 2018 03:49:35 +0000 (21:49 -0600)]
Cleanup: remove action_property and action_parameter where not used

5 years agoUpdate: rename 'database_option' to 'database_cascade', and cleanup relating code
Kevin Day [Mon, 3 Dec 2018 03:41:07 +0000 (21:41 -0600)]
Update: rename 'database_option' to 'database_cascade', and cleanup relating code

The use of 'option' is not quite accurate, so I renamed it to the more aptly named 'cascade'.
The constraint code that conditionally utilized cascade has been rewritten to be stored in a single variable (as an array).
There is no cascade trait like there was an option trait because its use is different from case to case.

5 years agoUpdate: remove do_build functions from all action classes
Kevin Day [Mon, 3 Dec 2018 03:35:24 +0000 (21:35 -0600)]
Update: remove do_build functions from all action classes

These are too situation specific and are not likely to have an shared string structures to build.

5 years agoCleanup: delay assignment of $this->value until end of do_build functions
Kevin Day [Mon, 3 Dec 2018 01:49:44 +0000 (19:49 -0600)]
Cleanup: delay assignment of $this->value until end of do_build functions

5 years agoProgress: continue development on database abstraction layer
Kevin Day [Mon, 3 Dec 2018 00:51:01 +0000 (18:51 -0600)]
Progress: continue development on database abstraction layer

It seems cleaner to move the trait-specific do_build operations into the traits.
This will simplify the work needed on the actions shared between each DB operation.
This unlike classfull design, this still allows flexibility to do something completely diffeent if needed by the PostgeSQL language.
Begin some cleanup before I start diving into the alter foreign table code (which is quite extensive).
After seeing how if..thens vs switch..cases, I intend to remove the use of switches (they end up way too ugly and hard to read).
I also intend to make sure that $this->value is only ever assigned once the string has been built (preserving the state on error exit).

5 years agoProgress: continue development of database abstraction
Kevin Day [Sat, 18 Aug 2018 18:58:24 +0000 (13:58 -0500)]
Progress: continue development of database abstraction

I am having a lot of indecision on how exactly to approach key parts of this.
I have added query parameter class, and may be replacing the existing implementation (or not).
I decided to keep the naming system more simple by remove the query_ prefix of methods and variables provided by the database traits.
This may introduce naming conflicts that need to be reviewed and resolved.

5 years agoUpdate: redesign c_base_return, t_base_return_value, and related to be more abstract
Kevin Day [Sat, 18 Aug 2018 18:14:49 +0000 (13:14 -0500)]
Update: redesign c_base_return, t_base_return_value, and related to be more abstract

Attempt to make the design more consistent by setting up c_base_return as an abstract.
Anything that is directly calling c_base_return statics should be updated accordingly.

More of the value methods have been moved to t_base_return_value.
Move the related static methods to t_base_return_value as well.

5 years agoProgress: continue work on database
Kevin Day [Tue, 14 Aug 2018 04:30:28 +0000 (23:30 -0500)]
Progress: continue work on database

Begin implementing query parameter class.
Move numeration classes into explicit numeration directory and update class names.
Continue refactoring database classes.

5 years agoBugfix: http example needs to support namespaces
Kevin Day [Tue, 14 Aug 2018 04:29:15 +0000 (23:29 -0500)]
Bugfix: http example needs to support namespaces

This example program was written prior to the use of namespaces and has never been updated to work with the n_koopa namespace.

5 years agoCleanup: minor updates and corrections in naming documentation
Kevin Day [Tue, 14 Aug 2018 04:28:31 +0000 (23:28 -0500)]
Cleanup: minor updates and corrections in naming documentation

Signed-off-by: Kevin Day <thekevinday@gmail.com>
5 years agoCleanup: move has_value() to c_base_return and document guaranteed functions provided...
Kevin Day [Tue, 14 Aug 2018 04:28:03 +0000 (23:28 -0500)]
Cleanup: move has_value() to c_base_return and document guaranteed functions provided by c_base_return

5 years agoBugfix: cannot use $this-> on static class variable in c_base_defaults_global
Kevin Day [Tue, 14 Aug 2018 04:26:42 +0000 (23:26 -0500)]
Bugfix: cannot use $this-> on static class variable in c_base_defaults_global

5 years agoProgress: continue work on database, refactor database from 'base' into 'database'
Kevin Day [Wed, 8 Aug 2018 01:55:18 +0000 (20:55 -0500)]
Progress: continue work on database, refactor database from 'base' into 'database'

5 years agoProgress: continue adding query helper classes and traits
Kevin Day [Wed, 1 Aug 2018 03:54:41 +0000 (22:54 -0500)]
Progress: continue adding query helper classes and traits

6 years agoProgress: begin adding query helper classes and traits
Kevin Day [Sat, 10 Mar 2018 03:43:10 +0000 (21:43 -0600)]
Progress: begin adding query helper classes and traits

These are some traits and classes used to help facilitate the generation of SQL queries according to the postgresql standard.
Because of the volume of work being done, I am committing the very much incomplete and incorrect work.
A number of the files are copy and pasted placeholders until I can get to actually coding it and will contain invalid content until such time I can complete this feature set.
There may be futher restructing.

6 years agoUpdate: refactor the c_base_rfc_string and c_base_rfc_char into traits
Kevin Day [Thu, 22 Feb 2018 02:58:17 +0000 (20:58 -0600)]
Update: refactor the c_base_rfc_string and c_base_rfc_char into traits

These make more sense when implemented as traits.
Classes that extended this and had no expectation of a return value are now extended c_base_return.
All others are set to their most appropriate return type, such as c_base_return_string.

6 years agoUpdate: rework c_base_return_array
Kevin Day [Thu, 22 Feb 2018 02:43:31 +0000 (20:43 -0600)]
Update: rework c_base_return_array

Remove the type detection.
Add some missing array processing functionality.
Return NULL on get related commands instead of FALSE.

6 years agoUpdate: use the correct return type
Kevin Day [Thu, 22 Feb 2018 01:53:44 +0000 (19:53 -0600)]
Update: use the correct return type

I suspect that when I copied and pasted the static s_get_value_exact() functions that I forgot to update the default value.

6 years agoUpdate: provide custom error returning static function for NULL returns
Kevin Day [Sun, 18 Feb 2018 00:12:53 +0000 (18:12 -0600)]
Update: provide custom error returning static function for NULL returns

NULL does not need any values assigned so provide a static alternative to the by value error return.

6 years agoCleanup: move traits into an interfaces subdirectory
Kevin Day [Thu, 15 Feb 2018 02:52:03 +0000 (20:52 -0600)]
Cleanup: move traits into an interfaces subdirectory

Improve source code structure with the design by having traits exist in a separate file and subdirectory.

6 years agoCleanup: move interfaces into an interfaces subdirectory
Kevin Day [Thu, 15 Feb 2018 02:41:00 +0000 (20:41 -0600)]
Cleanup: move interfaces into an interfaces subdirectory

Improve source code structure with the design by having interfaces exist in a separate file and subdirectory.

6 years agoCleanup: prefix private constants with 'p_'
Kevin Day [Wed, 14 Feb 2018 00:32:34 +0000 (18:32 -0600)]
Cleanup: prefix private constants with 'p_'

I have mixed feelings about this, but it makes the behavior of prefixing p_ to private class parts and pr_ to protected class parts.
Stick to lower case for the prefix but continue to use upper case for the constant name.

6 years agoUpdate: always return and assign a copy of objects by default, but provide a trait...
Kevin Day [Sun, 11 Feb 2018 22:39:21 +0000 (16:39 -0600)]
Update: always return and assign a copy of objects by default, but provide a trait to use references

The default behavior is to favor security and separation between different objects.
Everytime an object is assigned or returned via a c_base_return class type, use a copy (clone) of that object.
This is good practice for security and data integrity.

In the event that a reference is needed (generally a good practice for performance and resource reasons), a trait is provided.
This trait must be manually assigned to each class.
This functionality must use distinct functions for assigning and retreiving the references to guarantee consistency in design and avoidance of accidents.

It is very important to note that this design can cause performance issues if this particular design is not understood.

This previous designs intended this behavior, but was not consistent.
This behavior should now be more consistent.

6 years agoBugfix: the trait t_base_return_message get_message() returns incorrect variable
Kevin Day [Sun, 11 Feb 2018 21:51:42 +0000 (15:51 -0600)]
Bugfix: the trait t_base_return_message get_message() returns incorrect variable

The message is being stored in the variable $message, not $value.

6 years agoCleanup: use do_build() instead of build()
Kevin Day [Sun, 11 Feb 2018 18:41:00 +0000 (12:41 -0600)]
Cleanup: use do_build() instead of build()

6 years agoUpdate: improvements to the basic helper programs
Kevin Day [Wed, 7 Feb 2018 00:44:37 +0000 (18:44 -0600)]
Update: improvements to the basic helper programs

Improve documentation a little.
Improve init scripts.
Add basic systemv support.

6 years agoBugfix: typo in error variable name
Kevin Day [Tue, 6 Feb 2018 04:28:33 +0000 (22:28 -0600)]
Bugfix: typo in error variable name

6 years agoRefactor: improvements on error message presentation
Kevin Day [Tue, 6 Feb 2018 04:24:23 +0000 (22:24 -0600)]
Refactor: improvements on error message presentation

Add global configuration settings for error handling.
Make passing of error messages more consistent.

6 years agoUpdate: provide additional controls over htmlentities() encoding during markup processing
Kevin Day [Tue, 6 Feb 2018 04:15:17 +0000 (22:15 -0600)]
Update: provide additional controls over htmlentities() encoding during markup processing

6 years agoUpdate: handle 'password authentication failed for user' postgresql error as an acces...
Kevin Day [Sat, 3 Feb 2018 22:12:36 +0000 (16:12 -0600)]
Update: handle 'password authentication failed for user' postgresql error as an access denied login error

6 years agoCleanup: previous commit forgot to unset error message
Kevin Day [Sat, 3 Feb 2018 22:10:17 +0000 (16:10 -0600)]
Cleanup: previous commit forgot to unset error message

6 years agoUpdate: 'handle peer authentication failed for user' postgresql as an access denied...
Kevin Day [Sat, 3 Feb 2018 22:06:06 +0000 (16:06 -0600)]
Update: 'handle peer authentication failed for user' postgresql as an access denied login error

6 years agoFeature: add 'database_user_public_default' option to not use public/anonymous accoun...
Kevin Day [Sat, 3 Feb 2018 21:38:59 +0000 (15:38 -0600)]
Feature: add 'database_user_public_default' option to not use public/anonymous account access to the database

This allows for database-less connections by default.
Some sites may use this, but the primary design of the project focuses on public/anonymous database access.
More work may be necessary.

6 years agoUpdate: partial improvements to error presentation, including passing error_message...
Kevin Day [Sat, 3 Feb 2018 21:09:47 +0000 (15:09 -0600)]
Update: partial improvements to error presentation, including passing error_message to now reserved ':{error_message}' replacement parameter

Process and pass the error message to the string.
It seems that this was not happening.

There are a few other issues:
- arrays were being passed, increasing complexity (unnecessarily).
- use preg_match() instead of direct string comparisons on postgresql error messages to be consistent.
- ':{failure_reasons} array is no longer neded with this change.

While reviewing and making these changes, I noticed that the entire error message process is a bit inconsistent.
I suspect that I had changed how I was processing errors along the process.
More work needs to be done, but that is being put off to later.

6 years agoUpdate: specifically handle known database errors for public account
Kevin Day [Sat, 3 Feb 2018 21:00:52 +0000 (15:00 -0600)]
Update: specifically handle known database errors for public account

This may be useful for diagnosing a mis-configured public account.
Generally, public account access (aka: anonymous) does not use a password.

6 years agoBugfix: inconsistency in c_base_error's s_false() and s_true() NULL value handling
Kevin Day [Sat, 3 Feb 2018 18:39:13 +0000 (12:39 -0600)]
Bugfix: inconsistency in c_base_error's s_false() and s_true() NULL value handling

The comments designate that when NULL is specified, no error should be assigned.
The previous behavior was instead creating a new, empty error.

The error classes also seem to accept NULL values, which will create an empty error array (clearing existing values).
By passing NULL instead of creating an error object makes the behavior consistent with other code.

6 years agoUpdate: provide a temporary/quick-fix solution for displaying an array of error details
Kevin Day [Sat, 3 Feb 2018 06:30:01 +0000 (00:30 -0600)]
Update: provide a temporary/quick-fix solution for displaying an array of error details

6 years agoUpdate: display error messages on server error page
Kevin Day [Sat, 3 Feb 2018 06:13:06 +0000 (00:13 -0600)]
Update: display error messages on server error page

6 years agoBugfix: error message for current user is using incorrect/non-existent variable
Kevin Day [Sat, 3 Feb 2018 06:12:49 +0000 (00:12 -0600)]
Bugfix: error message for current user is using incorrect/non-existent variable

6 years agoUpdate: add list item markup generation support to standard path handlers
Kevin Day [Sat, 3 Feb 2018 06:05:19 +0000 (00:05 -0600)]
Update: add list item markup generation support to standard path handlers

6 years agoBugfix: regular expression parsing logic for error message translation is incorrect
Kevin Day [Sat, 3 Feb 2018 05:56:06 +0000 (23:56 -0600)]
Bugfix: regular expression parsing logic for error message translation is incorrect

preg_replace() may return a non-string, so validate its value before replacing.
- if something goes wrong, then keep original string.

With the use of arguments that begin with ':{' and end with '}', the '/b' command is preventing the regular expressions from working.

If the detail value is not a string, instread provide an empty string for replacement.

6 years agoUpdate: implement account not available or access not available in database
Kevin Day [Sat, 3 Feb 2018 03:56:14 +0000 (21:56 -0600)]
Update: implement account not available or access not available in database

When the account is not in the database or the account has insufficient privileges to access the database, an error needs to be reported.
A new error category is created to handle this with a separate message.

6 years agoBugfix: set_error() must accept an array of errors
Kevin Day [Sat, 3 Feb 2018 03:51:46 +0000 (21:51 -0600)]
Bugfix: set_error() must accept an array of errors

This is considered a bug because the current design of get_error() returns an array if errors.
Prior to this, calling set_error($some_class->get_error()) would result in no error being reported because the array value gets ignored.

With this change, the entire array contents are appended, only if the given array value is a valid error class instance.

6 years agoUpdate: standard path output format test should be available at the standard path...
Kevin Day [Sat, 3 Feb 2018 02:21:49 +0000 (20:21 -0600)]
Update: standard path output format test should be available at the standard path level

The output format is not specific to the user-level pages.
The output format check should be a standard page-level check.

6 years agoBugfix: a few unhandled or improperly error cases
Kevin Day [Sat, 3 Feb 2018 01:51:57 +0000 (19:51 -0600)]
Bugfix: a few unhandled or improperly error cases

6 years agoSecurity: make sure socket file and directory has configurable permissions
Kevin Day [Fri, 2 Feb 2018 00:00:57 +0000 (18:00 -0600)]
Security: make sure socket file and directory has configurable permissions

6 years agoUpdate: add necessary defines to fix problems with ldap deprecation and <sched.h...
Kevin Day [Wed, 31 Jan 2018 04:36:04 +0000 (22:36 -0600)]
Update: add necessary defines to fix problems with ldap deprecation and <sched.h> include issues

On some systems, including <sched.h> does not result in all of tbe necessary defines being enabled without additional defines.
Newer versions of ldap deprecatd and removed currently used functions.

6 years agoProgress: organize some files and some additional markup generation
Kevin Day [Tue, 31 Oct 2017 21:22:21 +0000 (16:22 -0500)]
Progress: organize some files and some additional markup generation

Move some of the user login code to the parent class.
- I can see reason for moving it to the parent's parent class, but I decided to hold off for now until I implement more classes.

Added additional markup generation classes.
- Some other constants where expanded from their HTML names to be more verbose.

6 years agoCleanup: use [] syntax for creating arrays instead of array() syntax
Kevin Day [Wed, 27 Sep 2017 02:38:08 +0000 (21:38 -0500)]
Cleanup: use [] syntax for creating arrays instead of array() syntax

This is now well supported by PHP and simplifies code, slightly.
I tested the code with PHP lint, so there should be no regressions.

6 years agoUpdate: Use PHP namespaces
Kevin Day [Fri, 22 Sep 2017 01:21:33 +0000 (20:21 -0500)]
Update: Use PHP namespaces

This enables the use of PHP namespaces.
The namespaces must be prefixed with 'n_'.
The parent namespace for koopa is 'n_koopa'.

I intend to only use a single depth namespace of n_koopa to keep it simple.
All other names remain unchanged.

This introduces a few problems/caveats:
1) Functions being stored as strings to be called dynamically now need to have '/n_koopa/' in front of them.
2) The standard index file in implementing projects, such as reservations, must still use namespace 'n_koopa' even if their project is different.
- This is because the base classes will call the c_base_defaults_global class.
- All other implementing project files can have their own namespace.
3) Core PHP classes very likely need to have '\' prefixed to them (will update as I encounter them).

This introduced new resolutions:
1) Using namespaces revealed a bug in my code where a class function get_roles() is called on an object that may potentially be a c_base_return_false object.
- I have to review the code and confirm whether or not the code should always be returning the appropriate class or allow other returns.
- For now, I am just adding a quick instance check.

6 years agoProgress: url paths
Kevin Day [Tue, 5 Sep 2017 03:37:24 +0000 (22:37 -0500)]
Progress: url paths

In particular, begin initial work on output formats other than HTML.
- This is initial work and is subject to change (currently a brainstorm).

Add more common paths and appropriate files and classes.
- Most of these classes are stubs and will be populated eventually.

Cleanup the c_base_html class.

Move pr_process_arguments() to c_standard_path where it resides alongside the $arguments class variable.

Be more verbose with the function name pr_paths_create() (now called pr_paths_create_always()).

Add additional columns to the file database table.

6 years agoProgress: User Profile / User View Page
Kevin Day [Mon, 4 Sep 2017 11:17:22 +0000 (06:17 -0500)]
Progress: User Profile / User View Page

The profile images should be file ids and not byteas.
- These columns should also be foreign keys to the file table.

Enable use of profile image in the user object.

Update/Fix the Japanese related translations.

The User Profile / User View page is intended to be a simpler version of the User Settings page with a focus on user information and less focus on user settings values.

6 years agoProgress: user page settings
Kevin Day [Mon, 4 Sep 2017 03:57:35 +0000 (22:57 -0500)]
Progress: user page settings

Fix a logic flaw in the regular expression handling of wildcard paths.
- paths with multiple '/%' where not being properly stripped and such paths (like 'u/view/%/%' where being incorrectly stripped into 'u/view%').
- This resulted in incorrect 'path not found' issues.

Move repeated user content into the core path, adding new class variables as necessary.

Make the default behavior in 'c_standard_path' to include $output_format as well as $arguments.
- $output_format represents the requested output format, the standard being 'html'.
  - mime type integers are used, but strings are supported for non-mimetype presentations, such as 'print' for printer-friendly html.
  - This will allow for every single path to potentially be presented in other formats.
  - The most common formats being 'html', 'print', and 'pdf'.
  - More advanced usage can be used via 'json', which is essentially for AJAX.
  - Because all content may be represented in 'json', it also makes it possible for 3rd-party clients to render a complete page following a standard format without having to parse HTML.
    - This allows for incredibly advanced functionality which can be later utilized by custom clients such as phone-apps that wish to present the data to the user.
    - Furthermore, more advanced accessibility (in the context of ADA) can be used so that HTML does not need to be parsed and more content-specific material may be used with less overhead.
      - This includes allowing for a client, such as a screen-reader, to make explicit content requests.
      - I may, in the near future, implement a raspberry pi screen reader that utilizes this as a proof of concept.
- $arguments represents the processed arguments.

6 years agoProgress: work on user pages
Kevin Day [Sun, 3 Sep 2017 03:38:27 +0000 (22:38 -0500)]
Progress: work on user pages

This makes the PATH_SELF constant for c_standard_path public.
Add new user session handling class.
Add a generic user-specific version of the c_standard_path and have most user path classes extend it.
Populate a basic version of the content menu for user paths.
User paths should accept user ids, handle the arguments.
The print, pdf, and ps paths are also in the url arguments as well as in a separate class path (I need to review the possibilities and pick only 1 method).
Just about all of the user paths, in their current form, are stubs and need to be implemented.

6 years agoUpdate: use late static binding for class constants
Kevin Day [Thu, 31 Aug 2017 23:07:34 +0000 (18:07 -0500)]
Update: use late static binding for class constants

This is done to encourage the use of classes that extend a parent class that only need to change a single constant.
This is done by replacing self:: with static:: for class constants.

see: http://php.net/manual/en/language.oop5.late-static-bindings.php

6 years agoProgress: continued work on user settings
Kevin Day [Thu, 31 Aug 2017 21:16:44 +0000 (16:16 -0500)]
Progress: continued work on user settings

Remove meaningless trailing semicolon.
Organize user page handler constants in alphabetic order.
Add missing user page handler constants, classes, and files.
Use static:: in place of self:: (more to come on why in a follow up commit).
Move the user_view.php contents into user_settings.php and have the user_view class extend the user_settings class.

6 years agoCleanup: restructure user dashboard, login, and logout links to be more consistent...
Kevin Day [Thu, 31 Aug 2017 07:59:10 +0000 (02:59 -0500)]
Cleanup: restructure user dashboard, login, and logout links to be more consistent with the 'user_*' naming

Having all the dashboards called just 'dashboard' is convenient in the general sense, but is more inconsistent when I have a notable amount of 'user_*' names.
Be consistent with the 'user_*' names and have the login, logout, and (user) dashboard files renamed to user_login, user_logout, and user_dashboard.

The other users of 'dashboard' will be updated as needed and as I get to them.

6 years agoCleanup: add missing class object comments for user path classes
Kevin Day [Thu, 31 Aug 2017 07:38:03 +0000 (02:38 -0500)]
Cleanup: add missing class object comments for user path classes

6 years agoBugfix: preserve current login path instead of always redirecting to /u/dashboard
Kevin Day [Thu, 31 Aug 2017 07:19:37 +0000 (02:19 -0500)]
Bugfix: preserve current login path instead of always redirecting to /u/dashboard

If at a given path, such as '/u/view', on login, the default behavior should be to login at that location instead of redirecting to the dashboard.
Add missing include file.
Use c_standard_paths::URI_DASHBOARD_USER instead of the string '/u/dashboard'.

6 years agoProgress: continue working on user view and related
Kevin Day [Wed, 26 Jul 2017 22:13:09 +0000 (17:13 -0500)]
Progress: continue working on user view and related

Add missing functions to relevant tag generation functions.
Add additional text and translations.
Add user access history.
Error handling in user view generation is incomplete.

6 years agoSecurity: sanitize all markup 'text' as plain text before output
Kevin Day [Wed, 26 Jul 2017 22:12:35 +0000 (17:12 -0500)]
Security: sanitize all markup 'text' as plain text before output

6 years agoProgress: continued work on user and login, also miscellaneous fixes
Kevin Day [Wed, 26 Jul 2017 17:24:58 +0000 (12:24 -0500)]
Progress: continued work on user and login, also miscellaneous fixes

Be sure to write to the connection log only after the session information has been loaded so that a valid session expires value is used.
The public user log table needs to have database-specific role and not standard role for insert access checks.
Process the database password failure string on login.
The table caption and caption tag code was not fully completed.
Style cleanups.

6 years agoProgress: add table markup, populate user history information, fix time-related issue...
Kevin Day [Wed, 26 Jul 2017 02:17:47 +0000 (21:17 -0500)]
Progress: add table markup, populate user history information, fix time-related issues, and other fixes

Add basic support for generating table markup.
- This might be extra unnecessary code, but then again it allows for the functions to be extended so that <table> could potentially be replaced with <div>.
- Some of the markup tags are being renamed to improve readability.

Build a basic history information using the table markup.
- This is initially created as an example/concept and I intend to come back and finish it in the future.

Functions like s_get_date() should render localtime from a UTC timestamp, instead of UTC time from a UTC timestamp.

6 years agoCleanup: rename and relocate request path statistics database table
Kevin Day [Tue, 25 Jul 2017 21:30:32 +0000 (16:30 -0500)]
Cleanup: rename and relocate request path statistics database table

The context of the statistics is misleading, so rename the database and all related content to have HTTP in the name.
Move the code into the standard statistics sql file.

6 years agoProgress: continue to develop logging and fix other issues
Kevin Day [Tue, 25 Jul 2017 19:14:15 +0000 (14:14 -0500)]
Progress: continue to develop logging and fix other issues

Corrected typo in c_base_return_arrray (removing the extra 'r').

Add get_request_headers() function to c_base_http.

Fix problems in return value of c_base_http::get_request_uri_relative().

Add get_request_uri_query() function to c_base_http.

Incorrect constant name used in p_load_request_accept_datetime().

Add function pr_do_log_user_activity() to c_standard_index to log access logs and responses to the database.

6 years agoBugfix: problems with cookies and related functions
Kevin Day [Tue, 25 Jul 2017 18:11:06 +0000 (13:11 -0500)]
Bugfix: problems with cookies and related functions

The get_max_age() and get_expires() functions should support returning NULL.
The set_expires() function parameter tests are incorrect.

Try to return 0 for max age and expires.
- My documentation states that if both expires and max age are 0, then a session cookie is used.
- Therefore, avoid that until I have to double check the standards and my code.

I missed a few underscore to dash conversions in the HTTP header processing code.

Added a 'response_encoding' parameter so that I could quickly test and confirm if the encoding is causing any problems.

6 years agoBugfix: The global s_get_timestamp() function is returning current time instead of...
Kevin Day [Thu, 13 Jul 2017 03:04:23 +0000 (22:04 -0500)]
Bugfix: The global s_get_timestamp() function is returning current time instead of requested time

It looks like I copied the s_get_date() function and forgot to properly updated it (or got confused and forgot what I was working on).
Either way, the implementation is incorrect and does not produce the correct timestamp.

The function is rewritten to only support a time string to be formatted into a unix timestamp float.

The base_defaults_global implementation is also not consistent with the one in reservation_defaults_global.
The base_defaults_global is intended to be a default example implementation where reservation_defaults_global is an implementation specific to the reservation system.

The postgresql default datetime string format is provided as a global constant in the database class for consistency.

6 years agoUpdate: Do not force '-' into '_' in HTTP Header names, handle extra names, update...
Kevin Day [Thu, 13 Jul 2017 02:07:38 +0000 (21:07 -0500)]
Update: Do not force '-' into '_' in HTTP Header names, handle extra names, update comments

Apache may provide header names with '_' in place of '-', causing problems.
The standard allows for '_' and as such '_' and '-' should be mutually exclusive.

My previous behavior is to force all '-' to '_', but I believe this to be bad practice as a default behavior.
I may come back and either provide commented out code, apache-specific tests, or an example patch to apache source code.
Each approach has its problems and advantages.
I will address that issue at a later time.

Handle additional known PHP-provided HTTP headers when getallheaders() is unavailable.

Update the comments in the header processing function.

6 years agoUpdate: provide breadcrumbs at current path and plan on having login-specific path...
Kevin Day [Thu, 15 Jun 2017 05:08:11 +0000 (00:08 -0500)]
Update: provide breadcrumbs at current path and plan on having login-specific path handling

This provides breadcrumbs 'at feet' instead of 'behind feet'.
The idea is that the breadcrumbs will show the current path as well as the path history (based on site structure, not browser/navigation history).

Plan on having the login handler provide (and possibly conditionally so) the path of the current page instead of the login page.
The login handler will show up on different pages than just 'u/login'.
Those pages should display their breadcrumb path instead of the login path (unless otherwise hidden).
One possible method is to pass the parent handler's path to the child path.

6 years agoProgress: work on view pages, numerous bugfixes and cleanups
Kevin Day [Thu, 15 Jun 2017 03:44:50 +0000 (22:44 -0500)]
Progress: work on view pages, numerous bugfixes and cleanups

6 years agoUpdate: remove currently unused or incorrect sql data
Kevin Day [Wed, 31 May 2017 03:46:41 +0000 (22:46 -0500)]
Update: remove currently unused or incorrect sql data

6 years agoProgress: rolling out the roler, the "can manage roles" role
Kevin Day [Sat, 27 May 2017 02:40:52 +0000 (21:40 -0500)]
Progress: rolling out the roler, the "can manage roles" role

Using "can manage roles" was inconsistent with how I use the "is_X" role behavior but it is also similar enough that I feel that it should be an "is_X".
To try to make it consistent, I decided to invent a new word that fits the behavior: roler (Not to be confused with roller).

Just like how I abused the word "administrator" as "administer", I am abusing the words "role manager" as "roler".

6 years agoProgress: further work on user view page, documentation changes, more global constant...
Kevin Day [Sat, 27 May 2017 02:05:41 +0000 (21:05 -0500)]
Progress: further work on user view page, documentation changes, more global constants, try to get more consistent return types

One of the downsides of my design is the complex return type handling.
The code because easier when tests do not have to be performed.

I want to provide a way to return a class as a default but provide a way to say that there was no value stored.
Instead of returning the NULL return type class, return the preferred class with an error flag set to "not defined".

This simplifies the code, especially some of the code used on the user view page.

6 years agoProgress: work on user administration pages
Kevin Day [Fri, 26 May 2017 04:02:25 +0000 (23:02 -0500)]
Progress: work on user administration pages

6 years agoBugfix: add missing column 'can_manage_roles' in public.v_users_self
Kevin Day [Tue, 23 May 2017 02:15:10 +0000 (21:15 -0500)]
Bugfix: add missing column 'can_manage_roles' in public.v_users_self

I originally intended to only provide the necessary columns.
However, in an attempt to simplify the PHP end of this, I decided to add NULL columns for such cases.
When I did this, I overlooked the 'can_manage_roles' column.

Looking at this, I might also be better of setting the values to FALSE instead of null::bool where is can be easily determined to be FALSE.

6 years agoProgress: finish implementing basic breadcrumb functionality, add initial user settin...
Kevin Day [Tue, 23 May 2017 02:12:34 +0000 (21:12 -0500)]
Progress: finish implementing basic breadcrumb functionality, add initial user settings pages

I ended up creating a new class called c_base_array when implementing the breadcrumb functionality.
I plan to eventually convert all related/similar types into this class.

User setting pages have some initial work completed.

6 years agoBugfix: mistakes in path parameters and return values, also add a return value to...
Kevin Day [Tue, 16 May 2017 04:48:51 +0000 (23:48 -0500)]
Bugfix: mistakes in path parameters and return values, also add a return value to breadcrumb processing function

7 years agoProgress: work on breadcrumbs and related
Kevin Day [Fri, 12 May 2017 21:13:01 +0000 (16:13 -0500)]
Progress: work on breadcrumbs and related

7 years agoProgress: path, breadcrumbs, and menus
Kevin Day [Wed, 10 May 2017 15:57:13 +0000 (10:57 -0500)]
Progress: path, breadcrumbs, and menus

Continuing work on paths, now starting to add support for breadcrumbs and menus.

7 years agoCleanup: add documentation about loops and this projects design practices regarding...
Kevin Day [Thu, 4 May 2017 19:38:35 +0000 (14:38 -0500)]
Cleanup: add documentation about loops and this projects design practices regarding them

7 years agoProgress: minor cleanups and bugfixes, prepare management and administration dashboards
Kevin Day [Thu, 4 May 2017 04:24:15 +0000 (23:24 -0500)]
Progress: minor cleanups and bugfixes, prepare management and administration dashboards