Commit Graph

872 Commits

Author SHA1 Message Date
Clemens Schwaighofer 531229e8b7 Add DB Encryption tests 2025-04-07 12:05:06 +09:00
Clemens Schwaighofer d09c20ff9d hash test page update 2025-04-07 09:09:45 +09:00
Clemens Schwaighofer f4ddc5a5fc Add hash hmac to the Create Hash class 2025-04-07 09:05:37 +09:00
Clemens Schwaighofer 1791ec3908 phan and phpstan fixes for hash uses in CoreLibs 2025-04-04 15:17:42 +09:00
Clemens Schwaighofer 3d13f55c35 Update Hash Class
Add new constant: STANDARD_HASH for sha256
Deprecate DEFAULT_HASH is now STANDARD_HASH_SHORT

Deprecated
__sha1Short:
replace with __crc32b with the default parameter use_sha false
replace with sha1Short if use_sha is true

__hash:
replace with hashShort if default hash type
replace with hash for all others with new default STANDARD_HASH

__hashLong:
replace with hashLong

New:
hashShort: returns STANDARD_HASH_SHORT which is __hash default type
hashStd: returns STANDARD_HASH sha256
hash: switches to STANDARD_HASH as default type
2025-04-04 15:08:58 +09:00
Clemens Schwaighofer cf1989819a phpstan fixes 2025-04-01 11:22:59 +09:00
Clemens Schwaighofer b302fb4053 Add CombinedDateTime class calcDaysInteral wrapper functions
calcDaysIntervalNamedIndex for force using named index and returning only named index
calcDaysIntervalNumIndex for force using numeric index and returning only numeric index
2025-04-01 11:15:00 +09:00
Clemens Schwaighofer 46cda40d37 JavaScript general utils file updates 2025-03-28 10:53:42 +09:00
Clemens Schwaighofer e71df90144 Fully deprecate prototype edit.js, add deprecation warnings to edit.jq.js and add new utils
Note that all the utils.js are build in an external repository and just copied here
2025-03-10 11:00:02 +09:00
Clemens Schwaighofer bbcc642fde All "edit.js" development has moved to a new repository
"Code-Blocks.javascript-utils"
2025-03-07 15:09:47 +09:00
Clemens Schwaighofer 558694aa6c Fix DEFAULT_ENCODING that it is string 2025-02-28 10:32:43 +09:00
Clemens Schwaighofer f3bd09529a phpstan fixes 2025-02-28 10:29:04 +09:00
Clemens Schwaighofer 816bb7c9ee Allow encoding ovrride for htmlentities 2025-02-28 10:19:36 +09:00
Clemens Schwaighofer fc7b705355 config.master.php file update
- remove not used code
- reorder defines for possible clean up targets
- TARGET and HOST_NAME are set early
HOST NAME is set right at the top
TARGET is set after site configs is read
- add more $_ENV reads
DEFAULT_ACL_LEVEL
LOCALE (encoding is read from locale which should be in the format of nn_CT.ENCODING, eg en_US.UTF-8), falls back to UTF-8
ADMIN.STYLESHEET
ADMIN.JAVASCRIPT
2025-02-28 10:17:10 +09:00
Clemens Schwaighofer 32dee1692e Fix DateTime days internal counter
Fixed the bad coded include end date with using flags instead
Allow exclude of start date
Reverse counter fixed, and also includes weekend days

Add reverse for weekend in date interval

Login class: add numeric for ACL level

DB IO: some minor code clean up for not needed var set check

Some edit.jq.js clean ups and added
- loadEl: load element by id and return element value or throw error if not found
- goTo: scroll to an element with scroll into view call
2025-02-17 11:16:51 +09:00
Clemens Schwaighofer 5e21ead6fa change error catcher for javasript from log to error as output 2025-02-13 18:24:50 +09:00
Clemens Schwaighofer 44b825310a Add ACL level number to unit detail 2025-02-07 19:06:35 +09:00
Clemens Schwaighofer 2c234ccef6 On config errors do not exit but throw exception 2025-01-29 09:57:58 +09:00
Clemens Schwaighofer e7dd96b5d9 Further fixes for PHP 8.4 2025-01-20 20:27:03 +09:00
Clemens Schwaighofer bcde36ac17 DB IO Cache reset should not be an error
If the query is not found, do not throw an error, just show a warning
2025-01-20 10:45:31 +09:00
Clemens Schwaighofer 8bde34ec7d Fix bug in DB IO prepared statement with INSERT and auto RETURNING add
INSERT will get a RETURNING added automatically if it has a primary key
This was not checked when query was compared for prepared statements.

Also added a prepared statement status checker
2025-01-17 17:52:41 +09:00
Clemens Schwaighofer a345d71306 De-depricate the ACL Login loginCheckEditAccessId method
This is still used a lot, and there is no reason to deprecate it so early.

First all the other logic should be brought in to make this an easy
conversion.
2025-01-17 14:43:13 +09:00
Clemens Schwaighofer 0ff6294faa Fix ACL Login cuid <-> id pk lookups
Used the wrong SESSION var for lookup
2025-01-17 14:34:41 +09:00
Clemens Schwaighofer 757d7ae01d ACL Login fixes for legacy id lookups
add an edit access id lookup to cuid

