Kevin Day [Tue, 2 May 2017 05:08:52 +0000 (00:08 -0500)]
Progress: move code from reservation to standard and other fixes
I've now determined what would be a good basis for using a 'standard' structure.
Standard would be a minimal website used by most of my projects here, but it is not part of the base so that other developers do not have to use it at all.
This allows for more development flexibility while still providing a common default.
Most of the reservation example program code was moved into standard, including sql code.
Kevin Day [Fri, 28 Apr 2017 03:28:43 +0000 (22:28 -0500)]
Progress: more development with paths, additional html processing,
More work with paths.
Add additional data to HTML, restructuring code as necessary.
- Now includes class names by date and path (assigned to <body>).
- Add sanitizer, I used drupal 7's css sanitizer as a reference (just their preg_replace() part).
Functions like get_is_root() is a bit awkward, change the behavior and name to be more suitable.
- get_is_root() and set_is_root() are both now is_root() such that is_root() functions as get_is_root() when no parameters are specified and functions as set_is_root() when parameters are specified.
- this is repeated for all other similar functions.
I decided to separate /a/ paths into two paths:
- /a/ - administrative paths (for advanced and technical administration).
- /m/ - management paths (which is where most of the non-user related website logged in access will be involved in).
Kevin Day [Wed, 26 Apr 2017 13:21:32 +0000 (08:21 -0500)]
Bugfix: internal pages were not processing language after redesign and use fix paths output handling
When I wrote the language handling into the initial setting load function and then changed the output handling to be more dynamic, I forgot to update p_include_path().
Get rid of the loop when deciding the language include file suffix and only use the last entry in the aliases array (generally the shortest).
There were some cases where I was still using $this->html instead of $this->content.
Be more consistent by using $this->output instead of $this->content.
Kevin Day [Wed, 26 Apr 2017 03:25:00 +0000 (22:25 -0500)]
Progress: more path management changes, imrpove languages support, and other fixes
Continue developing path handling functionality.
I've decided to implement language handling as sub-classes, using japanese as the first language to test with.
Other bugfixes and tweaks.
Kevin Day [Wed, 19 Apr 2017 18:53:47 +0000 (13:53 -0500)]
Progress: improve language support when using global data, add headers in some tests programs, and fix language related issues
When I moved languages into the global defaults class, I missed a few chunks of code that needed to be updated.
I noticed that some of the tests were not printing any headers.
Allow for setting content-language with multiple languages, as is the case with one of the tests using japanese and english.
Kevin Day [Wed, 19 Apr 2017 14:52:33 +0000 (09:52 -0500)]
Update: implement and use more global values, simplify http response return values, implement content-range, other changes/fixes
The time functions have been moved into the global default class.
The http language class has been moved into the global default class.
The return values for HTTP response functions have been set to their specific type, instead of always FALSE.
This makes it easier to handle the return value without caring about errors.
Any unsupported functionality continues to return FALSE until such time I read the appropriate part of the standards and implement the functionality.
Content-Range response is now implemented.
I noticed that I have been inconsistently using $ps_ and $s_ for private static class variables.
I removed $ps_ that in favor of $s_ only because it was the simpler change.
I may end up coming back later and changing all private static to $ps_ (or not..).
While making the time values global, I noticed that PHP does not always guarantee microseconds to be populated.
Special handling is necessary and so I created more global static functions to handle this complicated situation.
I've observed and fixed some simple mistakes, bugs, typos, etc...
Kevin Day [Fri, 7 Apr 2017 05:32:59 +0000 (00:32 -0500)]
Progress: work on path handling, other minor changes
I changed my approach half-way through this and will need to come back and clean out a lot of unecessary code.
Some decisions still need to be made on certain aspects.
Kevin Day [Wed, 5 Apr 2017 02:52:23 +0000 (21:52 -0500)]
Update: improve return values used in c_base_utf8 class functions (and related)
I believe I was returning TRUE/FALSE types out of habit and for consistency.
For string processing functions, it makes far more sense to always return a c_base_return_string.
This simplifies the code the caller has to write.
The caller can still identify errors using the c_base_return::s_has_error() function.
The caller need only to call ->get_value_exact() if they do not care whether an error occured.
This will always return a string (and on error, it returns an empty string).
Kevin Day [Sat, 1 Apr 2017 06:05:11 +0000 (01:05 -0500)]
Update: rework access control to be automatic based on is_* roles in the t_users table
Instead of trying to use select queries on every statement based on a users role, have the database automatical grant/revoke roles based on column settings in the s_tables.t_users table.
u_public and r_public have been renamed to be u_reservation_public and r_reservation_public to keep all roles self-contained.
name_machine fields should now only allow word characters.
Kevin Day [Thu, 30 Mar 2017 17:34:35 +0000 (12:34 -0500)]
Progress: improve access control database structure and other changes
Numerous changes, but there has been a huge focus on access control changes.
It occurred to me that if an account was locked or deleted, then they should be denied access to all of the views (with exception of the current user views).
This required a notable structural change.
The tables are now stored in the s_table schema.
In case accounts get locked, even administer accounts, access should be disabled.
I did not get the time to convert all of the administer and manager roles to be restricted to views but will eventually do so.
Kevin Day [Sat, 4 Mar 2017 04:45:15 +0000 (22:45 -0600)]
Progress: continuing development, http headers work
There is still a lot more to go, but this resolves some of the @todo's in the http headers class.
I have noticed that in some cases I called a prepare_token function and the return value has parsed in the name.
- The parsed name is used for parsing functions and generally returns an array.
- Based on the name, I could easily mistake the purpose of the return value for the prepare_token (or similar) functions.
- These prepare functions now use prepared in place of parsed to make reading the code more consistent.
- There are some functions that make this incorrect interpretation and they must be rewritten accordingly.
Kevin Day [Fri, 3 Mar 2017 07:23:53 +0000 (01:23 -0600)]
Progress: continuing development, updated test example, added language testing, miscellaneous fixes
Did some testing and made sure the test example was working.
Added some languages for testing.
- I specifically added japanese as a language to test for error messages because it is so different from english.
- It is not practical to implement the error messages class for many languages right now because I expect major refactoring as I continue coding.
- Another simple language test is added, testing the languages: russian, spanish, japanese, and english.
Kevin Day [Sat, 25 Feb 2017 01:18:28 +0000 (19:18 -0600)]
Progress: continuing development, database work, use c_base_return on more classes, and fix inconsistencies
Further work on building the database structure.
Added some missing roles:
- Requester
- Editor
A number of inconsistencies have been identified and resolved.
After reviewing my use of c_base_cookie as extending the class c_base_return, I have decided that to do that everywhere possible.
This simplifies the return structure that I complicated when I decided to use the c_base_return return type development design.
I noticed that there is still some cookie functionality that I could implement.
This adds support for 'same site' and 'host only'.
These are functionally equivalent except that I think 'same site' is a little more granular.
This also adds one of my test scripts under examples.
It is very likely not completely up to date with the database changes.
Kevin Day [Wed, 22 Feb 2017 04:55:04 +0000 (22:55 -0600)]
Progress: continuing development, more http header support, implemented error reporting
I noticed that there are a lot of incomplete functions in the http class.
This, in particular, implements cookie support.
There is still a lot more incomplete code in the http class.
My initial error reporting work is done.
Expect major refactoring as I continue developing.
After some testing, I have foind the php-xz module to be lacking and defunct.
I also noticed that there are multiple relevant repositories to choose from (added both to documentation).
Kevin Day [Sat, 18 Feb 2017 22:41:18 +0000 (16:41 -0600)]
Progress: continuing development, adding examples and example program: reservation
For the sake of functionality and time, I implemented a straight-forward HTML class.
I will come back later to work on CML that will be an attempt to separate the context from the content, even in the code.
There is a (currently) experimental program called reservation.
This is a reservation/scheduling system that is currently under design and will be used as a functional example for using this site.
It currently requires LDAP and a few other custom/experimental software that is to follow.
The sql code is postgresql-specific.
Other examples are included in the example direction.
There are some theme files that I am probably not going to use and may remove in the future.
Kevin Day [Sat, 17 Dec 2016 20:24:08 +0000 (14:24 -0600)]
Update: initial import, including incomplete work
I wanted to complete all of the common/base work first, but I ended up getting side-tracked.
With the holidays, I realize that I would not finish this in time and I needed to at the very least ensure all of my hard work is not lost.
Much of the base work is complete except for the following:
- HTML and HTML tag related processing.
- Form processing.
I have not decided how I want to design forms and I expect this to be the weakest part of my code design.
How this will end up being developed will directly affect how the HTML processing code is built.