Commit Graph
100 Commits
Author SHA1 Message Date
Clemens Schwaighofer 754c2edbd2 Add three new methods to the Basic class
- fceil: hack for float numbers that not properly round up
- floorp: roundown(number, precision): eg 48756, -2 => 48700
- initNumeric: set variable to 0 if not numeric
2018-12-19 11:17:20 +09:00
Clemens Schwaighofer 98e16e6143 Some minor updates for test files 2018-12-14 13:07:10 +09:00
Clemens Schwaighofer 005584e2ed Remove old .htaccess php xdebug, test updates, fixes in admin header
- remove all old php_value settings as they wont work with php-fpm
- test check for removeLB
- fix URL for Error handling include in admin header
2018-11-30 11:37:50 +09:00
Clemens Schwaighofer 7e34c5321d Fix libs Login, Basic and DB
- Login ads auto return error for AJAX based calls (so the script
doesn't loop hang)
- Basic gets remove line break call
- DB gets minor updates with arrays set and fixes in old internal method calls
2018-11-28 15:28:27 +09:00
Clemens Schwaighofer 9d918f3b43 Fix admin edit_access wrong enabled type, other fixes
General notice fixes as much as possible
2018-11-07 13:32:58 +09:00
Clemens Schwaighofer 433b21ab6f Fix default edit_* tables and triggers 2018-10-19 10:17:41 +09:00
Clemens Schwaighofer 826b5fdfd6 Move master config to configs folder and create symlink 2018-10-15 09:54:08 +09:00
Clemens Schwaighofer a923f07fc7 Install basic composer.phar file 2018-10-12 11:02:45 +09:00
Clemens Schwaighofer 736415e939 Master update of include files
First step to clean up all files that are not mandatory for outside
access
* move all header/footer/smarty/set_paths/config files (inc) into
includes/ folder
* generate basic config.php that JUST loads the config.inc file (search)
* config.inc file has sub sections for db access arrays and host
configs, so config.inc is more static
* Also move edit base and template arrays to the include folder
* move the language po files to the 4dev folder as they do not need to
sit outside
* remove not maintained "files.php"

TODO:
split out templates and language files into external layout group
perhaps drop the whole sub template include path thing as this is
actually never really used and more annoying to maintain

eg: layout/frontend/default/ -> layout/frontend
eg: layout/fronend/default/template -> includes/frontend/template

Also check splitting out the NOT define parts of the config.inc file
G_TITLE, EDIT_STYLESHEET, EDIT_JAVASCRIPT, STYLESHEET, JAVASCRIPT
to default define?
2018-10-12 10:42:26 +09:00
Clemens Schwaighofer 2e8712d935 Update set paths bug, Update core JS, fix basic class bug
SITE LANG settings had double ;;

Updated the edit.js core JS parts

Fixed bug in date compare with wrong variable name
2018-10-11 09:51:17 +09:00
Clemens Schwaighofer c6a15506c5 Fixes for DB IO, DB general functions, JS core updates
DB IO
- Update/Select/Insert checks are sane now and not reverse
- UPDATE can now use RETURNING
- meta table check in postgresql is supressing warning for not existing
table and just returns false

JS (edit)
- update for the html element creation functions

Basic:
- SITE LANG settings added to change default lang based on vhost
- log file id is now set more lienient via globals and not with a global
constant

DB Tables/Functions:
- fix wrong general function and set uid function was missing
2018-09-27 17:06:32 +09:00
Clemens Schwaighofer b2f5d439d5 Set paths update for correct check for classes + lang reload 2018-08-31 14:05:18 +09:00
Clemens Schwaighofer 071395bfe5 fix for basic edit_* tables data insert 2018-08-03 17:37:00 +09:00
Clemens Schwaighofer 03ff1862c1 Various QQ File uploaders updates 2018-07-26 14:58:44 +09:00
Clemens Schwaighofer 71ab3e27bd Update Prototype to 1.7.3.0, core class array flatten, js update
- Prototype updated to 1.7.3 from 1.7.2
- Basic class has a array flatten with keys as flatten part (keys become
values)
- js update with aelx method
2018-07-20 16:48:25 +09:00
Clemens Schwaighofer a190148125 AJAX file upload tests update 2018-07-18 18:59:14 +09:00
Clemens Schwaighofer fa5350baa2 Basic file uploader with AJAX flow
Button based, old style.
2018-07-17 17:27:01 +09:00
Clemens Schwaighofer 4d70f8a017 Allow with as start in queries for select type 2018-07-12 18:36:43 +09:00
Clemens Schwaighofer d5476b4269 Add edit tables data inserts 2018-07-04 18:58:56 +09:00
Clemens Schwaighofer bddc196e25 Login password min length, boolean default set if empty
Also remove all inserts from the table declaration and add them in a
separate file instead

Add add/remove css to element for the element js declarations
2018-07-04 18:58:07 +09:00
Clemens Schwaighofer e3d1679f86 Update DOM prep JS and add html options wrapper function 2018-06-22 18:34:29 +09:00
Clemens Schwaighofer 34f33772d0 Add database internal edit_* tables CUID, CSS loading style
all edit_* have CUID random alphanumeric unique id with 12 characters
length.
automatically created on INSERT and not touched on update.
but can be udpated manually on UPDATE command.
on INSERT cuid is ALWAYS overwritten with auto create

Add CSS loading style sheet
2018-06-22 18:31:02 +09:00
Clemens Schwaighofer bfe3fdcff4 Enabled & protected add for edit access and protected add to user
Protected flag can be set now for user/access
Enabled flag can be set now for access (but currently not used)
2018-06-15 13:57:19 +09:00
Clemens Schwaighofer 1feb7bf574 Update edit access and edit user
edit access gets enabled + protected flag + updates for edit
edit user table array part gets documentation update
2018-06-15 13:48:48 +09:00
Clemens Schwaighofer 272a5ad202 Login class updates
- fix DB schema edit access with missing uid varchar column
- fix login class " to ' in some parts
- set basic prep area check for password forgot (not password change)
- ACL is only set if permission_okay, just in case some previous checks
skip
- ACL method is private, this should never be called from outside
- update some inline documentation
2018-06-12 18:59:08 +09:00
Clemens Schwaighofer 8a86145307 All DB columns are set to varchar, PHP 7.2 compatible fixes
All DB columns that had a varchar(number) are changed to varchar.
The edit_language default unique grouping has been removed because this
does not work (you cannot have unique on this when it is 1/0 flag only)

Update Output\Form\Generate and edit_base to be PHP 7.2 compatible with
removing all old while (list() ... each()) entries. Fix all undefined
counts, etc.

Login class update is long line wraps and clean up of some nested
teniary parts
2018-06-12 15:32:22 +09:00
Clemens Schwaighofer 1afc0eb982 README update 2018-06-08 16:58:07 +09:00
Clemens Schwaighofer a7e7539911 config updates 2018-06-08 16:48:42 +09:00
Clemens Schwaighofer 6e3f017960 Config file updates 2018-06-08 16:46:25 +09:00
Clemens Schwaighofer 80715e5ef1 base config.inc update 2018-06-08 16:41:35 +09:00
Clemens Schwaighofer 0408483aa8 Add array flatten method
A multi dimensional array can be flattened into a single array
2018-06-06 18:58:09 +09:00
Clemens Schwaighofer 02d1d03c15 Fix long lines, fix timestamp method, fix db error to warning
DB IO: On multiple PK return it say DB_ERROR, but this is actually a
warning DB_WARNING
Login: fix long lines and make SCHEMA set better with if instead of
terinary
Basic: fix string to time with loop over array parts and not for loop
2018-06-04 18:53:28 +09:00
Clemens Schwaighofer 765297d2a2 Update config template files 2018-05-24 17:57:17 +09:00
Clemens Schwaighofer 382cc0524a file upload page updates, config updates
Update the files upload page with missing unlinks for certain actions
and ACL settings

Add LIVE_SCHEMA to config & var set check
2018-05-24 15:08:18 +09:00
Clemens Schwaighofer aa57c6218f various fixes for PHP 7.2 compatible 2018-05-16 13:42:31 +09:00
Clemens Schwaighofer b3f9fd27e6 Update for <? in the table_array list, fix binaries folder name 2018-05-14 15:37:05 +09:00
Clemens Schwaighofer 4e6463a849 Password check & change update
The password check flow is now dedicated method.

The password change has been updated to check for a valid password
before accepting it (default is only min 8 chars).
Success message is printed out.
On error the overlay stays visible.
Old password correct check uses normal password check method now.
No passwords in any form are logged for error or printed anywhere at
all.
2018-05-09 15:12:13 +09:00
Clemens Schwaighofer 5ad0419613 Login class rehash part: do not use variable
Write the new hash directly to the DB, we don't need to store it in
variable
2018-05-09 11:55:12 +09:00
Clemens Schwaighofer e23389a7f8 Fix password re-hash in login with correct methods
Don't call the PHP functions directly, but use the internal wrapper
methods for password rehash check and set in Login class
2018-05-09 11:47:32 +09:00
Clemens Schwaighofer c21e194eaf Add proper PHP password management
The old crypt based password methods are all deprecated and the new
password_* are now standard.

Also added auto rehash for old password on login
2018-05-09 11:34:40 +09:00
Clemens Schwaighofer 41b1f14594 Name change 2018-04-25 14:51:59 +09:00
Clemens Schwaighofer 62eb2d61b0 README update 2018-04-24 10:25:16 +09:00
Clemens Schwaighofer 7abdc96499 Fix the Error.Handling.inc method 2018-04-24 10:23:34 +09:00
Clemens Schwaighofer 5a6c7ec187 Merge namespace development into master 2018-04-24 10:14:09 +09:00
Clemens Schwaighofer 0f483a2d20 description for session/log id define, better error check for no pk id
PK ID return check if not set is checked correctly in normal execute
The SET_SESSION_NAME and LOG_FILE_ID get commented out in settings as
they should be rather set per file or in header
2018-04-24 10:04:51 +09:00
Clemens Schwaighofer 3400902241 Folder directory seperators fix
Remove all not needed directory seperators and replace others with "DS"
variable
2018-04-17 10:00:01 +09:00
Clemens Schwaighofer f51b74d8b5 Set Smarty compile and cache folder to non document root
The smarty template_c and cache folder are now set on BASE folder and
not in the folder where the script is
2018-04-03 17:41:02 +09:00
Clemens Schwaighofer bf5486a59e Switch php code tag, fix php code
all files use <?php for code tag open
fix various bugs & speed problems. eg switch from while (each ...) to
foreach, ...
2018-04-03 16:39:57 +09:00
Clemens Schwaighofer 8a6a83ef06 smarty update info 2018-03-30 14:43:53 +09:00
Clemens Schwaighofer 2051d17901 Bug fix for log file with class and missing wrapper function in DB\IO
When the class name was in a namespace the \ was added into the file
name that might cause some issues. \ is replaced with -

The wrapper for db_exec was missing in the DB\IO class
2018-03-29 16:15:33 +09:00
Clemens Schwaighofer 477aae6232 Minor updates for comments 2018-03-29 13:26:17 +09:00
Clemens Schwaighofer cb0ed2b6c0 Rename old deprecated method calls 2018-03-28 16:55:31 +09:00
Clemens Schwaighofer 484444b97a tmp folder in 4dev 2018-03-28 14:31:14 +09:00
Clemens Schwaighofer 0b1c0da131 Various updates and fixes for namespace change 2018-03-28 14:30:14 +09:00
Clemens Schwaighofer 8151c05d91 Class namespace change testing
- move auto loader to lib/ folder (so it doesn't exist in document root)
- Fix a lot of old method names in DB\IO and Form\General, etc
- Fix login with non existing DB set (abort -> exit)
- add getDbEncoding call to DB\IO
2018-03-27 18:01:10 +09:00
Clemens Schwaighofer 5c3b45ef08 Class Version ID update 2018-03-23 19:14:04 +09:00
Clemens Schwaighofer 9086196f7d Base transfer to namespace complete
All libraries have been transformed to namespace layout
2018-03-23 19:10:58 +09:00
Clemens Schwaighofer 5474ae2dda Namespace changes initial setup
* move all the libs into the correct folders
* libs folder is now called lib
* Smarty update to 3.1.30
* main config update with / is now set via core variable (dynamic)
2018-03-23 13:43:22 +09:00
Clemens Schwaighofer 31acfd1ee4 Update to Smarty 3.1.30
Keep old 3.1.27 around for testing
2018-03-22 10:22:37 +09:00
Clemens Schwaighofer f1155ad824 Rename wrong named (extension) translation files 2018-03-20 17:09:42 +09:00
Clemens Schwaighofer eef3a81be7 Minor update for DB psql class include 2018-03-20 14:10:06 +09:00
Clemens Schwaighofer bf60e9fcbf Readme update 2018-03-20 14:05:37 +09:00
Clemens Schwaighofer 5226fbcfc3 error reporting test 2018-03-14 15:36:42 +09:00
Clemens Schwaighofer 87b9af9786 PHP Notice warning fixes 2018-03-13 18:37:04 +09:00
Clemens Schwaighofer 7981e3ab51 Fix Class DB not init for dbh check on close db handler 2018-03-13 13:42:25 +09:00
Clemens Schwaighofer 21b9b99197 Minor white space clean up in login class and DB Array IO 2018-02-19 10:44:25 +09:00
Clemens Schwaighofer d9df0d64b8 Class DB IO, fix for trailing ; with RETURNING
If an INSERT query has no RETURNING but ; at the end, the RETURNING was
added after the ;

The ; is now stripped before adding RETURNING
2018-02-08 10:58:53 +09:00
Clemens Schwaighofer 73cdbe27c0 Fix JavaScript SetCenter 2018-02-08 10:45:48 +09:00
Clemens Schwaighofer 57b1aae9b4 Remove Smarty 3.1.21 folder 2017-12-07 14:23:49 +09:00
Clemens Schwaighofer 717962edc5 Bug fix for session name set in basic class, add info methods for l10n
The session name was never set correctly because it was not checked for
the define var, but for a normal variable in the basic session name
settings flow

The l10n class has two new return methods for lang and mofile to check
if the correct ones are set
2017-11-28 12:01:15 +09:00
Clemens Schwaighofer dc692f14e4 white space fixes 2017-11-24 16:49:45 +09:00
Clemens Schwaighofer 7a8fdcdf07 white space fixes for Form class 2017-11-24 13:22:20 +09:00
Clemens Schwaighofer a06320c42b white space fixes for Class DB IO 2017-11-24 13:20:28 +09:00
Clemens Schwaighofer f0ba8c3c50 email regex check update, remove warning surpress in pgsql wrapper, l10n
- l10n class has better mo file load check
- fix email regex for last part is now only on minimum 2 char check
- remove all @ warning surpress in the pgsql wrapper
2017-11-24 13:06:14 +09:00
Clemens Schwaighofer 2e85bf5ee8 Bug fix in DB IO for wrong db debug check
Some debug print checks were done wrong
2017-11-02 18:42:41 +09:00
Clemens Schwaighofer ff94efee8d Fix in class db io returning on insert
Skip add RETURNING on auto set if 'NULL' is set as a primary key.
On return, also run if count of returned ids is > 0 (so it actually runs
the extended return flow)
2017-11-02 17:04:43 +09:00
Clemens Schwaighofer 93f2cf9b73 DB IO Class: if not PK auto found, set to NULL to skip return
In case no primary key is set and the auto detect does not return a
primary key, set the primary key variable to 'NULL' string to trigger
skip in returning insert id flow.
2017-11-02 16:05:06 +09:00
Clemens Schwaighofer c39e48a709 Bug fix Class DB IO data write function
The data write function did not write data correctly if it was empty or
null. Especially for boolean ones when set 0 was set NULL and not 'f'.

This is fixed now.
Also filles MUST set not null fields with 0/'' but does not add missing
column to list yet
2017-10-24 16:51:21 +09:00
Clemens Schwaighofer 1cc010818d Fix DB IO write array method
Data was not written correctly in connection with boolean field types as
the "has default" was used as if a default value, but it is just a flag
IF it has a default value
2017-09-26 13:33:52 +09:00
Clemens Schwaighofer 1e164f3b93 Delete wrong symlink, remove create_function call
create_function call is deprecated with PHP 7.2, so creat_function is
replaced by the correct anonymous function call for it
2017-09-11 14:28:47 +09:00
Clemens Schwaighofer 9f7ab65a15 Update Basic, DB IO, Login class
- DB IO: update the write data method to update data that is empty (aka
null) and not skip it (aka never unset data)
- Basic: add date time compare method based on strtotime
- Login: ACL for page level check if array is set before setting
anything
2017-09-07 18:24:52 +09:00
Clemens Schwaighofer c69607323a Class DB IO update for db write
on UPDATE check if field is bool and then force write for unfilled (not
set) data
2017-09-04 19:02:20 +09:00
Clemens Schwaighofer 13a7900bd6 fix globals set check 2017-07-28 18:08:17 +09:00
Clemens Schwaighofer dc94fa1cd5 PG class updates, basic class updates
In basic class, do SET_SESSION_NAME check with isset to avoid notice log
entries.

Change log/error return for execute data error

base postgresql calss calls set the last run query on error if no result
is returned for prepare and execute
2017-07-28 15:52:37 +09:00
Clemens Schwaighofer fd191877cd Fix for not showing progress bar with single progress bar 2017-06-05 16:48:19 +09:00
Clemens Schwaighofer 65a5785ce5 Changed progress bar buffer clear
- send initial big buffer clear
- then do just flush/ob_flush
2017-04-13 14:52:07 +09:00
Clemens Schwaighofer adcfaf5fa0 Progress bar class: centralize buffer clear method
Because browsers buffer size increased again I centralized the buffer
clear flow.

It now sends a 1024*256 bytes empty string before it runs an ob_flush
and flush call.

This should work with most browsers out there. Tested on macOS
firefox/safari/chrome
2017-04-13 14:28:43 +09:00
Clemens Schwaighofer f7685463b4 error log ID settings added via global define
A global define for LOG_FILE_ID before any class is initialized (or any
place later allowed too) will add a sub id to the error_msg log file
before any other (level, class, etc) id.

This can be used to easily split between frontend and backend logs or
logs for a certain page without using pagename (eg to group all ajax
logs into one)
2017-04-11 10:25:07 +09:00
Clemens Schwaighofer dd92fa6031 Do not auto return PK for edit log insert in Admin Backend class 2017-04-07 11:07:05 +09:00
Clemens Schwaighofer 6606f30ceb Basic date compare fix
The date compare now uses correct preg_split for splitting with - and /
as date separators
2017-04-03 17:52:49 +09:00
Clemens Schwaighofer e1255e0872 DB IO: prepare pk null fix, split -> explode in Basic
- Basic class still had a "split" call -> change that to explode
- The prepare DB IO part missed setting pk name for the cursor to null
so no returning is assumed
2017-04-03 17:46:06 +09:00
Clemens Schwaighofer 5c53621f96 Update DB IO to skip returning on prepare statements
Same as normal exec if pk name is set to NULL
2017-04-03 17:38:33 +09:00
Clemens Schwaighofer 581518963b Fix bug in prepared statement returning ID
The wrong direct insert id primary key was used, not the statement based
one
2017-04-03 14:58:10 +09:00
Clemens Schwaighofer 23735eba92 add datepickr, update frontend default templates 2017-03-31 15:32:27 +09:00
Clemens Schwaighofer 9eb78f40fd Warning in DB IO if we couldn't get any return PK 2017-03-31 15:28:36 +09:00
Clemens Schwaighofer f599033a38 Bug fixes for unique per run logging 2017-03-17 14:50:58 +09:00
Clemens Schwaighofer 61f1b92bad Make per run log flag in Class Basic 2017-03-17 14:24:48 +09:00
Clemens Schwaighofer 1dfe246e0f Remove print_r on multiple returning data warning 2017-03-15 14:04:25 +09:00
Clemens Schwaighofer d64e40ca2c Second fix for returning with multiple entries in DB IO
- all data stored in array (size contrain needs to be checked)
- allows any returning data
- only named rows are returned (no numbers for column access)
- if multiple rows then insert_id is an array with the return data
- if single row the insert_id holds the PK, and insert_id_ext holds
extended data if exists
2017-03-14 15:19:31 +09:00
Clemens Schwaighofer 6810c030e8 Removed not needed insert_id_r array 2017-03-14 13:35:35 +09:00