From 43e66edfd1e6918b50e4fbcee0aa691bee9ac9ea Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 16 Feb 2023 17:13:30 +0900 Subject: [PATCH] Composer installed CoreLibs --- .../deprecated}/CoreLibs/ACL/Login.php | 0 .../deprecated}/CoreLibs/Admin/Backend.php | 0 .../deprecated}/CoreLibs/Admin/EditBase.php | 0 .../deprecated}/CoreLibs/Basic.php | 0 .../deprecated}/CoreLibs/Check/Colors.php | 0 .../deprecated}/CoreLibs/Check/Email.php | 0 .../deprecated}/CoreLibs/Check/Encoding.php | 0 .../deprecated}/CoreLibs/Check/File.php | 0 .../deprecated}/CoreLibs/Check/Jason.php | 0 .../deprecated}/CoreLibs/Check/Password.php | 0 .../deprecated}/CoreLibs/Check/PhpVersion.php | 0 .../CoreLibs/Combined/ArrayHandler.php | 0 .../CoreLibs/Combined/DateTime.php | 0 .../deprecated}/CoreLibs/Convert/Byte.php | 0 .../deprecated}/CoreLibs/Convert/Colors.php | 0 .../deprecated}/CoreLibs/Convert/Encoding.php | 0 .../Convert/Extends/VarSetTypeMain.php | 0 .../deprecated}/CoreLibs/Convert/Html.php | 0 .../deprecated}/CoreLibs/Convert/Json.php | 0 .../deprecated}/CoreLibs/Convert/Math.php | 0 .../CoreLibs/Convert/MimeAppName.php | 0 .../CoreLibs/Convert/MimeEncode.php | 0 .../deprecated}/CoreLibs/Convert/Strings.php | 0 .../CoreLibs/Convert/VarSetType.php | 0 .../CoreLibs/Convert/VarSetTypeNull.php | 0 .../deprecated}/CoreLibs/Create/Email.php | 0 .../deprecated}/CoreLibs/Create/Hash.php | 0 .../deprecated}/CoreLibs/Create/RandomKey.php | 0 .../deprecated}/CoreLibs/Create/Session.php | 0 .../deprecated}/CoreLibs/Create/Uids.php | 0 .../CoreLibs/DB/Extended/ArrayIO.php | 0 .../deprecated}/CoreLibs/DB/IO.php | 0 .../deprecated}/CoreLibs/DB/SQL/PgSQL.php | 0 .../DB/SQL/SqlInterface/SqlFunctions.php | 0 .../deprecated}/CoreLibs/Debug/FileWriter.php | 0 .../deprecated}/CoreLibs/Debug/Logging.php | 0 .../CoreLibs/Debug/MemoryUsage.php | 0 .../CoreLibs/Debug/RunningTime.php | 0 .../deprecated}/CoreLibs/Debug/Support.php | 0 .../deprecated}/CoreLibs/Get/DotEnv.php | 0 .../deprecated}/CoreLibs/Get/ReadEnvFile.php | 0 .../deprecated}/CoreLibs/Get/System.php | 0 .../Language/Core/CachedFileReader.php | 0 .../CoreLibs/Language/Core/FileReader.php | 0 .../CoreLibs/Language/Core/GetTextReader.php | 0 .../CoreLibs/Language/Core/StreamReader.php | 0 .../CoreLibs/Language/Core/StringReader.php | 0 .../CoreLibs/Language/Encoding.php | 0 .../CoreLibs/Language/GetLocale.php | 0 .../deprecated}/CoreLibs/Language/L10n.php | 0 .../CoreLibs/Language/l10n_functions.php | 0 .../CoreLibs/Output/Form/Elements.php | 0 .../CoreLibs/Output/Form/Generate.php | 0 .../Output/Form/TableArrays/EditAccess.php | 0 .../Output/Form/TableArrays/EditGroups.php | 0 .../Output/Form/TableArrays/EditLanguages.php | 0 .../Output/Form/TableArrays/EditMenuGroup.php | 0 .../Output/Form/TableArrays/EditPages.php | 0 .../Output/Form/TableArrays/EditSchemas.php | 0 .../Output/Form/TableArrays/EditUsers.php | 0 .../Form/TableArrays/EditVisibleGroup.php | 0 .../CoreLibs/Output/Form/Token.php | 0 .../deprecated}/CoreLibs/Output/Image.php | 0 .../CoreLibs/Output/ProgressBar.php | 0 .../CoreLibs/Output/TableArraysInterface.php | 0 .../CoreLibs/Template/SmartyExtend.php | 0 www/admin/class_test.output.form.php | 2 +- www/composer.json | 9 + www/composer.lock | 18 +- www/vendor/composer/autoload_classmap.php | 65 - www/vendor/composer/autoload_static.php | 65 - www/vendor/composer/installed.json | 15 +- www/vendor/composer/installed.php | 13 +- .../corelibs-composer-all/composer.json | 19 + .../corelibs-composer-all/src/ACL/Login.php | 2213 +++++++++++ .../src/Admin/Backend.php | 622 +++ .../src/Admin/EditBase.php | 588 +++ .../corelibs-composer-all/src/Basic.php | 1549 ++++++++ .../src/Check/Colors.php | 187 + .../corelibs-composer-all/src/Check/Email.php | 265 ++ .../src/Check/Encoding.php | 117 + .../corelibs-composer-all/src/Check/File.php | 56 + .../corelibs-composer-all/src/Check/Jason.php | 41 + .../src/Check/Password.php | 59 + .../src/Check/PhpVersion.php | 75 + .../src/Combined/ArrayHandler.php | 412 ++ .../src/Combined/DateTime.php | 452 +++ .../src/Convert/Byte.php | 167 + .../src/Convert/Colors.php | 344 ++ .../src/Convert/Encoding.php | 60 + .../src/Convert/Extends/VarSetTypeMain.php | 256 ++ .../src/Convert/Html.php | 70 + .../src/Convert/Json.php | 97 + .../src/Convert/Math.php | 61 + .../src/Convert/MimeAppName.php | 85 + .../src/Convert/MimeEncode.php | 71 + .../src/Convert/Strings.php | 123 + .../src/Convert/VarSetType.php | 136 + .../src/Convert/VarSetTypeNull.php | 130 + .../src/Create/Email.php | 291 ++ .../corelibs-composer-all/src/Create/Hash.php | 122 + .../src/Create/RandomKey.php | 121 + .../src/Create/Session.php | 371 ++ .../corelibs-composer-all/src/Create/Uids.php | 108 + .../src/DB/Extended/ArrayIO.php | 655 ++++ .../corelibs-composer-all/src/DB/IO.php | 3342 +++++++++++++++++ .../src/DB/SQL/PgSQL.php | 883 +++++ .../src/DB/SQL/SqlInterface/SqlFunctions.php | 305 ++ .../src/Debug/FileWriter.php | 99 + .../src/Debug/Logging.php | 881 +++++ .../src/Debug/MemoryUsage.php | 129 + .../src/Debug/RunningTime.php | 173 + .../src/Debug/Support.php | 219 ++ .../corelibs-composer-all/src/Get/DotEnv.php | 110 + .../src/Get/ReadEnvFile.php | 42 + .../corelibs-composer-all/src/Get/System.php | 120 + .../src/Language/Core/CachedFileReader.php | 58 + .../src/Language/Core/FileReader.php | 135 + .../src/Language/Core/GetTextReader.php | 546 +++ .../src/Language/Core/StreamReader.php | 82 + .../src/Language/Core/StringReader.php | 98 + .../src/Language/Encoding.php | 127 + .../src/Language/GetLocale.php | 117 + .../src/Language/L10n.php | 663 ++++ .../src/Language/l10n_functions.php | 216 ++ .../src/Output/Form/Elements.php | 290 ++ .../src/Output/Form/Generate.php | 2748 ++++++++++++++ .../Output/Form/TableArrays/EditAccess.php | 140 + .../Output/Form/TableArrays/EditGroups.php | 137 + .../Output/Form/TableArrays/EditLanguages.php | 105 + .../Output/Form/TableArrays/EditMenuGroup.php | 68 + .../src/Output/Form/TableArrays/EditPages.php | 275 ++ .../Output/Form/TableArrays/EditSchemas.php | 86 + .../src/Output/Form/TableArrays/EditUsers.php | 456 +++ .../Form/TableArrays/EditVisibleGroup.php | 61 + .../src/Output/Form/Token.php | 45 + .../src/Output/Image.php | 493 +++ .../src/Output/ProgressBar.php | 932 +++++ .../src/Output/TableArraysInterface.php | 16 + .../src/Template/SmartyExtend.php | 551 +++ .../corelibs-composer-all/test/index.php | 5 + .../corelibs-composer-all/vendor/autoload.php | 25 + .../vendor/composer/ClassLoader.php | 581 +++ .../vendor/composer/LICENSE | 21 + .../vendor/composer/autoload_classmap.php | 10 + .../vendor/composer/autoload_namespaces.php | 9 + .../vendor/composer/autoload_psr4.php | 10 + .../vendor/composer/autoload_real.php | 36 + .../vendor/composer/autoload_static.php | 36 + 149 files changed, 25454 insertions(+), 137 deletions(-) rename {www/lib => 4dev/deprecated}/CoreLibs/ACL/Login.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Admin/Backend.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Admin/EditBase.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Basic.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Check/Colors.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Check/Email.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Check/Encoding.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Check/File.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Check/Jason.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Check/Password.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Check/PhpVersion.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Combined/ArrayHandler.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Combined/DateTime.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/Byte.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/Colors.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/Encoding.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/Extends/VarSetTypeMain.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/Html.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/Json.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/Math.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/MimeAppName.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/MimeEncode.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/Strings.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/VarSetType.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Convert/VarSetTypeNull.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Create/Email.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Create/Hash.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Create/RandomKey.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Create/Session.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Create/Uids.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/DB/Extended/ArrayIO.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/DB/IO.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/DB/SQL/PgSQL.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/DB/SQL/SqlInterface/SqlFunctions.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Debug/FileWriter.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Debug/Logging.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Debug/MemoryUsage.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Debug/RunningTime.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Debug/Support.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Get/DotEnv.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Get/ReadEnvFile.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Get/System.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Language/Core/CachedFileReader.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Language/Core/FileReader.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Language/Core/GetTextReader.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Language/Core/StreamReader.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Language/Core/StringReader.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Language/Encoding.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Language/GetLocale.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Language/L10n.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Language/l10n_functions.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/Elements.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/Generate.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/TableArrays/EditAccess.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/TableArrays/EditGroups.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/TableArrays/EditLanguages.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/TableArrays/EditPages.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/TableArrays/EditSchemas.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/TableArrays/EditUsers.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/TableArrays/EditVisibleGroup.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Form/Token.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/Image.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/ProgressBar.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Output/TableArraysInterface.php (100%) rename {www/lib => 4dev/deprecated}/CoreLibs/Template/SmartyExtend.php (100%) create mode 100644 www/vendor/egrajp/corelibs-composer-all/composer.json create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/ACL/Login.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Admin/Backend.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Admin/EditBase.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Basic.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Check/Colors.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Check/Email.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Check/Encoding.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Check/File.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Check/Jason.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Check/Password.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Check/PhpVersion.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Combined/ArrayHandler.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Combined/DateTime.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/Byte.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/Colors.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/Encoding.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/Extends/VarSetTypeMain.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/Html.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/Json.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/Math.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/MimeAppName.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/MimeEncode.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/Strings.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/VarSetType.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Convert/VarSetTypeNull.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Create/Email.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Create/Hash.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Create/RandomKey.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Create/Session.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Create/Uids.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/DB/Extended/ArrayIO.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/DB/IO.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/DB/SQL/PgSQL.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/DB/SQL/SqlInterface/SqlFunctions.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Debug/FileWriter.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Debug/Logging.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Debug/MemoryUsage.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Debug/RunningTime.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Debug/Support.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Get/DotEnv.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Get/ReadEnvFile.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Get/System.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Language/Core/CachedFileReader.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Language/Core/FileReader.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Language/Core/GetTextReader.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Language/Core/StreamReader.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Language/Core/StringReader.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Language/Encoding.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Language/GetLocale.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Language/L10n.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Language/l10n_functions.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/Elements.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/Generate.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/TableArrays/EditAccess.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/TableArrays/EditGroups.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/TableArrays/EditLanguages.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/TableArrays/EditMenuGroup.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/TableArrays/EditPages.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/TableArrays/EditSchemas.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/TableArrays/EditUsers.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/TableArrays/EditVisibleGroup.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Form/Token.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/Image.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/ProgressBar.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Output/TableArraysInterface.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/src/Template/SmartyExtend.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/test/index.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/vendor/autoload.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/vendor/composer/ClassLoader.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/vendor/composer/LICENSE create mode 100644 www/vendor/egrajp/corelibs-composer-all/vendor/composer/autoload_classmap.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/vendor/composer/autoload_namespaces.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/vendor/composer/autoload_psr4.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/vendor/composer/autoload_real.php create mode 100644 www/vendor/egrajp/corelibs-composer-all/vendor/composer/autoload_static.php diff --git a/www/lib/CoreLibs/ACL/Login.php b/4dev/deprecated/CoreLibs/ACL/Login.php similarity index 100% rename from www/lib/CoreLibs/ACL/Login.php rename to 4dev/deprecated/CoreLibs/ACL/Login.php diff --git a/www/lib/CoreLibs/Admin/Backend.php b/4dev/deprecated/CoreLibs/Admin/Backend.php similarity index 100% rename from www/lib/CoreLibs/Admin/Backend.php rename to 4dev/deprecated/CoreLibs/Admin/Backend.php diff --git a/www/lib/CoreLibs/Admin/EditBase.php b/4dev/deprecated/CoreLibs/Admin/EditBase.php similarity index 100% rename from www/lib/CoreLibs/Admin/EditBase.php rename to 4dev/deprecated/CoreLibs/Admin/EditBase.php diff --git a/www/lib/CoreLibs/Basic.php b/4dev/deprecated/CoreLibs/Basic.php similarity index 100% rename from www/lib/CoreLibs/Basic.php rename to 4dev/deprecated/CoreLibs/Basic.php diff --git a/www/lib/CoreLibs/Check/Colors.php b/4dev/deprecated/CoreLibs/Check/Colors.php similarity index 100% rename from www/lib/CoreLibs/Check/Colors.php rename to 4dev/deprecated/CoreLibs/Check/Colors.php diff --git a/www/lib/CoreLibs/Check/Email.php b/4dev/deprecated/CoreLibs/Check/Email.php similarity index 100% rename from www/lib/CoreLibs/Check/Email.php rename to 4dev/deprecated/CoreLibs/Check/Email.php diff --git a/www/lib/CoreLibs/Check/Encoding.php b/4dev/deprecated/CoreLibs/Check/Encoding.php similarity index 100% rename from www/lib/CoreLibs/Check/Encoding.php rename to 4dev/deprecated/CoreLibs/Check/Encoding.php diff --git a/www/lib/CoreLibs/Check/File.php b/4dev/deprecated/CoreLibs/Check/File.php similarity index 100% rename from www/lib/CoreLibs/Check/File.php rename to 4dev/deprecated/CoreLibs/Check/File.php diff --git a/www/lib/CoreLibs/Check/Jason.php b/4dev/deprecated/CoreLibs/Check/Jason.php similarity index 100% rename from www/lib/CoreLibs/Check/Jason.php rename to 4dev/deprecated/CoreLibs/Check/Jason.php diff --git a/www/lib/CoreLibs/Check/Password.php b/4dev/deprecated/CoreLibs/Check/Password.php similarity index 100% rename from www/lib/CoreLibs/Check/Password.php rename to 4dev/deprecated/CoreLibs/Check/Password.php diff --git a/www/lib/CoreLibs/Check/PhpVersion.php b/4dev/deprecated/CoreLibs/Check/PhpVersion.php similarity index 100% rename from www/lib/CoreLibs/Check/PhpVersion.php rename to 4dev/deprecated/CoreLibs/Check/PhpVersion.php diff --git a/www/lib/CoreLibs/Combined/ArrayHandler.php b/4dev/deprecated/CoreLibs/Combined/ArrayHandler.php similarity index 100% rename from www/lib/CoreLibs/Combined/ArrayHandler.php rename to 4dev/deprecated/CoreLibs/Combined/ArrayHandler.php diff --git a/www/lib/CoreLibs/Combined/DateTime.php b/4dev/deprecated/CoreLibs/Combined/DateTime.php similarity index 100% rename from www/lib/CoreLibs/Combined/DateTime.php rename to 4dev/deprecated/CoreLibs/Combined/DateTime.php diff --git a/www/lib/CoreLibs/Convert/Byte.php b/4dev/deprecated/CoreLibs/Convert/Byte.php similarity index 100% rename from www/lib/CoreLibs/Convert/Byte.php rename to 4dev/deprecated/CoreLibs/Convert/Byte.php diff --git a/www/lib/CoreLibs/Convert/Colors.php b/4dev/deprecated/CoreLibs/Convert/Colors.php similarity index 100% rename from www/lib/CoreLibs/Convert/Colors.php rename to 4dev/deprecated/CoreLibs/Convert/Colors.php diff --git a/www/lib/CoreLibs/Convert/Encoding.php b/4dev/deprecated/CoreLibs/Convert/Encoding.php similarity index 100% rename from www/lib/CoreLibs/Convert/Encoding.php rename to 4dev/deprecated/CoreLibs/Convert/Encoding.php diff --git a/www/lib/CoreLibs/Convert/Extends/VarSetTypeMain.php b/4dev/deprecated/CoreLibs/Convert/Extends/VarSetTypeMain.php similarity index 100% rename from www/lib/CoreLibs/Convert/Extends/VarSetTypeMain.php rename to 4dev/deprecated/CoreLibs/Convert/Extends/VarSetTypeMain.php diff --git a/www/lib/CoreLibs/Convert/Html.php b/4dev/deprecated/CoreLibs/Convert/Html.php similarity index 100% rename from www/lib/CoreLibs/Convert/Html.php rename to 4dev/deprecated/CoreLibs/Convert/Html.php diff --git a/www/lib/CoreLibs/Convert/Json.php b/4dev/deprecated/CoreLibs/Convert/Json.php similarity index 100% rename from www/lib/CoreLibs/Convert/Json.php rename to 4dev/deprecated/CoreLibs/Convert/Json.php diff --git a/www/lib/CoreLibs/Convert/Math.php b/4dev/deprecated/CoreLibs/Convert/Math.php similarity index 100% rename from www/lib/CoreLibs/Convert/Math.php rename to 4dev/deprecated/CoreLibs/Convert/Math.php diff --git a/www/lib/CoreLibs/Convert/MimeAppName.php b/4dev/deprecated/CoreLibs/Convert/MimeAppName.php similarity index 100% rename from www/lib/CoreLibs/Convert/MimeAppName.php rename to 4dev/deprecated/CoreLibs/Convert/MimeAppName.php diff --git a/www/lib/CoreLibs/Convert/MimeEncode.php b/4dev/deprecated/CoreLibs/Convert/MimeEncode.php similarity index 100% rename from www/lib/CoreLibs/Convert/MimeEncode.php rename to 4dev/deprecated/CoreLibs/Convert/MimeEncode.php diff --git a/www/lib/CoreLibs/Convert/Strings.php b/4dev/deprecated/CoreLibs/Convert/Strings.php similarity index 100% rename from www/lib/CoreLibs/Convert/Strings.php rename to 4dev/deprecated/CoreLibs/Convert/Strings.php diff --git a/www/lib/CoreLibs/Convert/VarSetType.php b/4dev/deprecated/CoreLibs/Convert/VarSetType.php similarity index 100% rename from www/lib/CoreLibs/Convert/VarSetType.php rename to 4dev/deprecated/CoreLibs/Convert/VarSetType.php diff --git a/www/lib/CoreLibs/Convert/VarSetTypeNull.php b/4dev/deprecated/CoreLibs/Convert/VarSetTypeNull.php similarity index 100% rename from www/lib/CoreLibs/Convert/VarSetTypeNull.php rename to 4dev/deprecated/CoreLibs/Convert/VarSetTypeNull.php diff --git a/www/lib/CoreLibs/Create/Email.php b/4dev/deprecated/CoreLibs/Create/Email.php similarity index 100% rename from www/lib/CoreLibs/Create/Email.php rename to 4dev/deprecated/CoreLibs/Create/Email.php diff --git a/www/lib/CoreLibs/Create/Hash.php b/4dev/deprecated/CoreLibs/Create/Hash.php similarity index 100% rename from www/lib/CoreLibs/Create/Hash.php rename to 4dev/deprecated/CoreLibs/Create/Hash.php diff --git a/www/lib/CoreLibs/Create/RandomKey.php b/4dev/deprecated/CoreLibs/Create/RandomKey.php similarity index 100% rename from www/lib/CoreLibs/Create/RandomKey.php rename to 4dev/deprecated/CoreLibs/Create/RandomKey.php diff --git a/www/lib/CoreLibs/Create/Session.php b/4dev/deprecated/CoreLibs/Create/Session.php similarity index 100% rename from www/lib/CoreLibs/Create/Session.php rename to 4dev/deprecated/CoreLibs/Create/Session.php diff --git a/www/lib/CoreLibs/Create/Uids.php b/4dev/deprecated/CoreLibs/Create/Uids.php similarity index 100% rename from www/lib/CoreLibs/Create/Uids.php rename to 4dev/deprecated/CoreLibs/Create/Uids.php diff --git a/www/lib/CoreLibs/DB/Extended/ArrayIO.php b/4dev/deprecated/CoreLibs/DB/Extended/ArrayIO.php similarity index 100% rename from www/lib/CoreLibs/DB/Extended/ArrayIO.php rename to 4dev/deprecated/CoreLibs/DB/Extended/ArrayIO.php diff --git a/www/lib/CoreLibs/DB/IO.php b/4dev/deprecated/CoreLibs/DB/IO.php similarity index 100% rename from www/lib/CoreLibs/DB/IO.php rename to 4dev/deprecated/CoreLibs/DB/IO.php diff --git a/www/lib/CoreLibs/DB/SQL/PgSQL.php b/4dev/deprecated/CoreLibs/DB/SQL/PgSQL.php similarity index 100% rename from www/lib/CoreLibs/DB/SQL/PgSQL.php rename to 4dev/deprecated/CoreLibs/DB/SQL/PgSQL.php diff --git a/www/lib/CoreLibs/DB/SQL/SqlInterface/SqlFunctions.php b/4dev/deprecated/CoreLibs/DB/SQL/SqlInterface/SqlFunctions.php similarity index 100% rename from www/lib/CoreLibs/DB/SQL/SqlInterface/SqlFunctions.php rename to 4dev/deprecated/CoreLibs/DB/SQL/SqlInterface/SqlFunctions.php diff --git a/www/lib/CoreLibs/Debug/FileWriter.php b/4dev/deprecated/CoreLibs/Debug/FileWriter.php similarity index 100% rename from www/lib/CoreLibs/Debug/FileWriter.php rename to 4dev/deprecated/CoreLibs/Debug/FileWriter.php diff --git a/www/lib/CoreLibs/Debug/Logging.php b/4dev/deprecated/CoreLibs/Debug/Logging.php similarity index 100% rename from www/lib/CoreLibs/Debug/Logging.php rename to 4dev/deprecated/CoreLibs/Debug/Logging.php diff --git a/www/lib/CoreLibs/Debug/MemoryUsage.php b/4dev/deprecated/CoreLibs/Debug/MemoryUsage.php similarity index 100% rename from www/lib/CoreLibs/Debug/MemoryUsage.php rename to 4dev/deprecated/CoreLibs/Debug/MemoryUsage.php diff --git a/www/lib/CoreLibs/Debug/RunningTime.php b/4dev/deprecated/CoreLibs/Debug/RunningTime.php similarity index 100% rename from www/lib/CoreLibs/Debug/RunningTime.php rename to 4dev/deprecated/CoreLibs/Debug/RunningTime.php diff --git a/www/lib/CoreLibs/Debug/Support.php b/4dev/deprecated/CoreLibs/Debug/Support.php similarity index 100% rename from www/lib/CoreLibs/Debug/Support.php rename to 4dev/deprecated/CoreLibs/Debug/Support.php diff --git a/www/lib/CoreLibs/Get/DotEnv.php b/4dev/deprecated/CoreLibs/Get/DotEnv.php similarity index 100% rename from www/lib/CoreLibs/Get/DotEnv.php rename to 4dev/deprecated/CoreLibs/Get/DotEnv.php diff --git a/www/lib/CoreLibs/Get/ReadEnvFile.php b/4dev/deprecated/CoreLibs/Get/ReadEnvFile.php similarity index 100% rename from www/lib/CoreLibs/Get/ReadEnvFile.php rename to 4dev/deprecated/CoreLibs/Get/ReadEnvFile.php diff --git a/www/lib/CoreLibs/Get/System.php b/4dev/deprecated/CoreLibs/Get/System.php similarity index 100% rename from www/lib/CoreLibs/Get/System.php rename to 4dev/deprecated/CoreLibs/Get/System.php diff --git a/www/lib/CoreLibs/Language/Core/CachedFileReader.php b/4dev/deprecated/CoreLibs/Language/Core/CachedFileReader.php similarity index 100% rename from www/lib/CoreLibs/Language/Core/CachedFileReader.php rename to 4dev/deprecated/CoreLibs/Language/Core/CachedFileReader.php diff --git a/www/lib/CoreLibs/Language/Core/FileReader.php b/4dev/deprecated/CoreLibs/Language/Core/FileReader.php similarity index 100% rename from www/lib/CoreLibs/Language/Core/FileReader.php rename to 4dev/deprecated/CoreLibs/Language/Core/FileReader.php diff --git a/www/lib/CoreLibs/Language/Core/GetTextReader.php b/4dev/deprecated/CoreLibs/Language/Core/GetTextReader.php similarity index 100% rename from www/lib/CoreLibs/Language/Core/GetTextReader.php rename to 4dev/deprecated/CoreLibs/Language/Core/GetTextReader.php diff --git a/www/lib/CoreLibs/Language/Core/StreamReader.php b/4dev/deprecated/CoreLibs/Language/Core/StreamReader.php similarity index 100% rename from www/lib/CoreLibs/Language/Core/StreamReader.php rename to 4dev/deprecated/CoreLibs/Language/Core/StreamReader.php diff --git a/www/lib/CoreLibs/Language/Core/StringReader.php b/4dev/deprecated/CoreLibs/Language/Core/StringReader.php similarity index 100% rename from www/lib/CoreLibs/Language/Core/StringReader.php rename to 4dev/deprecated/CoreLibs/Language/Core/StringReader.php diff --git a/www/lib/CoreLibs/Language/Encoding.php b/4dev/deprecated/CoreLibs/Language/Encoding.php similarity index 100% rename from www/lib/CoreLibs/Language/Encoding.php rename to 4dev/deprecated/CoreLibs/Language/Encoding.php diff --git a/www/lib/CoreLibs/Language/GetLocale.php b/4dev/deprecated/CoreLibs/Language/GetLocale.php similarity index 100% rename from www/lib/CoreLibs/Language/GetLocale.php rename to 4dev/deprecated/CoreLibs/Language/GetLocale.php diff --git a/www/lib/CoreLibs/Language/L10n.php b/4dev/deprecated/CoreLibs/Language/L10n.php similarity index 100% rename from www/lib/CoreLibs/Language/L10n.php rename to 4dev/deprecated/CoreLibs/Language/L10n.php diff --git a/www/lib/CoreLibs/Language/l10n_functions.php b/4dev/deprecated/CoreLibs/Language/l10n_functions.php similarity index 100% rename from www/lib/CoreLibs/Language/l10n_functions.php rename to 4dev/deprecated/CoreLibs/Language/l10n_functions.php diff --git a/www/lib/CoreLibs/Output/Form/Elements.php b/4dev/deprecated/CoreLibs/Output/Form/Elements.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/Elements.php rename to 4dev/deprecated/CoreLibs/Output/Form/Elements.php diff --git a/www/lib/CoreLibs/Output/Form/Generate.php b/4dev/deprecated/CoreLibs/Output/Form/Generate.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/Generate.php rename to 4dev/deprecated/CoreLibs/Output/Form/Generate.php diff --git a/www/lib/CoreLibs/Output/Form/TableArrays/EditAccess.php b/4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditAccess.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/TableArrays/EditAccess.php rename to 4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditAccess.php diff --git a/www/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php b/4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditGroups.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php rename to 4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditGroups.php diff --git a/www/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php b/4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditLanguages.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php rename to 4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditLanguages.php diff --git a/www/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php b/4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php rename to 4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php diff --git a/www/lib/CoreLibs/Output/Form/TableArrays/EditPages.php b/4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditPages.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/TableArrays/EditPages.php rename to 4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditPages.php diff --git a/www/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php b/4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditSchemas.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php rename to 4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditSchemas.php diff --git a/www/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php b/4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditUsers.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php rename to 4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditUsers.php diff --git a/www/lib/CoreLibs/Output/Form/TableArrays/EditVisibleGroup.php b/4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditVisibleGroup.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/TableArrays/EditVisibleGroup.php rename to 4dev/deprecated/CoreLibs/Output/Form/TableArrays/EditVisibleGroup.php diff --git a/www/lib/CoreLibs/Output/Form/Token.php b/4dev/deprecated/CoreLibs/Output/Form/Token.php similarity index 100% rename from www/lib/CoreLibs/Output/Form/Token.php rename to 4dev/deprecated/CoreLibs/Output/Form/Token.php diff --git a/www/lib/CoreLibs/Output/Image.php b/4dev/deprecated/CoreLibs/Output/Image.php similarity index 100% rename from www/lib/CoreLibs/Output/Image.php rename to 4dev/deprecated/CoreLibs/Output/Image.php diff --git a/www/lib/CoreLibs/Output/ProgressBar.php b/4dev/deprecated/CoreLibs/Output/ProgressBar.php similarity index 100% rename from www/lib/CoreLibs/Output/ProgressBar.php rename to 4dev/deprecated/CoreLibs/Output/ProgressBar.php diff --git a/www/lib/CoreLibs/Output/TableArraysInterface.php b/4dev/deprecated/CoreLibs/Output/TableArraysInterface.php similarity index 100% rename from www/lib/CoreLibs/Output/TableArraysInterface.php rename to 4dev/deprecated/CoreLibs/Output/TableArraysInterface.php diff --git a/www/lib/CoreLibs/Template/SmartyExtend.php b/4dev/deprecated/CoreLibs/Template/SmartyExtend.php similarity index 100% rename from www/lib/CoreLibs/Template/SmartyExtend.php rename to 4dev/deprecated/CoreLibs/Template/SmartyExtend.php diff --git a/www/admin/class_test.output.form.php b/www/admin/class_test.output.form.php index c91fe7b3..14120714 100644 --- a/www/admin/class_test.output.form.php +++ b/www/admin/class_test.output.form.php @@ -67,7 +67,7 @@ $log = new CoreLibs\Debug\Logging([ 'echo_all' => $ECHO_ALL ?? false, 'print_all' => $PRINT_ALL ?? false, ]); -$form = new CoreLibs\Output\Form\Generate(DB_CONFIG, $log); +$form = new CoreLibs\Output\Form\Generate(DB_CONFIG, $log, table_arrays: $table_arrays); $PAGE_NAME = 'TEST CLASS: FORM GENERATE'; print ""; diff --git a/www/composer.json b/www/composer.json index 18b07628..b8f736eb 100644 --- a/www/composer.json +++ b/www/composer.json @@ -9,6 +9,15 @@ "email": "clemens.schwaighofer@egplusww.com" } ], + "repositories": [ + { + "type": "composer", + "url": "http://composer-local.tokyo.tequila.jp" + } + ], + "require": { + "egrajp/corelibs-composer-all": "@dev" + }, "autoload": { "classmap": [ "lib/" diff --git a/www/composer.lock b/www/composer.lock index 5912994c..8a2a12dd 100644 --- a/www/composer.lock +++ b/www/composer.lock @@ -4,12 +4,24 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4803358a39fae1c0e68aa8125f2ad09b", - "packages": [], + "content-hash": "645565cf406bc619ebe37b74b2d0590f", + "packages": [ + { + "name": "egrajp/corelibs-composer-all", + "version": "7.11.0", + "dist": { + "type": "zip", + "url": "https://git.egplusww.jp/Composer/CoreLibs-Composer-All/archive/v7.11.0.zip" + }, + "type": "library" + } + ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "egrajp/corelibs-composer-all": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/www/vendor/composer/autoload_classmap.php b/www/vendor/composer/autoload_classmap.php index 35d9c0a3..6d2b6a54 100644 --- a/www/vendor/composer/autoload_classmap.php +++ b/www/vendor/composer/autoload_classmap.php @@ -8,71 +8,6 @@ $baseDir = dirname($vendorDir); return array( 'Autoloader\\Autoload' => $baseDir . '/lib/autoloader.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'CoreLibs\\ACL\\Login' => $baseDir . '/lib/CoreLibs/ACL/Login.php', - 'CoreLibs\\Admin\\Backend' => $baseDir . '/lib/CoreLibs/Admin/Backend.php', - 'CoreLibs\\Admin\\EditBase' => $baseDir . '/lib/CoreLibs/Admin/EditBase.php', - 'CoreLibs\\Basic' => $baseDir . '/lib/CoreLibs/Basic.php', - 'CoreLibs\\Check\\Colors' => $baseDir . '/lib/CoreLibs/Check/Colors.php', - 'CoreLibs\\Check\\Email' => $baseDir . '/lib/CoreLibs/Check/Email.php', - 'CoreLibs\\Check\\Encoding' => $baseDir . '/lib/CoreLibs/Check/Encoding.php', - 'CoreLibs\\Check\\File' => $baseDir . '/lib/CoreLibs/Check/File.php', - 'CoreLibs\\Check\\Jason' => $baseDir . '/lib/CoreLibs/Check/Jason.php', - 'CoreLibs\\Check\\Password' => $baseDir . '/lib/CoreLibs/Check/Password.php', - 'CoreLibs\\Check\\PhpVersion' => $baseDir . '/lib/CoreLibs/Check/PhpVersion.php', - 'CoreLibs\\Combined\\ArrayHandler' => $baseDir . '/lib/CoreLibs/Combined/ArrayHandler.php', - 'CoreLibs\\Combined\\DateTime' => $baseDir . '/lib/CoreLibs/Combined/DateTime.php', - 'CoreLibs\\Convert\\Byte' => $baseDir . '/lib/CoreLibs/Convert/Byte.php', - 'CoreLibs\\Convert\\Colors' => $baseDir . '/lib/CoreLibs/Convert/Colors.php', - 'CoreLibs\\Convert\\Encoding' => $baseDir . '/lib/CoreLibs/Convert/Encoding.php', - 'CoreLibs\\Convert\\Extends\\VarSetTypeMain' => $baseDir . '/lib/CoreLibs/Convert/Extends/VarSetTypeMain.php', - 'CoreLibs\\Convert\\Html' => $baseDir . '/lib/CoreLibs/Convert/Html.php', - 'CoreLibs\\Convert\\Json' => $baseDir . '/lib/CoreLibs/Convert/Json.php', - 'CoreLibs\\Convert\\Math' => $baseDir . '/lib/CoreLibs/Convert/Math.php', - 'CoreLibs\\Convert\\MimeAppName' => $baseDir . '/lib/CoreLibs/Convert/MimeAppName.php', - 'CoreLibs\\Convert\\MimeEncode' => $baseDir . '/lib/CoreLibs/Convert/MimeEncode.php', - 'CoreLibs\\Convert\\Strings' => $baseDir . '/lib/CoreLibs/Convert/Strings.php', - 'CoreLibs\\Convert\\VarSetType' => $baseDir . '/lib/CoreLibs/Convert/VarSetType.php', - 'CoreLibs\\Convert\\VarSetTypeNull' => $baseDir . '/lib/CoreLibs/Convert/VarSetTypeNull.php', - 'CoreLibs\\Create\\Email' => $baseDir . '/lib/CoreLibs/Create/Email.php', - 'CoreLibs\\Create\\Hash' => $baseDir . '/lib/CoreLibs/Create/Hash.php', - 'CoreLibs\\Create\\RandomKey' => $baseDir . '/lib/CoreLibs/Create/RandomKey.php', - 'CoreLibs\\Create\\Session' => $baseDir . '/lib/CoreLibs/Create/Session.php', - 'CoreLibs\\Create\\Uids' => $baseDir . '/lib/CoreLibs/Create/Uids.php', - 'CoreLibs\\DB\\Extended\\ArrayIO' => $baseDir . '/lib/CoreLibs/DB/Extended/ArrayIO.php', - 'CoreLibs\\DB\\IO' => $baseDir . '/lib/CoreLibs/DB/IO.php', - 'CoreLibs\\DB\\SQL\\PgSQL' => $baseDir . '/lib/CoreLibs/DB/SQL/PgSQL.php', - 'CoreLibs\\DB\\SQL\\SqlInterface\\SqlFunctions' => $baseDir . '/lib/CoreLibs/DB/SQL/SqlInterface/SqlFunctions.php', - 'CoreLibs\\Debug\\FileWriter' => $baseDir . '/lib/CoreLibs/Debug/FileWriter.php', - 'CoreLibs\\Debug\\Logging' => $baseDir . '/lib/CoreLibs/Debug/Logging.php', - 'CoreLibs\\Debug\\MemoryUsage' => $baseDir . '/lib/CoreLibs/Debug/MemoryUsage.php', - 'CoreLibs\\Debug\\RunningTime' => $baseDir . '/lib/CoreLibs/Debug/RunningTime.php', - 'CoreLibs\\Debug\\Support' => $baseDir . '/lib/CoreLibs/Debug/Support.php', - 'CoreLibs\\Get\\DotEnv' => $baseDir . '/lib/CoreLibs/Get/DotEnv.php', - 'CoreLibs\\Get\\ReadEnvFile' => $baseDir . '/lib/CoreLibs/Get/ReadEnvFile.php', - 'CoreLibs\\Get\\System' => $baseDir . '/lib/CoreLibs/Get/System.php', - 'CoreLibs\\Language\\Core\\CachedFileReader' => $baseDir . '/lib/CoreLibs/Language/Core/CachedFileReader.php', - 'CoreLibs\\Language\\Core\\FileReader' => $baseDir . '/lib/CoreLibs/Language/Core/FileReader.php', - 'CoreLibs\\Language\\Core\\GetTextReader' => $baseDir . '/lib/CoreLibs/Language/Core/GetTextReader.php', - 'CoreLibs\\Language\\Core\\StreamReader' => $baseDir . '/lib/CoreLibs/Language/Core/StreamReader.php', - 'CoreLibs\\Language\\Core\\StringReader' => $baseDir . '/lib/CoreLibs/Language/Core/StringReader.php', - 'CoreLibs\\Language\\Encoding' => $baseDir . '/lib/CoreLibs/Language/Encoding.php', - 'CoreLibs\\Language\\GetLocale' => $baseDir . '/lib/CoreLibs/Language/GetLocale.php', - 'CoreLibs\\Language\\L10n' => $baseDir . '/lib/CoreLibs/Language/L10n.php', - 'CoreLibs\\Output\\Form\\Elements' => $baseDir . '/lib/CoreLibs/Output/Form/Elements.php', - 'CoreLibs\\Output\\Form\\Generate' => $baseDir . '/lib/CoreLibs/Output/Form/Generate.php', - 'CoreLibs\\Output\\Form\\TableArraysInterface' => $baseDir . '/lib/CoreLibs/Output/TableArraysInterface.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditAccess' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditAccess.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditVisibleGroup' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditVisibleGroup.php', - 'CoreLibs\\Output\\Form\\Token' => $baseDir . '/lib/CoreLibs/Output/Form/Token.php', - 'CoreLibs\\Output\\Image' => $baseDir . '/lib/CoreLibs/Output/Image.php', - 'CoreLibs\\Output\\ProgressBar' => $baseDir . '/lib/CoreLibs/Output/ProgressBar.php', - 'CoreLibs\\Template\\SmartyExtend' => $baseDir . '/lib/CoreLibs/Template/SmartyExtend.php', 'FileUpload\\Core\\qqUploadedFile' => $baseDir . '/lib/FileUpload/Core/qqUploadedFile.php', 'FileUpload\\Core\\qqUploadedFileForm' => $baseDir . '/lib/FileUpload/Core/qqUploadedFileForm.php', 'FileUpload\\Core\\qqUploadedFileXhr' => $baseDir . '/lib/FileUpload/Core/qqUploadedFileXhr.php', diff --git a/www/vendor/composer/autoload_static.php b/www/vendor/composer/autoload_static.php index 681c4c9c..9022d031 100644 --- a/www/vendor/composer/autoload_static.php +++ b/www/vendor/composer/autoload_static.php @@ -9,71 +9,6 @@ class ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9 public static $classMap = array ( 'Autoloader\\Autoload' => __DIR__ . '/../..' . '/lib/autoloader.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'CoreLibs\\ACL\\Login' => __DIR__ . '/../..' . '/lib/CoreLibs/ACL/Login.php', - 'CoreLibs\\Admin\\Backend' => __DIR__ . '/../..' . '/lib/CoreLibs/Admin/Backend.php', - 'CoreLibs\\Admin\\EditBase' => __DIR__ . '/../..' . '/lib/CoreLibs/Admin/EditBase.php', - 'CoreLibs\\Basic' => __DIR__ . '/../..' . '/lib/CoreLibs/Basic.php', - 'CoreLibs\\Check\\Colors' => __DIR__ . '/../..' . '/lib/CoreLibs/Check/Colors.php', - 'CoreLibs\\Check\\Email' => __DIR__ . '/../..' . '/lib/CoreLibs/Check/Email.php', - 'CoreLibs\\Check\\Encoding' => __DIR__ . '/../..' . '/lib/CoreLibs/Check/Encoding.php', - 'CoreLibs\\Check\\File' => __DIR__ . '/../..' . '/lib/CoreLibs/Check/File.php', - 'CoreLibs\\Check\\Jason' => __DIR__ . '/../..' . '/lib/CoreLibs/Check/Jason.php', - 'CoreLibs\\Check\\Password' => __DIR__ . '/../..' . '/lib/CoreLibs/Check/Password.php', - 'CoreLibs\\Check\\PhpVersion' => __DIR__ . '/../..' . '/lib/CoreLibs/Check/PhpVersion.php', - 'CoreLibs\\Combined\\ArrayHandler' => __DIR__ . '/../..' . '/lib/CoreLibs/Combined/ArrayHandler.php', - 'CoreLibs\\Combined\\DateTime' => __DIR__ . '/../..' . '/lib/CoreLibs/Combined/DateTime.php', - 'CoreLibs\\Convert\\Byte' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Byte.php', - 'CoreLibs\\Convert\\Colors' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Colors.php', - 'CoreLibs\\Convert\\Encoding' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Encoding.php', - 'CoreLibs\\Convert\\Extends\\VarSetTypeMain' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Extends/VarSetTypeMain.php', - 'CoreLibs\\Convert\\Html' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Html.php', - 'CoreLibs\\Convert\\Json' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Json.php', - 'CoreLibs\\Convert\\Math' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Math.php', - 'CoreLibs\\Convert\\MimeAppName' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/MimeAppName.php', - 'CoreLibs\\Convert\\MimeEncode' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/MimeEncode.php', - 'CoreLibs\\Convert\\Strings' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/Strings.php', - 'CoreLibs\\Convert\\VarSetType' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/VarSetType.php', - 'CoreLibs\\Convert\\VarSetTypeNull' => __DIR__ . '/../..' . '/lib/CoreLibs/Convert/VarSetTypeNull.php', - 'CoreLibs\\Create\\Email' => __DIR__ . '/../..' . '/lib/CoreLibs/Create/Email.php', - 'CoreLibs\\Create\\Hash' => __DIR__ . '/../..' . '/lib/CoreLibs/Create/Hash.php', - 'CoreLibs\\Create\\RandomKey' => __DIR__ . '/../..' . '/lib/CoreLibs/Create/RandomKey.php', - 'CoreLibs\\Create\\Session' => __DIR__ . '/../..' . '/lib/CoreLibs/Create/Session.php', - 'CoreLibs\\Create\\Uids' => __DIR__ . '/../..' . '/lib/CoreLibs/Create/Uids.php', - 'CoreLibs\\DB\\Extended\\ArrayIO' => __DIR__ . '/../..' . '/lib/CoreLibs/DB/Extended/ArrayIO.php', - 'CoreLibs\\DB\\IO' => __DIR__ . '/../..' . '/lib/CoreLibs/DB/IO.php', - 'CoreLibs\\DB\\SQL\\PgSQL' => __DIR__ . '/../..' . '/lib/CoreLibs/DB/SQL/PgSQL.php', - 'CoreLibs\\DB\\SQL\\SqlInterface\\SqlFunctions' => __DIR__ . '/../..' . '/lib/CoreLibs/DB/SQL/SqlInterface/SqlFunctions.php', - 'CoreLibs\\Debug\\FileWriter' => __DIR__ . '/../..' . '/lib/CoreLibs/Debug/FileWriter.php', - 'CoreLibs\\Debug\\Logging' => __DIR__ . '/../..' . '/lib/CoreLibs/Debug/Logging.php', - 'CoreLibs\\Debug\\MemoryUsage' => __DIR__ . '/../..' . '/lib/CoreLibs/Debug/MemoryUsage.php', - 'CoreLibs\\Debug\\RunningTime' => __DIR__ . '/../..' . '/lib/CoreLibs/Debug/RunningTime.php', - 'CoreLibs\\Debug\\Support' => __DIR__ . '/../..' . '/lib/CoreLibs/Debug/Support.php', - 'CoreLibs\\Get\\DotEnv' => __DIR__ . '/../..' . '/lib/CoreLibs/Get/DotEnv.php', - 'CoreLibs\\Get\\ReadEnvFile' => __DIR__ . '/../..' . '/lib/CoreLibs/Get/ReadEnvFile.php', - 'CoreLibs\\Get\\System' => __DIR__ . '/../..' . '/lib/CoreLibs/Get/System.php', - 'CoreLibs\\Language\\Core\\CachedFileReader' => __DIR__ . '/../..' . '/lib/CoreLibs/Language/Core/CachedFileReader.php', - 'CoreLibs\\Language\\Core\\FileReader' => __DIR__ . '/../..' . '/lib/CoreLibs/Language/Core/FileReader.php', - 'CoreLibs\\Language\\Core\\GetTextReader' => __DIR__ . '/../..' . '/lib/CoreLibs/Language/Core/GetTextReader.php', - 'CoreLibs\\Language\\Core\\StreamReader' => __DIR__ . '/../..' . '/lib/CoreLibs/Language/Core/StreamReader.php', - 'CoreLibs\\Language\\Core\\StringReader' => __DIR__ . '/../..' . '/lib/CoreLibs/Language/Core/StringReader.php', - 'CoreLibs\\Language\\Encoding' => __DIR__ . '/../..' . '/lib/CoreLibs/Language/Encoding.php', - 'CoreLibs\\Language\\GetLocale' => __DIR__ . '/../..' . '/lib/CoreLibs/Language/GetLocale.php', - 'CoreLibs\\Language\\L10n' => __DIR__ . '/../..' . '/lib/CoreLibs/Language/L10n.php', - 'CoreLibs\\Output\\Form\\Elements' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/Elements.php', - 'CoreLibs\\Output\\Form\\Generate' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/Generate.php', - 'CoreLibs\\Output\\Form\\TableArraysInterface' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/TableArraysInterface.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditAccess' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditAccess.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php', - 'CoreLibs\\Output\\Form\\TableArrays\\EditVisibleGroup' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditVisibleGroup.php', - 'CoreLibs\\Output\\Form\\Token' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/Token.php', - 'CoreLibs\\Output\\Image' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Image.php', - 'CoreLibs\\Output\\ProgressBar' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/ProgressBar.php', - 'CoreLibs\\Template\\SmartyExtend' => __DIR__ . '/../..' . '/lib/CoreLibs/Template/SmartyExtend.php', 'FileUpload\\Core\\qqUploadedFile' => __DIR__ . '/../..' . '/lib/FileUpload/Core/qqUploadedFile.php', 'FileUpload\\Core\\qqUploadedFileForm' => __DIR__ . '/../..' . '/lib/FileUpload/Core/qqUploadedFileForm.php', 'FileUpload\\Core\\qqUploadedFileXhr' => __DIR__ . '/../..' . '/lib/FileUpload/Core/qqUploadedFileXhr.php', diff --git a/www/vendor/composer/installed.json b/www/vendor/composer/installed.json index 87fda747..3059d2dd 100644 --- a/www/vendor/composer/installed.json +++ b/www/vendor/composer/installed.json @@ -1,5 +1,18 @@ { - "packages": [], + "packages": [ + { + "name": "egrajp/corelibs-composer-all", + "version": "7.11.0", + "version_normalized": "7.11.0.0", + "dist": { + "type": "zip", + "url": "https://git.egplusww.jp/Composer/CoreLibs-Composer-All/archive/v7.11.0.zip" + }, + "type": "library", + "installation-source": "dist", + "install-path": "../egrajp/corelibs-composer-all" + } + ], "dev": true, "dev-package-names": [] } diff --git a/www/vendor/composer/installed.php b/www/vendor/composer/installed.php index 84b946fa..90d69724 100644 --- a/www/vendor/composer/installed.php +++ b/www/vendor/composer/installed.php @@ -1,6 +1,6 @@ array( - 'name' => 'gullevek/corelibs-dev', + 'name' => 'egrajp/corelibs-dev', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => NULL, @@ -10,7 +10,16 @@ 'dev' => true, ), 'versions' => array( - 'gullevek/corelibs-dev' => array( + 'egrajp/corelibs-composer-all' => array( + 'pretty_version' => '7.11.0', + 'version' => '7.11.0.0', + 'reference' => NULL, + 'type' => 'library', + 'install_path' => __DIR__ . '/../egrajp/corelibs-composer-all', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'egrajp/corelibs-dev' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => NULL, diff --git a/www/vendor/egrajp/corelibs-composer-all/composer.json b/www/vendor/egrajp/corelibs-composer-all/composer.json new file mode 100644 index 00000000..e756c9da --- /dev/null +++ b/www/vendor/egrajp/corelibs-composer-all/composer.json @@ -0,0 +1,19 @@ +{ + "name": "egrajp/corelibs-composer-all", + "description": "CoreLibs in a composer package", + "type": "library", + "license": "MIT", + "autoload": { + "psr-4": { + "Corelibs\\": "src/" + } + }, + "authors": [ + { + "name": "Clemens Schwaighofer", + "email": "clemens.schwaighofer@egplusww.com" + } + ], + "minimum-stability": "dev", + "require": {} +} diff --git a/www/vendor/egrajp/corelibs-composer-all/src/ACL/Login.php b/www/vendor/egrajp/corelibs-composer-all/src/ACL/Login.php new file mode 100644 index 00000000..c8be7b2f --- /dev/null +++ b/www/vendor/egrajp/corelibs-composer-all/src/ACL/Login.php @@ -0,0 +1,2213 @@ + width +* popup_y - if popup -> height +* online - page is online (user can access) +* query_string - string to paste for popup (will change) +* +* HISTORY: +* 2010/12/21 (cs) merge back password change interface +* 2010/12/17 (cs) change that password can be blowfish encrypted, +* auto detects if other encryption is used (md5, std des) +* and tries to use them +* 2007/05/29 (cs) BUG with assign query and visible sub arrays to pages +* 2005/09/21 (cs) if error -> unset the session vars +* 2005/07/04 (cs) add a function to write into the edit log file +* 2005/07/01 (cs) start adepting login class to new edit interface layout +* 2005/03/31 (cs) fixed the class call with all debug vars +* 2004/11/17 (cs) unused var cleanup +* 2004/11/16 (cs) rewrite login so it uses a template and not just plain html. +* prepare it, so it will be able to use external stuff later +* (some interface has to be designed for that +* 2004/11/16 (cs) removed the mobile html part from login +* 2004/09/30 (cs) layout fix +* 2003-11-11: if user has debug 1 unset memlimit, because there can be serious +* problems with the query logging +* 2003-06-12: added flag to PAGES array +* changed the get vars from GLOBALS to _POST +* changed the session registration. no more GLOBAL vars are registered +* only _SESSION["..."] +* 2003-06-09: added mobile phone login possibility +* 2003-03-04: droped ADMIN and added GROUP_LEVEL +* 2003-03-03: started to change the include file function collection +* to become a class +* 2003-02-28: various advances and changes, but far from perfect +* decided to change it into a class for easier handling +* add also possibility to change what will stored in the +* login session ? +* 2000-06-01: created basic idea and functions +*********************************************************************/ + +declare(strict_types=1); + +namespace CoreLibs\ACL; + +use CoreLibs\Check\Password; + +class Login +{ + /** @var string the user id var*/ + private $euid; + /** @var string _GET/_POST loginUserId parameter for non password login */ + private $login_user_id = ''; + /** @var string source, either _GET or _POST or empty */ + private $login_user_id_source = ''; + /** @var bool set to true if illegal characters where found in the login user id string */ + private $login_user_id_unclear = false; + // is set to one if login okay, or EUID is set and user is okay to access this page + /** @var bool */ + private $permission_okay = false; + /** @var string pressed login */ + private $login = ''; + /** @var string master action command */ + private $action; + /** @var string login name */ + private $username; + /** @var string login password */ + private $password; + /** @var string logout button */ + private $logout; + /** @var bool if this is set to true, the user can change passwords */ + private $password_change = false; + /** @var bool password change was successful */ + private $password_change_ok = false; + // can we reset password and mail to user with new password set screen + /** @var bool */ + private $password_forgot = false; + /** @var bool password forgot mail send ok */ + // private $password_forgot_ok = false; + /** @var string */ + private $change_password; + /** @var string */ + private $pw_username; + /** @var string */ + private $pw_old_password; + /** @var string */ + private $pw_new_password; + /** @var string */ + private $pw_new_password_confirm; + /** @var array array of users for which the password change is forbidden */ + private $pw_change_deny_users = []; + /** @var string */ + private $logout_target = ''; + /** @var int */ + private $max_login_error_count = -1; + /** @var array */ + private $lock_deny_users = []; + /** @var string */ + private $page_name = ''; + + /** @var int if we have password change we need to define some rules */ + private $password_min_length = 9; + /** @var int an true maxium min, can never be set below this */ + private $password_min_length_max = 9; + // max length is fixed as 255 (for input type max), if set highter + // it will be set back to 255 + /** @var int */ + private $password_max_length = 255; + /** @var array can have several regexes, if nothing set, all is ok */ + private $password_valid_chars = [ + // '^(?=.*\d)(?=.*[A-Za-z])[0-9A-Za-z!@#$%]{8,}$', + // '^(?.*(\pL)u)(?=.*(\pN)u)(?=.*([^\pL\pN])u).{8,}', + ]; + + // login error code, can be matched to the array login_error_msg, + // which holds the string + /** @var int */ + private $login_error = 0; + /** @var array all possible login error conditions */ + private $login_error_msg = []; + // this is an array holding all strings & templates passed + // rom the outside (translation) + /** @var array */ + private $login_template = [ + 'strings' => [], + 'password_change' => '', + 'template' => '' + ]; + + // acl vars + /** @var array */ + private $acl = []; + /** @var array */ + private $default_acl_list = []; + /** @var array Reverse list to lookup level from type */ + private $default_acl_list_type = []; + /** @var int default ACL level to be based on if nothing set */ + private $default_acl_level = 0; + // login html, if we are on an ajax page + /** @var string|null */ + private $login_html = ''; + /** @var bool */ + private $login_is_ajax_page = false; + + /** @var \CoreLibs\Debug\Logging logger */ + public $log; + /** @var \CoreLibs\DB\IO database */ + public $db; + /** @var \CoreLibs\Language\L10n language */ + public $l; + /** @var \CoreLibs\Create\Session session class */ + public $session; + + /** + * constructor, does ALL, opens db, works through connection checks, + * finishes itself + * + * @param \CoreLibs\DB\IO $db Database connection class + * @param \CoreLibs\Debug\Logging $log Logging class + * @param \CoreLibs\Create\Session $session Session interface class + * @param bool $auto_login [default true] Auto login flag, legacy + * If set to true will run login + * during construction + */ + public function __construct( + \CoreLibs\DB\IO $db, + \CoreLibs\Debug\Logging $log, + \CoreLibs\Create\Session $session, + bool $auto_login = true + ) { + // attach db class + $this->db = $db; + // log login data for this class only + $log->setLogPer('class', true); + // attach logger + $this->log = $log; + // attach session class + $this->session = $session; + + // string key, msg: string, flag: e (error), o (ok) + $this->login_error_msg = [ + '0' => [ + 'msg' => 'No error', + 'flag' => 'o' + ], + // actually obsolete + '100' => [ + 'msg' => '[EUID] came in as GET/POST!', + 'flag' => 'e', + ], + // query errors + '1009' => [ + 'msg' => 'Login query reading failed', + 'flag' => 'e', + ], + // user not found + '1010' => [ + 'msg' => 'Login Failed - Wrong Username or Password', + 'flag' => 'e' + ], + // blowfish password wrong + '1011' => [ + 'msg' => 'Login Failed - Wrong Username or Password', + 'flag' => 'e' + ], + // fallback md5 password wrong + '1012' => [ + 'msg' => 'Login Failed - Wrong Username or Password', + 'flag' => 'e' + ], + // new password_hash wrong + '1013' => [ + 'msg' => 'Login Failed - Wrong Username or Password', + 'flag' => 'e' + ], + '1101' => [ + 'msg' => 'Login Failed - Login User ID must be validated', + 'flag' => 'e' + ], + '1102' => [ + 'msg' => 'Login Failed - Login User ID is outside valid date range', + 'flag' => 'e' + ], + '102' => [ + 'msg' => 'Login Failed - Please enter username and password', + 'flag' => 'e' + ], + '103' => [ + 'msg' => 'You do not have the rights to access this Page', + 'flag' => 'e' + ], + '104' => [ + 'msg' => 'Login Failed - User not enabled', + 'flag' => 'e' + ], + '105' => [ + 'msg' => 'Login Failed - User is locked', + 'flag' => 'e' + ], + '106' => [ + 'msg' => 'Login Failed - User is deleted', + 'flag' => 'e' + ], + '107' => [ + 'msg' => 'Login Failed - User in locked via date period', + 'flag' => 'e' + ], + '108' => [ + 'msg' => 'Login Failed - User is locked via Login User ID', + 'flag' => 'e' + ], + '109' => [ + 'msg' => 'Check permission query reading failed', + 'flag' => 'e' + ], + // actually this is an illegal user, but I mask it + '220' => [ + 'msg' => 'Password change - The user could not be found', + 'flag' => 'e' + ], + '200' => [ + 'msg' => 'Password change - Please enter username and old password', + 'flag' => 'e' + ], + '201' => [ + 'msg' => 'Password change - The user could not be found', + 'flag' => 'e' + ], + '202' => [ + 'msg' => 'Password change - The old password is not correct', + 'flag' => 'e' + ], + '203' => [ + 'msg' => 'Password change - Please fill out both new password fields', + 'flag' => 'e' + ], + '204' => [ + 'msg' => 'Password change - The new passwords do not match', + 'flag' => 'e' + ], + // we should also not here WHAT is valid + '205' => [ + 'msg' => 'Password change - The new password is not in a valid format', + 'flag' => 'e' + ], + // for OK password change + '300' => [ + 'msg' => 'Password change successful', + 'flag' => 'o' + ], + // this is bad bad error + '9999' => [ + 'msg' => 'Necessary crypt engine could not be found. Login is impossible', + 'flag' => 'e' + ], + ]; + + // init default ACL list array + $_SESSION['DEFAULT_ACL_LIST'] = []; + $_SESSION['DEFAULT_ACL_LIST_TYPE'] = []; + // read the current edit_access_right list into an array + $q = "SELECT level, type, name FROM edit_access_right " + . "WHERE level >= 0 ORDER BY level"; + while (is_array($res = $this->db->dbReturn($q))) { + // level to description format (numeric) + $this->default_acl_list[$res['level']] = [ + 'type' => $res['type'], + 'name' => $res['name'] + ]; + $this->default_acl_list_type[$res['type']] = $res['level']; + } + // write that into the session + $_SESSION['DEFAULT_ACL_LIST'] = $this->default_acl_list; + $_SESSION['DEFAULT_ACL_LIST_TYPE'] = $this->default_acl_list_type; + + // this will be deprecated + if ($auto_login === true) { + $this->loginMainCall(); + } + } + + // ************************************************************************* + // **** PROTECTED INTERNAL + // ************************************************************************* + + /** + * Wrapper for exit calls + * + * @param int $code + * @return void + */ + protected function loginTerminate($code = 0): void + { + exit($code); + } + + /** + * return current page name + * + * @return string Current page name + */ + protected function loginReadPageName(): string + { + // set internal page name as is + return \CoreLibs\Get\System::getPageName(); + } + + /** + * print out login HTML via echo + * + * @return void + */ + protected function loginPrintLogin(): void + { + echo $this->loginGetLoginHTML(); + } + + // ************************************************************************* + // **** PRIVATE INTERNAL + // ************************************************************************* + + /** + * Checks for all flags and sets error codes for each + * In order: + * delete > enable > lock > period lock > login user id lock + * + * @param int $deleted User deleted check + * @param int $enabled User not enabled check + * @param int $locked Locked because of too many invalid passwords + * @param int $locked_period Locked because of time period set + * @param int $login_user_id_locked Locked from using Login User Id + * @return bool + */ + private function loginValidationCheck( + int $deleted, + int $enabled, + int $locked, + int $locked_period, + int $login_user_id_locked + ): bool { + $validation = false; + if ($deleted) { + // user is deleted + $this->login_error = 106; + } elseif (!$enabled) { + // user is not enabled + $this->login_error = 104; + } elseif ($locked) { + // user is locked, either set or auto set + $this->login_error = 105; + } elseif ($locked_period) { + // locked date trigger + $this->login_error = 107; + } elseif ($login_user_id_locked) { + // user is locked, either set or auto set + $this->login_error = 108; + } else { + $validation = true; + } + return $validation; + } + + /** + * checks if password is valid, sets internal error login variable + * + * @param string $hash password hash + * @param string $password submitted password + * @return bool true or false on password ok or not + */ + private function loginPasswordCheck(string $hash, string $password = ''): bool + { + // check with what kind of prefix the password begins: + // $2a$ or $2y$: BLOWFISCH + // $1$: MD5 + // $ and one alphanumeric letter, 13 chars long, but nor $ at the end: STD_DESC + // if no $ => normal password + // NOW, if we have a password encoded, but not the correct encoder available, throw special error + $password_ok = false; + if (!$password) { + $password = $this->password; + } + // first, errors on missing encryption + if ( + // below is all deprecated. all the ones below will always be true + // all the crypt standards are always set + // FIXME: remove this error code + /** @phpstan-ignore-next-line Why? */ + (preg_match("/^\\$2(a|y)\\$/", $hash) && CRYPT_BLOWFISH != 1) || + /** @phpstan-ignore-next-line Why? */ + (preg_match("/^\\$1\\$/", $hash) && CRYPT_MD5 != 1) || + /** @phpstan-ignore-next-line Why? */ + (preg_match("/^\\$[0-9A-Za-z.]{12}$/", $hash) && CRYPT_STD_DES != 1) + ) { + // this means password cannot be decrypted because of missing crypt methods + $this->login_error = 9999; + } elseif ( + preg_match("/^\\$2y\\$/", $hash) && + !Password::passwordVerify($password, $hash) + ) { + // this is the new password hash method, is only $2y$ + // all others are not valid anymore + $this->login_error = 1013; + } elseif ( + !preg_match("/^\\$2(a|y)\\$/", $hash) && + !preg_match("/^\\$1\\$/", $hash) && + !preg_match("/^\\$[0-9A-Za-z.]{12}$/", $hash) && + $hash != $password + ) { + // check old plain password, case sensitive + $this->login_error = 1012; + } else { + // all ok + $password_ok = true; + } + return $password_ok; + } + + /** + * Check if Login User ID is allowed to login + * + * @param int $login_user_id_valid_date + * @param int $login_user_id_revalidate + * @return bool + */ + private function loginLoginUserIdCheck( + int $login_user_id_valid_date, + int $login_user_id_revalidate + ): bool { + $login_id_ok = false; + if ($login_user_id_revalidate) { + $this->login_error = 1101; + } elseif (!$login_user_id_valid_date) { + $this->login_error = 1102; + } else { + $login_id_ok = true; + } + return $login_id_ok; + } + + /** + * if user pressed login button this script is called, + * but only if there is no preview euid set + * + * @return void has not return + */ + private function loginLoginUser(): void + { + // if pressed login at least and is not yet loggined in + if ($this->euid || (!$this->login && !$this->login_user_id)) { + return; + } + // if not username AND password where given + // OR no login_user_id + if (!($this->username && $this->password) && !$this->login_user_id) { + $this->login_error = 102; + $this->permission_okay = false; + return; + } + // have to get the global stuff here for setting it later + // we have to get the themes in here too + $q = "SELECT eu.edit_user_id, eu.username, eu.password, " + . "eu.edit_group_id, " + . "eg.name AS edit_group_name, admin, " + // login error + locked + . "eu.login_error_count, eu.login_error_date_last, " + . "eu.login_error_date_first, eu.strict, eu.locked, " + // date based lock + . "CASE WHEN (" + . "(eu.lock_until IS NULL " + . "OR (eu.lock_until IS NOT NULL AND NOW() >= eu.lock_until)) " + . "AND (eu.lock_after IS NULL " + . "OR (eu.lock_after IS NOT NULL AND NOW() <= eu.lock_after))" + . ") THEN 0::INT ELSE 1::INT END locked_period, " + // debug (legacy) + . "eu.debug, eu.db_debug, " + // enabled + . "eu.enabled, eu.deleted, " + // for checks only + . "eu.login_user_id, " + // login id validation + . "CASE WHEN (" + . "(eu.login_user_id_valid_from IS NULL " + . "OR (eu.login_user_id_valid_from IS NOT NULL AND NOW() >= eu.login_user_id_valid_from)) " + . "AND (eu.login_user_id_valid_until IS NULL " + . "OR (eu.login_user_id_valid_until IS NOT NULL AND NOW() <= eu.login_user_id_valid_until))" + . ") THEN 1::INT ELSE 0::INT END AS login_user_id_valid_date, " + // check if user must login + . "CASE WHEN eu.login_user_id_revalidate_after IS NOT NULL " + . "AND eu.login_user_id_revalidate_after > '0 days'::INTERVAL " + . "AND (eu.login_user_id_last_revalidate + eu.login_user_id_revalidate_after)::DATE " + . "<= NOW()::DATE " + . "THEN 1::INT ELSE 0::INT END AS login_user_id_revalidate, " + . "eu.login_user_id_locked, " + // language + . "el.short_name AS locale, el.iso_name AS encoding, " + // levels + . "eareu.level AS user_level, eareu.type AS user_type, " + . "eareg.level AS group_level, eareg.type AS group_type, " + // colors + . "first.header_color AS first_header_color, " + . "second.header_color AS second_header_color, second.template " + . "FROM edit_user eu " + . "LEFT JOIN edit_scheme second ON " + . "(second.edit_scheme_id = eu.edit_scheme_id AND second.enabled = 1), " + . "edit_language el, edit_group eg, " + . "edit_access_right eareu, " + . "edit_access_right eareg, " + . "edit_scheme first " + . "WHERE first.edit_scheme_id = eg.edit_scheme_id " + . "AND eu.edit_group_id = eg.edit_group_id " + . "AND eu.edit_language_id = el.edit_language_id " + . "AND eu.edit_access_right_id = eareu.edit_access_right_id " + . "AND eg.edit_access_right_id = eareg.edit_access_right_id " + . "AND " + // either login_user_id OR password must be given + . (!empty($this->login_user_id && empty($this->username)) ? + // check with login id if set and NO username + "eu.login_user_id = " . $this->db->dbEscapeLiteral($this->login_user_id) . " " : + // password match is done in script, against old plain or new blowfish encypted + "LOWER(username) = " . $this->db->dbEscapeLiteral(strtolower($this->username)) . " " + ); + // reset any query data that might exist + $this->db->dbCacheReset($q); + // never cache return data + $res = $this->db->dbReturn($q, $this->db::NO_CACHE); + // query was not run successful + if (!empty($this->db->dbGetLastError())) { + $this->login_error = 1009; + $this->permission_okay = false; + return; + } elseif (!is_array($res)) { + // username is wrong, but we throw for wrong username + // and wrong password the same error + $this->login_error = 1010; + $this->permission_okay = false; + return; + } + // if login errors is half of max errors and the last login error + // was less than 10s ago, forbid any new login try + + // check flow + // - user is enabled + // - user is not locked + // - password is readable + // - encrypted password matches + // - plain password matches + if ( + !$this->loginValidationCheck( + (int)$res['deleted'], + (int)$res['enabled'], + (int)$res['locked'], + (int)$res['locked_period'], + (int)$res['login_user_id_locked'] + ) + ) { + // error set in method (104, 105, 106, 107, 108) + } elseif ( + empty($this->username) && + !empty($this->login_user_id) && + !$this->loginLoginUserIdCheck( + (int)$res['login_user_id_valid_date'], + (int)$res['login_user_id_revalidate'] + ) + ) { + // check done in loginLoginIdCheck method + // aborts on must revalidate and not valid (date range) + } elseif ( + !empty($this->username) && + !$this->loginPasswordCheck($res['password']) + ) { + // none to be set, set in login password check + // this is not valid password input error here + // all error codes are set in loginPasswordCheck method + // also valid if login_user_id is ok + } else { + // check if the current password is an invalid hash and do a rehash and set password + // $this->debug('LOGIN', 'Hash: '.$res['password'].' -> VERIFY: ' + // .($Password::passwordVerify($this->password, $res['password']) ? 'OK' : 'FAIL') + // .' => HASH: '.(Password::passwordRehashCheck($res['password']) ? 'NEW NEEDED' : 'OK')); + if (Password::passwordRehashCheck($res['password'])) { + // update password hash to new one now + $q = "UPDATE edit_user " + . "SET password = '" . $this->db->dbEscapeString(Password::passwordSet($this->password)) + . "' WHERE edit_user_id = " . $res['edit_user_id']; + $this->db->dbExec($q); + } + // normal user processing + // set class var and session var + $_SESSION['EUID'] = $this->euid = $res['edit_user_id']; + // check if user is okay + $this->loginCheckPermissions(); + if ($this->login_error == 0) { + if ( + !empty($res['login_user_id']) && + !empty($this->username) && !empty($this->password) + ) { + $q = "UPDATE edit_user SET " + . "login_user_id_last_revalidate = NOW() " + . "WHERE edit_user_id = " . $this->euid; + $this->db->dbExec($q); + } + // now set all session vars and read page permissions + $_SESSION['DEBUG_ALL'] = $this->db->dbBoolean($res['debug']); + $_SESSION['DB_DEBUG'] = $this->db->dbBoolean($res['db_debug']); + // general info for user logged in + $_SESSION['USER_NAME'] = $res['username']; + $_SESSION['ADMIN'] = $res['admin']; + $_SESSION['GROUP_NAME'] = $res['edit_group_name']; + $_SESSION['USER_ACL_LEVEL'] = $res['user_level']; + $_SESSION['USER_ACL_TYPE'] = $res['user_type']; + $_SESSION['GROUP_ACL_LEVEL'] = $res['group_level']; + $_SESSION['GROUP_ACL_TYPE'] = $res['group_type']; + // deprecated TEMPLATE setting + $_SESSION['TEMPLATE'] = $res['template'] ? $res['template'] : ''; + $_SESSION['HEADER_COLOR'] = !empty($res['second_header_color']) ? + $res['second_header_color'] : + $res['first_header_color']; + // missing # before, this is for legacy data, will be deprecated + if (preg_match("/^[\dA-Fa-f]{6,8}$/", $_SESSION['HEADER_COLOR'])) { + $_SESSION['HEADER_COLOR'] = '#' . $_SESSION['HEADER_COLOR']; + } + // TODO: make sure that header color is valid: + // # + 6 hex + // # + 8 hex (alpha) + // rgb(), rgba(), hsl(), hsla() + // rgb: nnn.n for each + // hsl: nnn.n for first, nnn.n% for 2nd, 3rd + // Check\Colors::validateColor() + $_SESSION['LANG'] = $res['locale'] ?? 'en'; + $_SESSION['DEFAULT_CHARSET'] = $res['encoding'] ?? 'UTF-8'; + $_SESSION['DEFAULT_LOCALE'] = $_SESSION['LANG'] + . '.' . strtoupper($_SESSION['DEFAULT_CHARSET']); + $_SESSION['DEFAULT_LANG'] = $_SESSION['LANG'] . '_' + . strtolower(str_replace('-', '', $_SESSION['DEFAULT_CHARSET'])); + // reset any login error count for this user + if ($res['login_error_count'] > 0) { + $q = "UPDATE edit_user " + . "SET login_error_count = 0, login_error_date_last = NULL, " + . "login_error_date_first = NULL " + . "WHERE edit_user_id = " . $res['edit_user_id']; + $this->db->dbExec($q); + } + $edit_page_ids = []; + $pages = []; + $pages_acl = []; + // set pages access + $q = "SELECT ep.edit_page_id, ep.cuid, epca.cuid AS content_alias_uid, " + . "ep.hostname, ep.filename, ep.name AS edit_page_name, " + . "ep.order_number AS edit_page_order, ep.menu, " + . "ep.popup, ep.popup_x, ep.popup_y, ep.online, ear.level, ear.type " + . "FROM edit_page ep " + . "LEFT JOIN edit_page epca ON (epca.edit_page_id = ep.content_alias_edit_page_id)" + . ", edit_page_access epa, edit_access_right ear " + . "WHERE ep.edit_page_id = epa.edit_page_id " + . "AND ear.edit_access_right_id = epa.edit_access_right_id " + . "AND epa.enabled = 1 AND epa.edit_group_id = " . $res["edit_group_id"] . " " + . "ORDER BY ep.order_number"; + while ($res = $this->db->dbReturn($q)) { + if (!is_array($res)) { + break; + } + // page id array for sub data readout + $edit_page_ids[$res['edit_page_id']] = $res['cuid']; + // create the array for pages + $pages[$res['cuid']] = [ + 'edit_page_id' => $res['edit_page_id'], + 'cuid' => $res['cuid'], + // for reference of content data on a differen page + 'content_alias_uid' => $res['content_alias_uid'], + 'hostname' => $res['hostname'], + 'filename' => $res['filename'], + 'page_name' => $res['edit_page_name'], + 'order' => $res['edit_page_order'], + 'menu' => $res['menu'], + 'popup' => $res['popup'], + 'popup_x' => $res['popup_x'], + 'popup_y' => $res['popup_y'], + 'online' => $res['online'], + 'acl_level' => $res['level'], + 'acl_type' => $res['type'], + 'query' => [], + 'visible' => [] + ]; + // make reference filename -> level + $pages_acl[$res['filename']] = $res['level']; + } // for each page + // get the visible groups for all pages and write them to the pages + $q = "SELECT epvg.edit_page_id, name, flag " + . "FROM edit_visible_group evp, edit_page_visible_group epvg " + . "WHERE evp.edit_visible_group_id = epvg.edit_visible_group_id " + . "AND epvg.edit_page_id IN (" . join(', ', array_keys($edit_page_ids)) . ") " + . "ORDER BY epvg.edit_page_id"; + while (is_array($res = $this->db->dbReturn($q))) { + $pages[$edit_page_ids[$res['edit_page_id']]]['visible'][$res['name']] = $res['flag']; + } + // get the same for the query strings + $q = "SELECT eqs.edit_page_id, name, value, dynamic FROM edit_query_string eqs " + . "WHERE enabled = 1 AND edit_page_id " + . "IN (" . join(', ', array_keys($edit_page_ids)) . ") " + . "ORDER BY eqs.edit_page_id"; + while (is_array($res = $this->db->dbReturn($q))) { + $pages[$edit_page_ids[$res['edit_page_id']]]['query'][] = [ + 'name' => $res['name'], + 'value' => $res['value'], + 'dynamic' => $res['dynamic'] + ]; + } + // get the page content and add them to the page + $q = "SELECT epc.edit_page_id, epc.name, epc.uid, epc.order_number, " + . "epc.online, ear.level, ear.type " + . "FROM edit_page_content epc, edit_access_right ear " + . "WHERE epc.edit_access_right_id = ear.edit_access_right_id AND " + . "epc.edit_page_id IN (" . join(', ', array_keys($edit_page_ids)) . ") " + . "ORDER BY epc.order_number"; + while (is_array($res = $this->db->dbReturn($q))) { + $pages[$edit_page_ids[$res['edit_page_id']]]['content'][$res['uid']] = [ + 'name' => $res['name'], + 'uid' => $res['uid'], + 'online' => $res['online'], + 'order' => $res['order_number'], + // access name and level + 'acl_type' => $res['type'], + 'acl_level' => $res['level'] + ]; + } + // write back the pages data to the output array + $_SESSION['PAGES'] = $pages; + $_SESSION['PAGES_ACL_LEVEL'] = $pages_acl; + // load the edit_access user rights + $q = "SELECT ea.edit_access_id, level, type, ea.name, ea.color, ea.uid, edit_default " + . "FROM edit_access_user eau, edit_access_right ear, edit_access ea " + . "WHERE eau.edit_access_id = ea.edit_access_id " + . "AND eau.edit_access_right_id = ear.edit_access_right_id " + . "AND eau.enabled = 1 AND edit_user_id = " . $this->euid . " " + . "ORDER BY ea.name"; + $unit_access = []; + $eauid = []; + $unit_acl = []; + while (is_array($res = $this->db->dbReturn($q))) { + // read edit access data fields and drop them into the unit access array + $q_sub = "SELECT name, value " + . "FROM edit_access_data " + . "WHERE enabled = 1 AND edit_access_id = " . $res['edit_access_id']; + $ea_data = []; + while (is_array($res_sub = $this->db->dbReturn($q_sub))) { + $ea_data[$res_sub['name']] = $res_sub['value']; + } + // build master unit array + $unit_access[$res['edit_access_id']] = [ + 'id' => $res['edit_access_id'], + 'acl_level' => $res['level'], + 'acl_type' => $res['type'], + 'name' => $res['name'], + 'uid' => $res['uid'], + 'color' => $res['color'], + 'default' => $res['edit_default'], + 'data' => $ea_data + ]; + // set the default unit + if ($res['edit_default']) { + $_SESSION['UNIT_DEFAULT'] = $res['edit_access_id']; + } + $_SESSION['UNIT_UID'][$res['uid']] = $res['edit_access_id']; + // sub arrays for simple access + array_push($eauid, $res['edit_access_id']); + $unit_acl[$res['edit_access_id']] = $res['level']; + } + $_SESSION['UNIT'] = $unit_access; + $_SESSION['UNIT_ACL_LEVEL'] = $unit_acl; + $_SESSION['EAID'] = $eauid; + } // user has permission to THIS page + } // user was not enabled or other login error + if ($this->login_error && is_array($res)) { + $login_error_date_first = ''; + if ($res['login_error_count'] == 0) { + $login_error_date_first = ", login_error_date_first = NOW()"; + } + // update login error count for this user + $q = "UPDATE edit_user " + . "SET login_error_count = login_error_count + 1, " + . "login_error_date_last = NOW() " . $login_error_date_first . " " + . "WHERE edit_user_id = " . $res['edit_user_id']; + $this->db->dbExec($q); + // totally lock the user if error max is reached + if ( + $this->max_login_error_count != -1 && + $res['login_error_count'] + 1 > $this->max_login_error_count + ) { + // do some alert reporting in case this error is too big + // if strict is set, lock this user + // this needs manual unlocking by an admin user + if ($res['strict'] && !in_array($this->username, $this->lock_deny_users)) { + $q = "UPDATE edit_user SET locked = 1 WHERE edit_user_id = " . $res['edit_user_id']; + } + } + } + // if there was an login error, show login screen + if ($this->login_error) { + // reset the perm var, to confirm logout + $this->permission_okay = false; + } + } + + /** + * sets all the basic ACLs + * init set the basic acl the user has, based on the following rules + * - init set from config DEFAULT ACL + * - if page ACL is set, it overrides the default ACL + * - if group ACL is set, it overrides the page ACL + * - if user ACL is set, it overrides the group ACL + * set the page ACL + * - default ACL set + * - set group ACL if not default overrides default ACL + * - set page ACL if not default overrides group ACL + * set edit access ACL and set default edit access group + * - if an account ACL is set, set this parallel, account ACL overrides user ACL if it applies + * - if edit access ACL level is set, use this, else use page + * set all base ACL levels as a list keyword -> ACL number + * + * @return void has no return + */ + private function loginSetAcl(): void + { + // only set acl if we have permission okay + if (!$this->permission_okay) { + return; + } + // username (login), group name + $this->acl['user_name'] = $_SESSION['USER_NAME']; + $this->acl['group_name'] = $_SESSION['GROUP_NAME']; + // we start with the default acl + $this->acl['base'] = $this->default_acl_level; + + // set admin flag and base to 100 + if (!empty($_SESSION['ADMIN'])) { + $this->acl['admin'] = 1; + $this->acl['base'] = 100; + } else { + $this->acl['admin'] = 0; + // now go throw the flow and set the correct ACL + // user > page > group + // group ACL 0 + if ($_SESSION['GROUP_ACL_LEVEL'] != -1) { + $this->acl['base'] = $_SESSION['GROUP_ACL_LEVEL']; + } + // page ACL 1 + if ( + isset($_SESSION['PAGES_ACL_LEVEL'][$this->page_name]) && + $_SESSION['PAGES_ACL_LEVEL'][$this->page_name] != -1 + ) { + $this->acl['base'] = $_SESSION['PAGES_ACL_LEVEL'][$this->page_name]; + } + // user ACL 2 + if ($_SESSION['USER_ACL_LEVEL'] != -1) { + $this->acl['base'] = $_SESSION['USER_ACL_LEVEL']; + } + } + $_SESSION['BASE_ACL_LEVEL'] = $this->acl['base']; + + // set the current page acl + // start with base acl + // set group if not -1, overrides default + // set page if not -1, overrides group set + $this->acl['page'] = $this->acl['base']; + if ($_SESSION['GROUP_ACL_LEVEL'] != -1) { + $this->acl['page'] = $_SESSION['GROUP_ACL_LEVEL']; + } + if ( + isset($_SESSION['PAGES_ACL_LEVEL'][$this->page_name]) && + $_SESSION['PAGES_ACL_LEVEL'][$this->page_name] != -1 + ) { + $this->acl['page'] = $_SESSION['PAGES_ACL_LEVEL'][$this->page_name]; + } + + // PER ACCOUNT (UNIT/edit access)-> + foreach ($_SESSION['UNIT'] as $ea_id => $unit) { + // if admin flag is set, all units are set to 100 + if (!empty($this->acl['admin'])) { + $this->acl['unit'][$ea_id] = $this->acl['base']; + } else { + if ($unit['acl_level'] != -1) { + $this->acl['unit'][$ea_id] = $unit['acl_level']; + } else { + $this->acl['unit'][$ea_id] = $this->acl['base']; + } + } + // detail name/level set + $this->acl['unit_detail'][$ea_id] = [ + 'name' => $unit['name'], + 'uid' => $unit['uid'], + 'level' => $this->default_acl_list[$this->acl['unit'][$ea_id]]['name'] ?? -1, + 'default' => $unit['default'], + 'data' => $unit['data'] + ]; + // set default + if (!empty($unit['default'])) { + $this->acl['unit_id'] = $unit['id']; + $this->acl['unit_name'] = $unit['name']; + $this->acl['unit_uid'] = $unit['uid']; + } + } + // flag if to show extra edit access drop downs (because user has multiple groups assigned) + if (count($_SESSION['UNIT']) > 1) { + $this->acl['show_ea_extra'] = true; + } else { + $this->acl['show_ea_extra'] = false; + } + // set the default edit access + $this->acl['default_edit_access'] = $_SESSION['UNIT_DEFAULT'] ?? null; + // integrate the type acl list, but only for the keyword -> level + $this->acl['min'] = $this->default_acl_list_type; + // set the full acl list too (lookup level number and get level data) + $this->acl['acl_list'] = $this->default_acl_list; + // debug + // $this->debug('ACL', $this->print_ar($this->acl)); + } + + /** + * checks if the password is in a valid format + * + * @param string $password the new password + * @return bool true or false if valid password or not + */ + private function loginPasswordChangeValidPassword($password): bool + { + $is_valid_password = true; + // check for valid in regex arrays in list + if (is_array($this->password_valid_chars)) { + foreach ($this->password_valid_chars as $password_valid_chars) { + if (!preg_match("/$password_valid_chars/", $password)) { + $is_valid_password = false; + } + } + } + // check for min length + if ( + strlen($password) < $this->password_min_length || + strlen($password) > $this->password_max_length + ) { + $is_valid_password = false; + } + return $is_valid_password; + } + + /** + * dummy declare for password forget + * + * @return void has no return + */ + private function loginPasswordForgot(): void + { + // will do some password recovert, eg send email + } + + /** + * changes a user password + * + * @return void has no return + */ + private function loginPasswordChange(): void + { + // only continue if password change button pressed + if (!$this->change_password) { + return; + } + $event = 'Password Change'; + $data = ''; + // check that given username is NOT in the deny list, else silent skip (with error log) + if (!in_array($this->pw_username, $this->pw_change_deny_users)) { + // init the edit user id variable + $edit_user_id = ''; + // cehck if either username or old password is not set + if (!$this->pw_username || !$this->pw_old_password) { + $this->login_error = 200; + $data = 'Missing username or old password.'; + } + // check user exist, if not -> error + if (!$this->login_error) { + $q = "SELECT edit_user_id " + . "FROM edit_user " + . "WHERE enabled = 1 " + . "AND username = '" . $this->db->dbEscapeString($this->pw_username) . "'"; + $res = $this->db->dbReturnRow($q); + if ( + !is_array($res) || + (is_array($res) && empty($res['edit_user_id'])) + ) { + // username wrong + $this->login_error = 201; + $data = 'User could not be found'; + } + } + // check old passwords match -> error + if (!$this->login_error) { + $q = "SELECT edit_user_id, password " + . "FROM edit_user " + . "WHERE enabled = 1 " + . "AND username = '" . $this->db->dbEscapeString($this->pw_username) . "'"; + $edit_user_id = ''; + $res = $this->db->dbReturnRow($q); + if (is_array($res)) { + $edit_user_id = $res['edit_user_id']; + } + if ( + !is_array($res) || + (is_array($res) && + (empty($res['edit_user_id']) || + !$this->loginPasswordCheck($res['old_password_hash'], $this->pw_old_password))) + ) { + // old password wrong + $this->login_error = 202; + $data = 'The old password does not match'; + } + } + // check if new passwords were filled out -> error + if (!$this->login_error) { + if (!$this->pw_new_password || !$this->pw_new_password_confirm) { + $this->login_error = 203; + $data = 'Missing new password or new password confirm.'; + } + } + // check new passwords both match -> error + if (!$this->login_error) { + if ($this->pw_new_password != $this->pw_new_password_confirm) { + $this->login_error = 204; + $data = 'The new passwords do not match'; + } + } + // password shall match to something in minimum length or form + if (!$this->login_error) { + if (!$this->loginPasswordChangeValidPassword($this->pw_new_password)) { + $this->login_error = 205; + $data = 'The new password string is not valid'; + } + } + // no error change this users password + if (!$this->login_error && $edit_user_id) { + // update the user (edit_user_id) with the new password + $q = "UPDATE edit_user " + . "SET password = " + . "'" . $this->db->dbEscapeString(Password::passwordSet($this->pw_new_password)) . "' " + . "WHERE edit_user_id = " . $edit_user_id; + $this->db->dbExec($q); + $data = 'Password change for user "' . $this->pw_username . '"'; + $this->password_change_ok = true; + } + } else { + // illegal user error + $this->login_error = 220; + $data = 'Illegal user for password change: ' . $this->pw_username; + } + // log this password change attempt + $this->writeLog($event, $data, $this->login_error, $this->pw_username); + } + + /** + * creates the login html part if no permission (error) is set + * this does not print anything yet + * + * @return string|null html data for login page, or null for nothing + */ + private function loginCreateLoginHTML() + { + $html_string = null; + // if permission is ok, return null + if ($this->permission_okay) { + return $html_string; + } + // set the templates now + $this->loginSetTemplates(); + // if there is a global logout target ... + if (file_exists($this->logout_target)) { + $LOGOUT_TARGET = $this->logout_target; + } else { + $LOGOUT_TARGET = ''; + } + + $html_string = (string)$this->login_template['template']; + + $locales = $this->l->parseLocale($this->l->getLocale()); + $this->login_template['strings']['LANGUAGE'] = $locales['lang'] ?? 'en'; + + // if password change is okay + if ($this->password_change) { + $html_string_password_change = $this->login_template['password_change']; + + // pre change the data in the PASSWORD_CHANGE_DIV first + foreach ($this->login_template['strings'] as $string => $data) { + if ($data) { + $html_string_password_change = str_replace( + '{' . $string . '}', + $data, + $html_string_password_change + ); + } + } + // print error messagae + if ($this->login_error) { + $html_string_password_change = str_replace( + '{ERROR_MSG}', + $this->loginGetErrorMsg($this->login_error) . '
', + $html_string_password_change + ); + } else { + $html_string_password_change = str_replace( + '{ERROR_MSG}', + '
', + $html_string_password_change + ); + } + // if pw change action, show the float again + if ($this->change_password && !$this->password_change_ok) { + $html_string_password_change = str_replace( + '{PASSWORD_CHANGE_SHOW}', + '', + $html_string_password_change + ); + } else { + $html_string_password_change = str_replace( + '{PASSWORD_CHANGE_SHOW}', + '', + $html_string_password_change + ); + } + $this->login_template['strings']['PASSWORD_CHANGE_DIV'] = $html_string_password_change; + } + + // put in the logout redirect string + if ($this->logout && $LOGOUT_TARGET) { + $html_string = str_replace( + '{LOGOUT_TARGET}', + '', + $html_string + ); + } else { + $html_string = str_replace('{LOGOUT_TARGET}', '', $html_string); + } + + // print error messagae + if ($this->login_error) { + $html_string = str_replace( + '{ERROR_MSG}', + $this->loginGetErrorMsg($this->login_error) . '
', + $html_string + ); + } elseif ($this->password_change_ok && $this->password_change) { + $html_string = str_replace( + '{ERROR_MSG}', + $this->loginGetErrorMsg(300) . '
', + $html_string + ); + } else { + $html_string = str_replace('{ERROR_MSG}', '
', $html_string); + } + + // create the replace array context + foreach ($this->login_template['strings'] as $string => $data) { + $html_string = str_replace('{' . $string . '}', $data, $html_string); + } + // return the created HTML here + return $html_string; + } + + /** + * last function called, writes log and prints out error msg and + * exists script if permission 0 + * + * @return bool true on permission ok, false on permission wrong + */ + private function loginCloseClass(): bool + { + // write to LOG table ... + if ($this->login_error || $this->login || $this->logout) { + $username = ''; + // $password = ''; + // set event + if ($this->login) { + $event = 'Login'; + } elseif ($this->logout) { + $event = 'Logout'; + } else { + $event = 'No Permission'; + } + // prepare for log + if ($this->euid) { + // get user from user table + $q = "SELECT username FROM edit_user WHERE edit_user_id = " . $this->euid; + $username = ''; + if (is_array($res = $this->db->dbReturnRow($q))) { + $username = $res['username']; + } + } // if euid is set, get username (or try) + $this->writeLog($event, '', $this->login_error, $username); + } // write log under certain settings + // now close DB connection + // $this->error_msg = $this->_login(); + if (!$this->permission_okay) { + return false; + } else { + return true; + } + } + + /** + * checks if there are external templates, if not uses internal fallback ones + * + * @return void has no return + */ + private function loginSetTemplates(): void + { + $strings = [ + 'HTML_TITLE' => $this->l->__('LOGIN'), + 'TITLE' => $this->l->__('LOGIN'), + 'USERNAME' => $this->l->__('Username'), + 'PASSWORD' => $this->l->__('Password'), + 'LOGIN' => $this->l->__('Login'), + 'ERROR_MSG' => '', + 'LOGOUT_TARGET' => '', + 'PASSWORD_CHANGE_BUTTON_VALUE' => $this->l->__('Change Password') + ]; + + // if password change is okay + if ($this->password_change) { + $strings = array_merge($strings, [ + 'TITLE_PASSWORD_CHANGE' => 'Change Password for User', + 'OLD_PASSWORD' => $this->l->__('Old Password'), + 'NEW_PASSWORD' => $this->l->__('New Password'), + 'NEW_PASSWORD_CONFIRM' => $this->l->__('New Password confirm'), + 'CLOSE' => $this->l->__('Close'), + 'JS_SHOW_HIDE' => "function ShowHideDiv(id) { " + . "element = document.getElementById(id); " + . "if (element.className == 'visible' || !element.className) element.className = 'hidden'; " + . "else element.className = 'visible'; }", + 'PASSWORD_CHANGE_BUTTON' => '' + ]); + // TODO: submit or JS to set target page as ajax call + // NOTE: for the HTML block I ignore line lengths + // phpcs:disable + $this->login_template['password_change'] = <<