Fix unit_cuid not initialized, only old unit_id
2025-01-17 12:48:46 +09:00
Clemens Schwaighofer 4e78b21c67 phpstan fix for fegetcsv param $length 2025-01-17 09:59:39 +09:00
Clemens Schwaighofer d7e6434808 New DeprecatedHelper namespace
For temporary wrapper functions for deprecated calls that need this

PHP 8.4 fputcsv/fgetcsv/str_getcsv encoding default change deprecated warning

Note this does not cover the SqlFileInfo class as this is not used in our code
2025-01-17 09:58:02 +09:00
Clemens Schwaighofer cf6500b55a Logging class change to "." for block separator
Blocks for info are now separated with "." and not "_" to make it visual more easy to see
2025-01-17 09:08:13 +09:00
Clemens Schwaighofer 09c2ec653f ACL Login set deprecated edit user id too
We need that for some old calls in old projects
2025-01-16 14:49:15 +09:00
Clemens Schwaighofer fc105f9295 Add ACL Login lookup edit access id to edit access cuid 2025-01-16 14:36:11 +09:00
Clemens Schwaighofer 053ab69330 Add edit access cuuid to the unit detail list 2025-01-16 14:04:30 +09:00
Clemens Schwaighofer fd079316f5 ACL Login: Add edit_access_id to unit detail block
This is needed for a lot of legacy data lookup
2025-01-16 13:55:17 +09:00
Clemens Schwaighofer 08664e9834 Update log writing for login info
Fix the deprecated message in the Admin/Backend one with a full sample
Update the admin_header include sample page with the corret writeLog call
2025-01-16 10:40:41 +09:00
Clemens Schwaighofer e063162161 Remove not needed use parts and ignore noop new for phan check 2025-01-15 12:53:02 +09:00
Clemens Schwaighofer 72912c8c90 Bad password check for PHP earlier than 8.4 2025-01-06 13:52:28 +09:00
Clemens Schwaighofer de2ed8be3d EditBase SmartyExtended class call update 2024-12-27 17:07:44 +09:00
Clemens Schwaighofer 9d65f5d7c1 phpunit script update, SmartyExtended allow load of plugins
- phpunit has better options set for testdox/php version
- SmartyExtended has logger class as option (argument 2) and options
- SmartyExtneded can via option set html escape and load of plugins
	- plugin array is set of
		- file: path to plugin file
		- type: what type this is
		- tag: tag name
		- callable: the callable for the tag name
	- will throw exceptions on plugin load
	- for all other things will set warning only and skip read
- fix the Smarty call with the logger option
- fix password test for PHP 8.4 password hash change

*IMPORTANT*
SmartyExtended($l10n, $logger, $cache_id, $compile_id)
The second argument is now the Logger class, this MUST be updated for all calls
2024-12-27 14:00:12 +09:00
Clemens Schwaighofer fbe827e989 Update Smarty Extended for Smarty-extended v5 upgrade 2024-12-27 11:30:55 +09:00
Clemens Schwaighofer c778a4eb81 Add phive back in for static tools like phpunit instead of using the composer package 2024-12-27 09:32:54 +09:00
Clemens Schwaighofer ce1c72a0bc Bug fix for DB IO parameters in CASE calls 2024-12-24 12:43:30 +09:00
Clemens Schwaighofer 10319ef728 Fix throws type for AsymmetricAnonymousEncryption in the phpdoc part 2024-12-23 12:56:57 +09:00
Clemens Schwaighofer 8d0036eaac Fix phpdoc return types 2024-12-23 11:26:50 +09:00
Clemens Schwaighofer d1e65c702e Allow Seession settings to be changed
eg set the auto write + others
or set/unset can be chagned for single sets
2024-12-20 18:48:00 +09:00
Clemens Schwaighofer 7248906da7 Allow chaining of key set functions for encryption 2024-12-20 15:13:22 +09:00
Clemens Schwaighofer 7f9a4dc04f Merge branch 'Feature-AsymmetricEncryption' into NewFeatures 2024-12-18 10:52:29 +09:00
Clemens Schwaighofer 10935214eb Fix Class file name for asymmetric anonymous encryption 2024-12-18 10:50:27 +09:00
Clemens Schwaighofer 41e116f7d4 phpstan checks for level 9 2024-12-18 10:11:47 +09:00
Clemens Schwaighofer 881c93c343 Asymmetric Anoymouse Encryption phpunit tests 2024-12-18 09:56:48 +09:00
Clemens Schwaighofer 185d044a0b Symmetric encryption key set tests 2024-12-17 18:23:10 +09:00
Clemens Schwaighofer cc067cc202 Update symmetric encryption with compare/get key, empty key test, unset on end
All key and messages are set SensitiveParameter type
On end, unset the key parameter with sodium mem zero
Get/Compare key set methods
Additional check on empty key
Add missing sodium mem zero for inner function variable clean up
2024-12-17 15:18:06 +09:00
Clemens Schwaighofer 37e2e54b2a Add asymmetric anonymous encryption
Private/Public key encryption for anonymous messages (not receipient)
2024-12-17 15:16:48 +09:00