Commits vergleichen

...

149 Commits

Autor SHA1 Nachricht Datum
o.pinke f8ac1fe90d add missing function and doc comments 2024-04-22 15:50:14 +02:00
o.pinke bdabf086af recode of functions.api.images.php 2024-04-22 15:41:18 +02:00
o.pinke 7dbcb40790 cleanup 2024-04-22 15:40:17 +02:00
o.pinke 95444fed6a new file doc block 2024-04-22 15:05:07 +02:00
o.pinke 8e3c1d979b php8 updates 2024-04-22 15:04:37 +02:00
o.pinke 92181aba97 fix upload delete 2024-04-12 20:35:30 +02:00
o.pinke 4d65fba9dc undo PHP8 fixes 2024-04-12 20:32:40 +02:00
o.pinke a8f68477fa PHP8 fixes 2024-04-12 20:28:17 +02:00
o.pinke 1e898500d3 PHP8 fixes 2024-04-12 20:24:33 +02:00
o.pinke ca841298f4 PHP8 fix fatal error 2024-04-11 15:33:48 +02:00
Ortwin Pinke 28b037b0a5 Merge pull request 'feature/make-logrotation-switchable-#9' (#50) from feature/make-logrotation-switchable-#9 into develop
Reviewed-on: #50
2024-03-12 18:26:55 +00:00
o.pinke 12a87f3f4d delete unused log classes 2024-03-12 19:20:06 +01:00
o.pinke 754c174e9d use new log class 2024-03-12 19:19:19 +01:00
o.pinke 24ba3bdb26 add custom settings 2024-03-12 19:05:19 +01:00
o.pinke 8c693ec00c remove deprecation call 2024-03-12 19:04:59 +01:00
o.pinke cfeb2c7bc3 remove var dump 2024-03-12 18:02:50 +01:00
o.pinke cb89e4477b optimize code 2024-03-12 16:13:38 +01:00
o.pinke a6ee04a0bb add log class usage for cronjobs 2024-03-12 15:59:57 +01:00
o.pinke 910d246945 remove functions for older php versions 2024-03-12 15:59:14 +01:00
o.pinke 3be4baf751 fix return type 2024-03-12 09:42:02 +01:00
o.pinke 96b264defa recode for PHP 8 2024-03-12 09:36:48 +01:00
o.pinke 1eb4c86d57 add functionality 2024-03-12 09:24:04 +01:00
o.pinke e99363f44a update autoloader 2024-03-12 08:48:10 +01:00
o.pinke ed6b5569fd new exceptions and handler for log writer file 2024-03-11 15:47:48 +01:00
o.pinke a34f26177e fix for german umlaute 2024-03-11 15:33:21 +01:00
o.pinke ea2fbc499a init new log writer stuff psr-4 compatible 2024-03-11 15:29:03 +01:00
o.pinke 824e1f1625 init exception handling 2024-03-11 15:28:14 +01:00
o.pinke 9adbbdd164 fix typing and doc 2024-03-11 15:27:47 +01:00
o.pinke 9d5af6dc52 gitadmin 2024-03-11 13:52:17 +01:00
o.pinke bbf4fe66b2 idea settings 2024-03-11 13:51:03 +01:00
Ortwin Pinke 1f807f13ef .idea/workspace.xml gelöscht 2024-03-11 12:43:22 +00:00
o.pinke df76ce462a set default for param 2024-03-05 16:28:04 +01:00
o.pinke 33e941aecf recode 2024-02-26 10:20:31 +01:00
Ortwin Pinke 1419bbf701 .idea 2023-10-24 13:27:01 +02:00
Ortwin Pinke b185332a35 composer stuff 2023-10-24 13:26:10 +02:00
o.pinke 6b98e3a4f5 update readme 2023-10-17 11:51:11 +02:00
Ortwin Pinke 1c94d40e04 Merge pull request 'Increase develop-branch to PHP8' (#47) from dev_php82 into develop
Reviewed-on: #47
2023-10-16 16:08:58 +00:00
o.pinke f016933445 Merge branch 'develop' into dev_php82
# Conflicts:
#	.idea/php.xml
#	.idea/phpunit.xml
#	README.md
#	conlite/plugins/cl-mod-rewrite
#	setup/lib/defines.php
2023-10-16 18:07:44 +02:00
o.pinke 3a71ed5cf1 composer 2023-10-16 18:07:02 +02:00
o.pinke 12e58c78ef Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	.idea/php.xml
#	.idea/vcs.xml
2023-10-16 18:02:31 +02:00
Ortwin Pinke 449cc39cdc Merge pull request 'add frontend path to template generation' (#46) from bugfix/missing-template-#43 into develop
Reviewed-on: #46
2023-10-14 15:05:34 +00:00
o.pinke 23538e80bb #43 - fixed 2023-10-14 17:03:16 +02:00
o.pinke a397b65fcd rm netbeans project 2023-10-11 18:02:07 +02:00
o.pinke 71e13f626e gdlib fixes 2023-10-11 17:49:33 +02:00
o.pinke 2c999a7048 composer 2023-10-11 17:33:01 +02:00
Ortwin Pinke 6a28bd3eaf Merge pull request 'feature/recode-genericdb-php8' (#44) from feature/recode-genericdb-php8 into dev_php82
Reviewed-on: #44
2023-10-11 15:29:53 +00:00
o.pinke dfdbecba7e settings 2023-10-11 17:25:50 +02:00
o.pinke 95d401cb1e composer 2023-10-11 17:25:13 +02:00
o.pinke 9d2f901385 settings 2023-10-11 17:23:33 +02:00
Ortwin Pinke 5b8e93788b idea files (?) 2023-07-27 19:12:05 +02:00
Ortwin Pinke 10a1832a5a add twig template engine 2023-07-27 19:10:37 +02:00
Ortwin Pinke 764991d239 fix not saving javascript in code 2023-07-27 19:04:46 +02:00
Ortwin Pinke 8c65d7a755 add error variable 2023-07-27 16:10:28 +02:00
Ortwin Pinke 9d934b81f9 fix path for http check config 2023-07-27 16:09:35 +02:00
Ortwin Pinke 68bcdc4c1d fix add new language 2023-07-22 18:35:31 +02:00
Ortwin Pinke 8f8553996e fix add new client 2023-07-22 18:19:42 +02:00
Ortwin Pinke 60c61a86f9 use new genericdb with composer autoload 2023-07-22 17:44:00 +02:00
o.pinke ccff65a4e9 optimize rector by using conlite autoloader 2023-07-19 18:43:26 +02:00
o.pinke a96777d29c fix PHP8 2023-07-19 18:33:52 +02:00
o.pinke a8926c1723 PHP 8 updates and fixes 2023-07-19 15:33:17 +02:00
o.pinke 513e575a41 fix missing return statement 2023-07-18 22:13:15 +02:00
o.pinke 53e6a7a47f fix use statements 2023-07-18 22:11:37 +02:00
o.pinke 8ec4add782 add new psr-4 optimized html class files WIP 2023-07-18 22:10:00 +02:00
o.pinke 01255ad980 new rector conf and checked files 2023-07-18 22:09:07 +02:00
o.pinke c9eaa03cd0 remove old genericdb 2023-07-18 22:08:28 +02:00
o.pinke 5ccdc05e6b fix errors with new genericdb 2023-07-18 22:08:17 +02:00
o.pinke 613c95ad70 remove old genericdb 2023-07-18 22:07:47 +02:00
o.pinke 210091ad9b add new genericdb optimized for PHP8+ 2023-07-18 22:07:14 +02:00
o.pinke 680b5bad71 fix php8 errors 2023-07-07 13:48:07 +02:00
o.pinke 35fe2dd066 toggle to PSR-4 for ConLite 2023-07-06 20:18:52 +02:00
o.pinke 727cad0e1e toggle sort direction of user plugins 2023-07-04 20:17:03 +02:00
o.pinke 28acb7f004 use html5 datetime field 2023-07-04 20:04:48 +02:00
o.pinke 0b20d638f6 fix and closes #42 2023-07-04 20:00:39 +02:00
o.pinke dd79ad7e59 add todo 2023-07-04 17:19:57 +02:00
o.pinke 05327f3518 fix typos, regenerate composer files 2023-07-04 17:18:12 +02:00
o.pinke 46c1c1c3c3 fix typo and typehint 2023-07-04 17:09:34 +02:00
Ortwin Pinke 2e386d7c41 add log path 2023-06-15 20:44:01 +02:00
Ortwin Pinke 70b845ca58 fixes setup php 8.2 'new installation' 2023-05-30 10:51:44 +02:00
Ortwin Pinke 4b69f07b8f fixes setup php 8.2 'new installation' 2023-05-30 09:46:38 +02:00
Ortwin Pinke 41c69d53fe fixed missing images in setup
fixed php8 errors
2023-05-30 06:28:22 +02:00
Ortwin Pinke 629983db56 add default vendor folder 2023-05-05 19:33:04 +02:00
Ortwin Pinke 8798c805f6 add globals 2023-05-05 09:20:09 +02:00
Ortwin Pinke d491725779 fixes php8 2023-05-05 09:17:38 +02:00
o.pinke d589909e87 fix #38 2023-04-26 16:05:52 +02:00
o.pinke 8909189c91 gitadmin 2023-04-26 14:52:05 +02:00
o.pinke cf0eecefb4 gitadmin 2023-04-26 14:44:46 +02:00
o.pinke 12637e8f24 gitadmin 2023-04-25 21:27:14 +02:00
o.pinke 88cfcbd342 updates for php8 2023-04-25 19:54:58 +02:00
o.pinke 068c042318 Merge remote-tracking branch 'origin/dev_php82' into dev_php82
# Conflicts:
#	.gitignore
#	.idea/modules.xml
#	.idea/php.xml
#	.idea/phpunit.xml
#	.idea/vcs.xml
#	composer.json
#	composer.lock
#	conlite/external/autoload.php
#	conlite/external/composer/autoload_classmap.php
#	conlite/external/composer/autoload_psr4.php
#	conlite/external/composer/autoload_static.php
#	conlite/external/composer/installed.json
#	conlite/external/composer/installed.php
#	conlite/external/composer/platform_check.php
#	conlite/external/phpmailer/phpmailer/VERSION
#	conlite/external/phpmailer/phpmailer/composer.json
#	conlite/external/phpmailer/phpmailer/get_oauth_token.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ar.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-az.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ba.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-be.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-bg.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ca.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-cs.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-da.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-de.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-el.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-eo.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-es.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-et.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fa.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fi.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fo.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-fr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-gl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-he.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hu.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-hy.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-id.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-it.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ja.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ka.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ko.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-lt.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-lv.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ms.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-nb.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-nl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pt.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ro.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-ru.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sk.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sl.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-sv.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-tr.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-uk.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-vi.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-zh.php
#	conlite/external/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php
#	conlite/external/phpmailer/phpmailer/src/SMTP.php
2023-04-25 19:12:49 +02:00
o.pinke a54fbde1c3 gitadmin 2023-04-25 19:10:42 +02:00
o.pinke 82dca3c1e2 add rector.php 2023-04-25 19:07:47 +02:00
o.pinke 57db5e9fde move composer vendor folder 2023-04-25 19:05:32 +02:00
o.pinke aa34d49978 fixed readme file 2023-04-17 20:20:59 +02:00
Ortwin Pinke b438f15708 fixes php8 2023-04-07 19:50:44 +02:00
Ortwin Pinke fcda0a460b composer update 2023-04-07 18:32:06 +02:00
Ortwin Pinke 219d52f739 composer update 2023-04-07 18:18:28 +02:00
Ortwin Pinke bf4c753342 add .idea file 2023-04-07 18:15:15 +02:00
Ortwin Pinke 1a3475b305 add .idea file 2023-04-07 18:15:06 +02:00
Ortwin Pinke 903dbf8d42 composer updates, add .idea folder 2023-04-07 18:14:09 +02:00
o.pinke 625c6ab405 fixed wrong date expression for published 2023-03-03 11:07:06 +01:00
o.pinke 7ecf03870a fixed js error 2023-03-03 10:37:53 +01:00
o.pinke fc6ea7746d handle empty or nulled content 2023-03-03 09:02:11 +01:00
o.pinke 606f48500f fix PHP8 errors 2023-03-03 08:52:50 +01:00
o.pinke 85d3f956e8 fix PHP8 errors 2023-03-02 19:45:37 +01:00
o.pinke dfcc174626 fix get_file with PHP 8 2023-02-23 12:53:23 +01:00
o.pinke 7c69afa326 temporary fix for inuse message if a module is
used for body tag in layout
2023-02-22 20:10:59 +01:00
o.pinke 6729446154 bugfixes search and keywords generation 2023-02-22 15:34:23 +01:00
o.pinke 434b483fac set flags to php8.1 standard 2023-02-21 15:33:03 +01:00
o.pinke fa3c96b94d param with type|null 2023-02-21 13:23:36 +01:00
o.pinke 7638a62ace always string in $sCode 2023-02-19 10:41:40 +01:00
o.pinke 1ff067d615 always string in $sCode 2023-02-19 10:39:09 +01:00
o.pinke 90dbc01650 always string in $sCode 2023-02-19 10:30:38 +01:00
o.pinke 33dcc58748 always return string 2023-02-19 10:00:57 +01:00
o.pinke 4aba95edd1 fix PHP8 errors 2023-02-17 15:38:31 +01:00
o.pinke b199edaf8e gitadmin 2023-02-17 15:18:01 +01:00
o.pinke 6847130805 add new methods, cleanup, PHP8 fixes 2023-02-17 15:17:20 +01:00
o.pinke 44382f8da0 increase CL version 2023-02-17 15:14:57 +01:00
o.pinke 965c7054f4 increase CL version 2023-02-17 15:14:30 +01:00
o.pinke 97a3370258 remove pear stuff, fix php8.x issues 2023-02-17 15:13:58 +01:00
o.pinke 9367766e7d remove old php5 support 2023-02-17 15:10:36 +01:00
o.pinke d1528111e2 add default to option var;
typo
2023-02-15 11:58:35 +01:00
o.pinke 106f003bfa bugfix variable 2023-02-15 11:56:45 +01:00
o.pinke 6f0385f4ba bugfixes HTML-Elements and cHTML 2023-02-12 12:59:50 +01:00
o.pinke 0589fd287e fixed bug with empty description 2023-02-10 11:55:27 +01:00
o.pinke c0e250a21f fixed bug with empty description 2023-02-10 11:52:16 +01:00
o.pinke efa03003be fixed bug with empty file information array 2023-02-10 11:45:26 +01:00
o.pinke d3e73bfe0a add utf8_encode to out filter of item class; 2023-02-10 11:43:45 +01:00
o.pinke af5bf9be94 gitadmin: add ignore 2023-02-10 11:06:45 +01:00
o.pinke 3f15c205a0 remove end tag php 2023-02-10 11:03:53 +01:00
o.pinke 7ca3bf10bb recode wrapper functions;
fixed encoding problems in mod translate;
change handling for encoding and charset in page widget
2023-02-10 10:57:30 +01:00
o.pinke 34d2c9ca2a setup: add local defines file 2023-02-09 08:11:56 +01:00
o.pinke 3d1a930809 Merge origin/dev_php82 into dev_php82 2023-02-06 11:51:21 +01:00
o.pinke a919480ca7 gitadmin 2023-02-06 11:48:16 +01:00
o.pinke 106f7bbcff Merge remote-tracking branch 'origin/dev_php8' into dev_php82
Conflicts:
	conlite/classes/class.xmlparser.php
	conlite/classes/contenido/class.module.php
	data/config/production/config.autoloader.php
2023-02-06 11:39:37 +01:00
o.pinke 81638e9b7e gitadmin 2023-02-05 05:43:06 +01:00
o.pinke d9a191eeab rename xmlparser 2023-02-05 05:37:11 +01:00
o.pinke 9b6a6268f0 rename xmlparser 2023-02-05 05:36:53 +01:00
Ortwin Pinke aa22765927 replace deprecated function 2022-12-20 20:00:10 +01:00
Ortwin Pinke ba6d871ec0 replace deprecated utf8_decode() 2022-12-20 19:54:19 +01:00
Ortwin Pinke b66c6fcf71 fix deprecations 2022-12-20 19:43:48 +01:00
Ortwin Pinke ec6c0cb788 fix deprecations 2022-12-20 19:42:45 +01:00
Ortwin Pinke 135238dc01 fix deprecations 2022-12-20 19:39:42 +01:00
Ortwin Pinke 0a4330bbf0 change visibility of class var 2022-12-20 19:37:30 +01:00
Ortwin Pinke e7077870e3 change visibility of class var 2022-12-20 19:36:01 +01:00
Ortwin Pinke 1fea4e1eac fix deprecations 2022-12-20 19:32:53 +01:00
Ortwin Pinke 5f1af41450 fix deprecations 2022-12-16 18:37:03 +01:00
Ortwin Pinke 58b47350e1 fix deprecations 2022-12-16 18:31:12 +01:00
Ortwin Pinke 10f55120eb fix deprecations 2022-12-16 18:29:44 +01:00
Ortwin Pinke 102acd14f5 set max php to 8.3 2022-12-16 18:24:29 +01:00
522 geänderte Dateien mit 37036 neuen und 33424 gelöschten Zeilen

4
.gitignore vendored
Datei anzeigen

@ -1,4 +1,5 @@
/nbproject/private/
/.idea/workspace.xml
/data/config/production/config.php
/_dev/
/conlite/plugins/pluginmanager/_src
@ -17,8 +18,9 @@
/cms/dflip/
/cms/js/firstlevel/
/conlite/external/**/.git
/dievino/
/conlite/logs/debug.log
/cms/data/config/production/config.mod_rewrite.php
/cms/data/config/production/config.local.php
/cms/cache/*
composer.phar
/conlite/vendor/

3
.gitmodules vendored
Datei anzeigen

@ -1,6 +1,3 @@
[submodule "conlite/plugins/cl-mod-rewrite"]
path = conlite/plugins/cl-mod-rewrite
url = https://gitport.de/ConLite/cl-mod-rewrite.git
[submodule "conlite/plugins/cl-newsletter"]
path = conlite/plugins/cl-newsletter
url = https://gitport.de/ConLite/cl-newsletter.git

64
.idea/ConLite.iml Normale Datei
Datei anzeigen

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/conlite/external" isTestSource="false" packagePrefix="Conlite\External\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/src" isTestSource="false" packagePrefix="Endroid\QrCode\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/tests" isTestSource="true" packagePrefix="Endroid\QrCode\Tests\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer/src" isTestSource="false" packagePrefix="PHPMailer\PHPMailer\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer/test" isTestSource="true" packagePrefix="PHPMailer\Test\" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/composer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/images" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/langs" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/plugins" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/edit_area/reg_syntax" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/cache" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/css" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/data" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/images" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/includes" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/js" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/logs" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/templates" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/frontend/upload" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/nikic/php-parser" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpqrcode/bindings" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpqrcode/tools" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpstan/phpstan" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-invoker" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/rector/rector" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/cli-parser" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/code-unit" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/complexity" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/lines-of-code" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/object-enumerator" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/type" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/external/wysiwyg/tinymce3" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/GitLink.xml Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="uk.co.ben_gibson.git.link.SettingsState">
<option name="host" value="e0f86390-1091-4871-8aeb-f534fbc99cf0" />
</component>
</project>

24
.idea/clphp8.iml Normale Datei
Datei anzeigen

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/conlite/external/endroid/qr-code/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/conlite/external/phpmailer/phpmailer/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/conlite/classes" isTestSource="false" packagePrefix="ConLite\" />
<excludeFolder url="file://$MODULE_DIR$/conlite/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/vendor/phpmailer/phpmailer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/vendor/phpstan/phpstan" />
<excludeFolder url="file://$MODULE_DIR$/conlite/vendor/rector/rector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpmailer/phpmailer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/twig/twig" />
<excludeFolder url="file://$MODULE_DIR$/conlite/plugins/de.ortwinpinke.soccer_betting_game/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/conlite/plugins/de.ortwinpinke.soccer_betting_game/vendor/rinvex/countries" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

27
.idea/codeception.xml Normale Datei
Datei anzeigen

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Codeception">
<option name="configurations">
<list>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
</list>
</option>
</component>
</project>

4
.idea/deployment.xml Normale Datei
Datei anzeigen

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" serverName="clphp8" />
</project>

8
.idea/modules.xml Normale Datei
Datei anzeigen

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/clphp8.iml" filepath="$PROJECT_DIR$/.idea/clphp8.iml" />
</modules>
</component>
</project>

Datei anzeigen

@ -14,31 +14,35 @@
<include_path>
<path value="$PROJECT_DIR$/conlite/external/phpqrcode/bindings" />
<path value="$PROJECT_DIR$/conlite/external/phpqrcode/tools" />
<path value="$PROJECT_DIR$/conlite/external/edit_area/plugins" />
<path value="$PROJECT_DIR$/conlite/external/frontend/cache" />
<path value="$PROJECT_DIR$/conlite/external/frontend/images" />
<path value="$PROJECT_DIR$/conlite/external/frontend/css" />
<path value="$PROJECT_DIR$/conlite/external/composer" />
<path value="$PROJECT_DIR$/conlite/external/frontend/data" />
<path value="$PROJECT_DIR$/conlite/external/frontend/upload" />
<path value="$PROJECT_DIR$/conlite/external/frontend/templates" />
<path value="$PROJECT_DIR$/conlite/external/phpmailer/phpmailer" />
<path value="$PROJECT_DIR$/conlite/external/edit_area/langs" />
<path value="$PROJECT_DIR$/conlite/external/frontend/js" />
<path value="$PROJECT_DIR$/conlite/external/frontend/includes" />
<path value="$PROJECT_DIR$/conlite/external/wysiwyg/tinymce3" />
<path value="$PROJECT_DIR$/conlite/external/edit_area/images" />
<path value="$PROJECT_DIR$/conlite/external/edit_area/reg_syntax" />
<path value="$PROJECT_DIR$/conlite/external/frontend/logs" />
<path value="$PROJECT_DIR$/conlite/external/endroid/qr-code" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/phpmailer/phpmailer" />
<path value="$PROJECT_DIR$/vendor/twig/twig" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/conlite/vendor/phpmailer/phpmailer" />
<path value="$PROJECT_DIR$/conlite/vendor/composer" />
<path value="$PROJECT_DIR$/conlite/vendor/rector/rector" />
<path value="$PROJECT_DIR$/conlite/vendor/phpstan/phpstan" />
<path value="$PROJECT_DIR$/conlite/plugins/de.ortwinpinke.soccer_betting_game/vendor/composer" />
<path value="$PROJECT_DIR$/conlite/plugins/de.ortwinpinke.soccer_betting_game/vendor/rinvex/countries" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.4">
<component name="PhpProjectSharedConfiguration" php_language_level="8.0">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpStan">
<PhpStan_settings>
<PhpStanConfiguration tool_path="$PROJECT_DIR$/conlite/external/bin/phpstan" />
</PhpStan_settings>
</component>
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>

25
.idea/phpspec.xml Normale Datei
Datei anzeigen

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PHPSpec">
<suites>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
</suites>
</component>
</project>

Datei anzeigen

@ -3,8 +3,9 @@
<component name="PHPUnit">
<option name="directories">
<list>
<option value="$PROJECT_DIR$/conlite/external/phpmailer/phpmailer/tests" />
<option value="$PROJECT_DIR$/conlite/external/endroid/qr-code/tests" />
<option value="$PROJECT_DIR$/conlite/external/phpmailer/phpmailer/tests" />
<option value="$PROJECT_DIR$/tests" />
</list>
</option>
</component>

Datei anzeigen

@ -2,6 +2,8 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/conlite/plugins/cl-content-allocation" vcs="Git" />
<mapping directory="$PROJECT_DIR$/conlite/plugins/cl-mod-rewrite" vcs="Git" />
<mapping directory="$PROJECT_DIR$/conlite/plugins/cl-newsletter" vcs="Git" />
</component>
</project>

Datei anzeigen

@ -1,16 +1,16 @@
This is the readme file for **ConLite 2.1.3**
This is the readme file for **ConLite 3.0.0**
Any help you need you may find by visiting the following links.
* CL-Portal [https://conlite.org](https://conlite.org)
* CL-Forum [http://forum.conlite.org](http://forum.conlite.org)
* CL-Bugtracker [https://gitport.de/ConLite/ConLite/issues](https://gitport.de/ConLite/ConLite/issues)
* CL-API-Doc [http://conlite.conrepo.org/api/4.8.16CL](http://conlite.conrepo.org/api/4.8.16CL)
* CL-API-Doc [https://api.conlite.org/CL3_0_0](https://api.conlite.org/CL3_0_0)
### !!! Attention !!!
We tried to fix all known bugs of Contenido 4.8 and earlier but cannot give any garanties for that. So use
it on your own risk. If you find any bug or have any idea to enhance ConLite, feel free to visit our
We tried to fix all known bugs of Contenido 4.8 and earlier but cannot give any garanties for that. So use
it on your own risk. If you find any bug or have any idea to enhance ConLite, feel free to visit our
bugtracker at [https://gitport.de/ConLite/ConLite/issues](https://gitport.de/ConLite/ConLite/issues)
Any help and ideas are welcome :)
@ -19,40 +19,40 @@ Any help and ideas are welcome :)
#### What is ConLite?
CL (short for ConLite) is dedicated to close the gap between Contenido 4.8 and the version 4.10.
In downloadable 4.8.20 (and former 4.8.15) are still a lot of bugs and some missing feautures and
In downloadable 4.8.20 (and former 4.8.15) are still a lot of bugs and some missing feautures and
enhancements so one cannot use the version without problems. Our goal is to give you a bugfixed and
really stable version of Contenido till the 4.9 or 4.10 is stable. By the way, there are still a lot of big sides
really stable version of Contenido till the 4.9 or 4.10 is stable. By the way, there are still a lot of big sides
build with 4.8.x out there where upgrading to 4.10.x is not possible or cost a lot of money.
#### Why i have to use ConLite?
You don't have to, but feel free to do it. ConLite will show you an easier way to upgrade step by step to Contenido
You don't have to, but feel free to do it. ConLite will show you an easier way to upgrade step by step to Contenido
4.10. The new version of Contenido has a lot of changes, so you have to do a lot of work
with modules or custom plugins to adapt them to the new version. That's not what ConLite does nor will
do in the future. ConLite will do changes step by step, or better version by version to adapt your
4.8.x or higher installation to work with the new 4.9 of Contenido. And ConLite will try to give you a
with modules or custom plugins to adapt them to the new version. That's not what ConLite does nor will
do in the future. ConLite will do changes step by step, or better version by version to adapt your
4.8.x or higher installation to work with the new 4.9 of Contenido. And ConLite will try to give you a
stable and bugfixed Content-Management-System in the future.
#### Who are the people behind ConLite?
The Team behind the CL-version are some well known guys from CONTENIDO-forum, working since many years with
and within CONTENIDO core or coding modules and plugins for CONTENIDO.
and within CONTENIDO core or coding modules and plugins for CONTENIDO.
And we love CONTENIDO :)
### Copyright
### Copyright
The copyright for the code of CONTENIDO still remains to 4fb and the named coders for all codes coming
The copyright for the code of CONTENIDO still remains to 4fb and the named coders for all codes coming
from 4.8.15 and/or from svn- or git-repository of CONTENDIO.
All ads, enhancements or new parts, coded by the CL-Team are copyright by their named coders or
All ads, enhancements or new parts, coded by the CL-Team are copyright by their named coders or
by CL-Team and conlite.org.
### Know Bugs
FS#25 - Collision with pre-installed AMR after Migration
!!! Attention !!!
If you want to upgrade with an installed AMR-plugin, uninstall AMR before upgrade.
We will include a fix for that in one of the next versions of CL
!!! Attention !!!
If you want to upgrade with an installed AMR-plugin, uninstall AMR before upgrade.
We will include a fix for that in one of the next versions of CL
### History / Changelog
**ConLite 2.1.3**

Datei anzeigen

@ -144,8 +144,7 @@ class cHTMLInputSelectElement extends cHTMLSelectElement {
*
* @return int Number of items added
* */
function addCategories($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true,
$bWithArt = false, $bArtOnline = true) {
function addCategories($iMaxLevel = 0, $bColored = false, $bCatVisible = true, $bCatPublic = true, $bWithArt = false, $bArtOnline = true) {
global $cfg, $client, $lang;
$oDB = new DB_Contenido;
@ -259,27 +258,18 @@ class cHTMLInputSelectElement extends cHTMLSelectElement {
}
}
/**
* Selects specified elements as selected
*
* @param array $aElements Array with "values" of the cHTMLOptionElement to set
*
* @return none
*/
function setSelected($aElements) {
if (is_array($this->_options) && is_array($aElements)) {
foreach ($this->_options as $sKey => $oOption) {
if (in_array($oOption->getAttribute("value"), $aElements)) {
$oOption->setSelected(true);
$this->_options[$sKey] = $oOption;
} else {
$oOption->setSelected(false);
$this->_options[$sKey] = $oOption;
}
}
}
public function addFiles($sPath) {
$iCount = 0;
$aFiles = cDirHandler::read($sPath);
asort($aFiles);
$iCounter = count($this->_options);
foreach ($aFiles as $sValue) {
$oOption = new cHTMLOptionElement($sValue, $sValue);
$this->addOptionElement($iCounter, $oOption);
$iCounter++;
}
return count($aFiles);
}
}
class UI_Config_Table {
@ -302,16 +292,24 @@ class UI_Config_Table {
var $_sColorLight;
var $_sColorDark;
/**
*
* @var type
*/
protected $_iRowCnt = 0;
function __construct() {
global $cfg;
$cfg = cRegistry::getConfig();
$this->_sPadding = 2;
$this->_sBorder = 0;
$this->_sBorderColor = $cfg['color']['table_border'];
$this->_sTplCellCode = ' <td align="{ALIGN}" valign="{VALIGN}" class="{CLASS}" colspan="{COLSPAN}" style="{EXTRA}white-space:nowrap;" nowrap="nowrap">{CONTENT}</td>' . "\n";
$this->_sBorderColor = cRegistry::getConfigValue('color', 'table_border');
$this->_sTplCellCode = '<td align="{ALIGN}" valign="{VALIGN}" class="{CLASS}" colspan="{COLSPAN}" style="{EXTRA}white-space:nowrap;" nowrap="nowrap">' . "\n"
. '{CONTENT}' . "\n"
. '</td>' . "\n";
$this->_sTplTableFile = $cfg['path']['contenido'] . $cfg['path']['templates'] . $cfg['templates']['generic_list'];
$this->_sColorLight = $cfg['color']['table_light'];
$this->_sColorDark = $cfg['color']['table_dark'];
$this->_sColorLight = cRegistry::getConfigValue('color', 'table_light');
$this->_sColorDark = cRegistry::getConfigValue('color', 'table_dark');
}
function setCellTemplate($sCode) {
@ -417,8 +415,37 @@ class UI_Config_Table {
return $sSkript;
}
function render($bPrint = false) {
$oTable = new Template;
/**
* increase row counter
*/
public function nextRow() {
$this->_iRowCnt++;
}
/**
* get current row count
*
* @return int row count
*/
public function getRowCount() : int {
return $this->_iRowCnt;
}
public function setRowCell(int $iCell, $mContent) {
$this->setCell($this->_iRowCnt, $iCell, $mContent);
}
public function setRowBorder(string $sWhich = 'bottom') {
$sStyle = '';
switch ($sWhich) {
case 'bottom':
$this->setRowExtra($this->_iRowCnt, 'border-bottom: 1px solid silver;');
break;
}
}
public function render($bPrint = false) {
$oTable = new Template();
$oTable->reset();
$oTable->set('s', 'CELLPADDING', $this->_sPadding);
@ -437,6 +464,8 @@ class UI_Config_Table {
$iCount = 0;
foreach ($aCells as $sCell => $sData) {
$sData = $this->_processContentData($sData);
$iCount++;
$sTplCell = $this->_sTplCellCode;
@ -525,6 +554,57 @@ class UI_Config_Table {
}
}
}
/**
* returns different types of content data as string
* you can use
* - string
* - object, needs to have a render method
* - array of objects and/or strings
*
* @author Ortwin Pinke
* @since 2.3.0
*
*
* @param mixed $mData
* @return string
*/
protected function _processContentData($mData): string {
if (is_string($mData)) {
return $mData;
}
?>
$sData = '';
if (is_array($mData) && count($mData) > 0) {
foreach ($mData as $mElement) {
if (is_string($mElement)) {
$sData .= $mElement;
continue;
}
$sData .= $this->_renderObject($mElement);
}
} else {
$sData = $this->_renderObject($mData);
}
return $sData;
}
/**
* Renders an object using its render method
*
* @author Ortwin Pinke
* @since 2.3.0
*
* @param type $oObject
* @return string rendered string from object | empty string
*/
protected function _renderObject($oObject): string {
$sReturn = '';
if (is_object($oObject) && method_exists($oObject, 'render')) {
$sReturn = $oObject->render();
}
return $sReturn;
}
}

Datei anzeigen

@ -24,9 +24,10 @@ if (!defined('CON_FRAMEWORK')) {
// create Navigation array for one level
function createNavigationArray($start_id, $db) {
global $user, $cfg, $client, $lang, $auth;
global $cfg, $client, $lang, $auth;
$navigation = array();
$groups = [];
$navigation = [];
$FrontendPermissionCollection = new FrontendPermissionCollection;
// SECURITY-FIX
@ -61,7 +62,6 @@ function createNavigationArray($start_id, $db) {
$FrontendGroupMemberCollection->setWhere("idfrontenduser", $auth->auth['uid']);
$FrontendGroupMemberCollection->query();
$groups = array();
while ($member = $FrontendGroupMemberCollection->next()) {
$groups[] = $member->get("idfrontendgroup");
}
@ -74,10 +74,12 @@ function createNavigationArray($start_id, $db) {
}
}
if ($visible) {
$navigation[$cat_id] = array("idcat" => $cat_id,
$navigation[$cat_id] = [
"idcat" => $cat_id,
"name" => $db->f("name"),
"target" => '_self', # you can not call getTarget($cat_id, &$db) at this point with the same db instance!
"public" => $db->f("public"));
"target" => '_self',
"public" => $db->f("public"),
];
}
} // end while
@ -197,7 +199,7 @@ function getLevel($catid, &$db) {
* Return path of a given category up to a certain level
*/
function getCategoryPath($cat_id, $level, $reverse = true, &$db) {
$root_path = array();
$root_path = [];
array_push($root_path, $cat_id);
@ -222,12 +224,13 @@ function getCategoryPath($cat_id, $level, $reverse = true, &$db) {
* Return location string of a given category
*/
function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sTextStyleClass, $fullweblink = false, $reverse = true, $mod_rewrite = true, $db) {
$aLocation = [];
global $sess, $cfgClient, $client;
$aCatPath = getCategoryPath($iStartCat, $level, $reverse, $db);
if (is_array($aCatPath) AND count($aCatPath) > 0) {
$aLocation = array();
$aLocation = [];
foreach ($aCatPath as $value) {
if (!$fullweblink) {
if ($mod_rewrite == true) {
@ -265,6 +268,7 @@ function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sT
*/
function getSubTree($idcat_start, $db) {
global $client, $cfg;
$deeper_cats = [];
// SECURITY-FIX
$sql = "SELECT
@ -299,6 +303,7 @@ function getSubTree($idcat_start, $db) {
function getTeaserDeeperCategories($iIdcat, $db) {
global $client, $cfg, $lang;
$deeper_cats = [];
// SECURITY-FIX
$sql = "SELECT
@ -345,6 +350,7 @@ function getTeaserDeeperCategories($iIdcat, $db) {
*/
function getProtectedSubTree($idcat_start, $db) {
global $client, $cfg, $lang;
$deeper_cats = [];
// SECURITY-FIX
$sql = "SELECT
@ -416,10 +422,8 @@ function getCategoryName($cat_id, &$db) {
// get direct subcategories of a given category
function getSubCategories($parent_id, $db) {
$subcategories = array();
global $cfg, $client, $lang;
$subcategories = [];
// SECURITY-FIX
$sql = "SELECT
@ -453,11 +457,8 @@ function getSubCategories($parent_id, $db) {
// get direct subcategories with protected categories
function getProtectedSubCategories($parent_id, $db) {
$subcategories = array();
unset($subcategories);
global $cfg, $client, $lang;
$subcategories = [];
// SECURITY-FIX
$sql = "SELECT
@ -488,23 +489,18 @@ function getProtectedSubCategories($parent_id, $db) {
// end function
function checkCatPermission($idcatlang, $public) {
#Check if current user has permissions to access cat
global $auth;
$groups = [];
$oDB = new DB_ConLite();
$FrontendPermissionCollection = new FrontendPermissionCollection;
$FrontendPermissionCollection = new FrontendPermissionCollection();
$visible = false;
if ($public != 0) {
$visible = true;
$groups = array();
} elseif (($auth->auth['uid'] != '') && ($auth->auth['uid'] != 'nobody')) {
$FrontendGroupMemberCollection = new FrontendGroupMemberCollection;
$FrontendGroupMemberCollection->setWhere("idfrontenduser", $auth->auth['uid']);
$FrontendGroupMemberCollection->query();
$groups = array();
while ($member = $FrontendGroupMemberCollection->next()) {
$groups[] = $member->get("idfrontendgroup");
}
@ -518,4 +514,4 @@ function checkCatPermission($idcatlang, $public) {
}
return $visible;
}
}

Datei anzeigen

@ -1,5 +1,5 @@
{
"name": "vendor/conlite",
"name": "org.conlite/conlite",
"description": "ConLite vendor libs",
"license": "GPL-3.0-or-later",
"authors": [
@ -8,16 +8,19 @@
"email": "ortwin.pinke@php-backoffice.de"
}
],
"config": {
"vendor-dir": "conlite/external"
},
"require": {
"endroid/qr-code": "1.9.*",
"phpmailer/phpmailer": "v5.2.*"
"php": "^8.0",
"phpmailer/phpmailer": "v6.8.0",
"twig/twig": "^3.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.0",
"rector/rector": "^0.15"
},
"autoload": {
"psr-4": {
"Conlite\\External\\": "conlite/external"
"ConLite\\": "conlite/classes"
}
}
}

2094
composer.lock generiert

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -185,7 +185,8 @@ class DB_Sql extends DB_Sql_Abstract {
/**
* @see DB_Sql_Abstract::next_record()
*/
public function next_record() {
public function next_record(): bool|int
{
if (!$this->Query_ID instanceof mysqli_result) {
return false;
}

Datei anzeigen

@ -41,6 +41,7 @@ if (!defined('CON_FRAMEWORK')) {
* DB-class for all DB handling
*/
class DB_ConLite extends DB_Sql {
protected bool $NoRecord;
/**
* Constructor of database class.
@ -58,13 +59,13 @@ class DB_ConLite extends DB_Sql {
* - $options['enableProfiling'] (bool) Optional, flag to enable profiling
* @return void
*/
public function __construct(array $options = array()) {
public function __construct(array $options = []) {
global $cachemeta;
parent::__construct($options);
if (!is_array($cachemeta)) {
$cachemeta = array();
$cachemeta = [];
}
// TODO check this out
@ -79,16 +80,20 @@ class DB_ConLite extends DB_Sql {
/**
* Fetches the next recordset from result set
*
* @param bool
* @deprecated since ConLite 2.3
*/
public function next_record() {
global $cCurrentModule;
// FIXME For what reason is NoRecord used???
$this->NoRecord = false;
public function next_record(): bool|int
{
return $this->nextRecord();
}
public function nextRecord(): bool|int
{
$currentModule = cRegistry::getCurrentModule();
if (!$this->Query_ID) {
$this->NoRecord = true;
if ($cCurrentModule > 0) {
$this->halt("next_record called with no query pending in Module ID $cCurrentModule.");
if ($currentModule > 0) {
$this->halt("next_record called with no query pending in Module ID $currentModule.");
} else {
$this->halt("next_record called with no query pending.");
}
@ -108,7 +113,7 @@ class DB_ConLite extends DB_Sql {
*/
public function copyResultToArray($sTable = '') {
$aValues = array();
$aValues = [];
$aMetadata = $this->metadata($sTable);
@ -131,17 +136,8 @@ class DB_ConLite extends DB_Sql {
*
* @deprecated since version 2.0.0, use DB_ConLite instead
*/
class DB_Contenido extends DB_ConLite {
/**
*
* @deprecated since version 2.0.0
* @param array $options
*/
public function __construct(array $options = array()) {
parent::__construct($options);
}
class DB_Contenido extends DB_ConLite
{
}
class Contenido_CT_Sql extends CT_Sql {
@ -175,17 +171,12 @@ class Contenido_CT_Sql extends CT_Sql {
* @param string $id The session id (hash)
* @param string $name Name of the session
* @param string $str The value to store
* @return bool
*/
public function ac_store($id, $name, $str) {
switch ($this->encoding_mode) {
case 'slashes':
$str = addslashes($name . ':' . $str);
break;
case 'base64':
default:
$str = base64_encode($name . ':' . $str);
}
public function ac_store($id, $name, $str): bool {
$str = match ($this->encoding_mode) {
'slashes' => addslashes($name . ':' . $str),
default => base64_encode($name . ':' . $str),
};
$name = addslashes($name);
$now = date('YmdHis', time());
@ -194,7 +185,7 @@ class Contenido_CT_Sql extends CT_Sql {
"REPLACE INTO %s (sid, name, val, changed) VALUES ('%s', '%s', '%s', '%s')", $this->database_table, $id, $name, $str, $now
);
return ($this->db->query($iquery)) ? true : false;
return (bool) $this->db->query($iquery);
}
}
@ -279,14 +270,12 @@ class Contenido_CT_Shm extends CT_Shm {
class Contenido_CT_Session extends CT_Session {
public function __construct() {
$this->ac_start(array(
$this->ac_start([
'namespace' => 'contenido_ct_session_ns',
'session.hash_function' => '1', // use sha-1 function
'session.hash_bits_per_character' => '5', // and set 5 character to achieve 32 chars
# 'session.save_path' => 'your path',
# 'session.name' => 'your session name',
# 'session.gc_maxlifetime' => 'your lifetime in seconds',
));
'session.hash_function' => '1',
// use sha-1 function
'session.hash_bits_per_character' => '5',
]);
}
}
@ -320,8 +309,8 @@ class Contenido_Session extends Session {
}
public function delete() {
$oCol = new InUseCollection();
$oCol->removeSessionMarks($this->id);
$inUseCollection = new InUseCollection();
$inUseCollection->removeSessionMarks($this->id);
parent::delete();
}
@ -435,6 +424,8 @@ class Contenido_Challenge_Auth extends Auth {
}
public function auth_validatelogin() {
$pass = null;
$uid = null;
global $username, $password, $challenge, $response, $timestamp;
if ($password == '') {
@ -522,7 +513,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
public function auth_loglogin($uid) {
global $cfg, $client, $lang, $auth, $sess, $saveLoginTime;
$perm = new Contenido_Perm();
$contenidoPerm = new Contenido_Perm();
$timestamp = date('Y-m-d H:i:s');
$idcatart = '0';
@ -539,7 +530,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
$iTmpClient = $this->db->f('idclient');
$iTmpLang = $this->db->f('idlang');
if ($perm->have_perm_client_lang($iTmpClient, $iTmpLang)) {
if ($contenidoPerm->have_perm_client_lang($iTmpClient, $iTmpLang)) {
$client = $iTmpClient;
$lang = $iTmpLang;
$bFound = true;
@ -564,7 +555,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
return;
}
$idaction = $perm->getIDForAction('login');
$idaction = $contenidoPerm->getIDForAction('login');
$lastentry = $this->db->nextid($cfg['tab']['actionlog']);
$sql = "INSERT INTO
@ -584,9 +575,12 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
}
public function auth_validatelogin() {
$uid = null;
$perm = null;
$pass = null;
global $username, $password, $challenge, $response, $formtimestamp, $auth_handlers;
$gperm = array();
$gperm = [];
if ($password == '') {
return false;
@ -621,11 +615,9 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
$pass = $this->db->f('password'); ## Password is stored as a md5 hash
$bInMaintenance = false;
if ($sMaintenanceMode == 'enabled') {
#sysadmins are allowed to login every time
if (!preg_match('/sysadmin/', $perm)) {
$bInMaintenance = true;
}
#sysadmins are allowed to login every time
if ($sMaintenanceMode == 'enabled' && !preg_match('/sysadmin/', $perm)) {
$bInMaintenance = true;
}
if ($bInMaintenance) {
@ -634,14 +626,11 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
unset($pass);
}
if (is_array($auth_handlers) && !$bInMaintenance) {
if (array_key_exists($pass, $auth_handlers)) {
$success = call_user_func($auth_handlers[$pass], $username, $password);
if ($success) {
$uid = md5($username);
$pass = md5($password);
}
if (is_array($auth_handlers) && !$bInMaintenance && array_key_exists($pass, $auth_handlers)) {
$success = call_user_func($auth_handlers[$pass], $username, $password);
if ($success) {
$uid = md5($username);
$pass = md5($password);
}
}
}
@ -663,9 +652,7 @@ class Contenido_Challenge_Crypt_Auth extends Auth {
$gperm[] = $this->db->f('perms');
}
if (is_array($gperm)) {
$perm = implode(',', $gperm);
}
$perm = implode(',', $gperm);
if ($response == '') { ## True when JS is disabled
if (md5($password) != $pass) { ## md5 hash for non-JavaScript browsers
@ -717,8 +704,6 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
global $password;
if ($password == '') {
/* Stay as nobody when an empty password is passed */
$uid = $this->auth['uname'] = $this->auth['uid'] = 'nobody';
return false;
}
@ -735,13 +720,18 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
}
public function auth_validatelogin() {
$perm = null;
$gperm = [];
$pass = null;
global $username, $password, $challenge, $response, $auth_handlers, $client;
$client = (int) $client;
if (isset($username)) {
$this->auth['uname'] = $username; ## This provides access for 'loginform.ihtml'
} else if ($this->nobody) { ## provides for 'default login cancel'
$this->auth['uname'] = $username;
## This provides access for 'loginform.ihtml'
} elseif ($this->nobody) {
## provides for 'default login cancel'
$uid = $this->auth['uname'] = $this->auth['uid'] = 'nobody';
return $uid;
}
@ -767,13 +757,11 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
$perm = $this->db->f('perms');
$pass = $this->db->f('password'); ## Password is stored as a md5 hash
if (is_array($auth_handlers)) {
if (array_key_exists($pass, $auth_handlers)) {
$success = call_user_func($auth_handlers[$pass], $username, $password);
if ($success) {
$uid = md5($username);
$pass = md5($password);
}
if (is_array($auth_handlers) && array_key_exists($pass, $auth_handlers)) {
$success = call_user_func($auth_handlers[$pass], $username, $password);
if ($success) {
$uid = md5($username);
$pass = md5($password);
}
}
}
@ -795,9 +783,7 @@ class Contenido_Frontend_Challenge_Crypt_Auth extends Auth {
$gperm[] = $this->db->f('perms');
}
if (is_array($gperm)) {
$perm = implode(',', $gperm);
}
$perm = implode(',', $gperm);
}
}
@ -836,16 +822,16 @@ function register_auth_handler($aHandlers) {
global $auth_handlers;
if (!is_array($auth_handlers)) {
$auth_handlers = array();
$auth_handlers = [];
}
if (!is_array($aHandlers)) {
$aHandlers = Array($aHandlers);
$aHandlers = [$aHandlers];
}
foreach ($aHandlers as $sHandler) {
if (!in_array($sHandler, $auth_handlers)) {
$auth_handlers[md5($sHandler)] = $sHandler;
foreach ($aHandlers as $aHandler) {
if (!in_array($aHandler, $auth_handlers)) {
$auth_handlers[md5($aHandler)] = $aHandler;
}
}
}

Datei anzeigen

@ -232,8 +232,8 @@ class Contenido_Perm {
return true;
} elseif ($item_rights[$area] != "noright") {
$groupsForUser = $this->getGroupsForUser($auth->auth[uid]);
$groupsForUser[] = $auth->auth[uid];
$groupsForUser = $this->getGroupsForUser($auth->auth['uid']);
$groupsForUser[] = $auth->auth['uid'];
$tmp_userstring = implode("','", $groupsForUser);
@ -596,8 +596,8 @@ class Contenido_Perm {
}
} elseif ($item_rights[$value] != "noright") {
$groupsForUser = $this->getGroupsForUser($auth->auth[uid]);
$groupsForUser[] = $auth->auth[uid];
$groupsForUser = $this->getGroupsForUser($auth->auth['uid']);
$groupsForUser[] = $auth->auth['uid'];
//else search for rights for this user in this area
$sql = "SELECT

Datei anzeigen

@ -35,8 +35,8 @@ if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
$_PHPLIB = array();
$_PHPLIB['libdir'] = str_replace ('\\', '/', dirname(__FILE__) . '/');
$_PHPLIB = [];
$_PHPLIB['libdir'] = str_replace ('\\', '/', __DIR__ . '/');
global $cfg;

Datei anzeigen

@ -318,12 +318,12 @@ class cSession {
break;
case "object":
## $$var is an object. Enumerate the slots and serialize them.
eval("\$k = \$${var}->classname; \$l = reset(\$${var}->persistent_slots);");
eval("\$k = \${$var}->classname; \$l = reset(\${$var}->persistent_slots);");
$str.="\$$var = new $k; ";
while ($l) {
## Structural recursion.
$this->serialize($var . "->" . $l, $str);
eval("\$l = next(\$${var}->persistent_slots);");
eval("\$l = next(\${$var}->persistent_slots);");
}
break;

Datei anzeigen

@ -555,8 +555,8 @@ if (empty($where) || $iAffectedRows <= 0) {
#Check rights per cat
if (!$check_rights) {
//hotfix timo trautmann 2008-12-10 also check rights in associated groups
$aGroupsForUser = $perm->getGroupsForUser($auth->auth[uid]);
$aGroupsForUser[] = $auth->auth[uid];
$aGroupsForUser = $perm->getGroupsForUser($auth->auth['uid']);
$aGroupsForUser[] = $auth->auth['uid'];
$sTmpUserString = implode("','", $aGroupsForUser);
#Check if any rights are applied to current user or his groups

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class Exception extends \Exception
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class FileNotFoundException extends RuntimeException
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class InvalidArgumentException extends LogicException
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class LogicException extends Exception
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Exceptions;
class RuntimeException extends Exception
{
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Frontend\Navigation;
class FrontendNavigation
{
}

Datei anzeigen

@ -0,0 +1,29 @@
<?php
namespace ConLite\GenericDb\Driver;
class GenericDbDriver
{
public $_sEncoding;
public $_oItemClassInstance;
public function setEncoding($sEncoding)
{
$this->_sEncoding = $sEncoding;
}
public function setItemClassInstance($oInstance)
{
$this->_oItemClassInstance = $oInstance;
}
public function buildJoinQuery($destinationTable, $destinationClass, $destinationPrimaryKey, $sourceClass, $primaryKey)
{
}
public function buildOperator($sField, $sOperator, $sRestriction)
{
}
}

Datei anzeigen

@ -1,51 +1,32 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
* MySQL Driver for GenericDB
*
* Requirements:
* @con_php_req 5.0
*
*
* @package Contenido Backend classes
* @version 1.12
* @author Bjoern Behrens
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* {@internal
* created 2006-05-10
* modified 2008-05-23 Added Debug_DevNull and Debug_VisibleAdv
*
* $Id$
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
namespace ConLite\GenericDb\Driver\MySql;
class gdbMySQL extends gdbDriver {
use cCharacterConverter;
use ConLite\GenericDb\Driver\GenericDbDriver;
use Contenido_Security;
function buildJoinQuery($destinationTable, $destinationClass, $destinationPrimaryKey, $sourceClass, $primaryKey) {
class GenericDbDriverMySql extends GenericDbDriver
{
public $_oItemClassInstance;
public $_sEncoding;
function buildJoinQuery($destinationTable, $destinationClass, $destinationPrimaryKey, $sourceClass, $primaryKey)
{
// Build a regular LEFT JOIN
$field = "$destinationClass.$destinationPrimaryKey";
$tables = "";
$join = "LEFT JOIN $destinationTable AS $destinationClass ON " .
Contenido_Security::toString($sourceClass . "." . $primaryKey) . " = " .
Contenido_Security::toString($destinationClass . "." . $primaryKey);
Contenido_Security::toString($sourceClass . "." . $primaryKey) . " = " .
Contenido_Security::toString($destinationClass . "." . $primaryKey);
$where = "";
return array("field" => $field, "table" => $tables, "join" => $join, "where" => $where);
return ["field" => $field, "table" => $tables, "join" => $join, "where" => $where];
}
function buildOperator($sField, $sOperator, $sRestriction) {
function buildOperator($sField, $sOperator, $sRestriction)
{
$sOperator = strtolower($sOperator);
$sWhereStatement = "";
@ -88,14 +69,14 @@ class gdbMySQL extends gdbDriver {
$GLOBALS["_cCharTable"] = new cCharacterConverter;
}
$aliasSearch = array();
$aliasSearch = [];
$metaCharacters = array("*", "[", "]", "^", '$', "\\", "*", "'", '"', '+');
$metaCharacters = ["*", "[", "]", "^", '$', "\\", "*", "'", '"', '+'];
for ($i = 0; $i < strlen($sRestriction); $i ++) {
for ($i = 0; $i < strlen($sRestriction); $i++) {
$char = substr($sRestriction, $i, 1);
$aliases = array();
$aliases = [];
$aliases = array_merge($aliases, $GLOBALS["_cCharTable"]->fetchDiacriticCharactersForNormalizedChar($this->_sEncoding, $char));
$normalizedChars = $GLOBALS["_cCharTable"]->fetchNormalizedCharsForDiacriticCharacter($this->_sEncoding, $char);
@ -106,9 +87,9 @@ class gdbMySQL extends gdbDriver {
$aliases = array_merge($aliases, $normalizedChars);
if (count($aliases) > 0) {
if ($aliases !== []) {
$aliases[] = $char;
$allAliases = array();
$allAliases = [];
foreach ($aliases as $alias) {
$alias1 = $this->_oItemClassInstance->_inFilter($alias);
@ -119,8 +100,7 @@ class gdbMySQL extends gdbDriver {
$allAliases = array_unique($allAliases);
$aliasSearch[] = "(" . implode("|", $allAliases) . ")";
} else {
$addChars = array();
$addChars = [];
if (in_array($char, $metaCharacters)) {
@ -131,11 +111,7 @@ class gdbMySQL extends gdbDriver {
$vChar = $this->_oItemClassInstance->_inFilter($char);
if ($char != $vChar) {
if (in_array($vChar, $metaCharacters)) {
$addChars[] = "\\\\" . $vChar;
} else {
$addChars[] = $vChar;
}
$addChars[] = in_array($vChar, $metaCharacters) ? "\\\\" . $vChar : $vChar;
}
}
@ -144,7 +120,7 @@ class gdbMySQL extends gdbDriver {
}
$restriction = "'" . implode("", $aliasSearch) . "'";
$sWhereStatement = implode(" ", array($sField, "REGEXP", $restriction));
$sWhereStatement = implode(" ", [$sField, "REGEXP", $restriction]);
break;
case "fulltext":
@ -152,9 +128,9 @@ class gdbMySQL extends gdbDriver {
break;
case "in":
if (is_array($sRestriction)) {
$items = array();
$items = [];
foreach ($sRestriction as $key => $sRestrictionItem) {
foreach ($sRestriction as $sRestrictionItem) {
$items[] = "'" . $this->_oItemClassInstance->_inFilter($sRestrictionItem) . "'";
}
@ -163,14 +139,14 @@ class gdbMySQL extends gdbDriver {
$sRestriction = "'" . $sRestriction . "'";
}
$sWhereStatement = implode(" ", array($sField, "IN (", $sRestriction, ")"));
$sWhereStatement = implode(" ", [$sField, "IN (", $sRestriction, ")"]);
break;
case "notin":
if (is_array($sRestriction)) {
$items = array();
$items = [];
foreach ($sRestriction as $key => $sRestrictionItem) {
$items[] = "'" . $this->_oItemClassInstance->_inFilter($sRestrictionItem) . "'";
foreach ($sRestriction as $Restriction) {
$items[] = "'" . $this->_oItemClassInstance->_inFilter($Restriction) . "'";
}
$sRestriction = implode(", ", $items);
@ -178,17 +154,15 @@ class gdbMySQL extends gdbDriver {
$sRestriction = "'" . $sRestriction . "'";
}
$sWhereStatement = implode(" ", array($sField, "NOT IN (", $sRestriction, ")"));
$sWhereStatement = implode(" ", [$sField, "NOT IN (", $sRestriction, ")"]);
break;
default :
$sRestriction = "'" . $this->_oItemClassInstance->_inFilter($sRestriction) . "'";
$sWhereStatement = implode(" ", array($sField, $sOperator, $sRestriction));
$sWhereStatement = implode(" ", [$sField, $sOperator, $sRestriction]);
}
return $sWhereStatement;
}
}
?>
}

Datei anzeigen

@ -0,0 +1,515 @@
<?php
namespace ConLite\GenericDb;
use stdClass;
abstract class Item extends ItemBaseAbstract
{
/**
* @var string
*/
public $_lastSQL;
/**
* Storage of the source table to use for the user informations
* @var array
*/
public $values;
/**
* Storage of the fields which were modified, where the keys are the
* fieldnames and the values just simple booleans.
* @var array
*/
protected $modifiedValues;
/**
* Stores the old primary key, just in case somebody wants to change it
* @var string
*/
protected $oldPrimaryKey;
/**
* List of funcion names of the filters used when data is stored to the db.
* @var array
*/
protected $_arrInFilters = ['urlencode', 'clHtmlSpecialChars', 'addslashes'];
/**
* List of funcion names of the filtersused when data is retrieved from the db
* @var array
*/
protected $_arrOutFilters = ['stripslashes', 'htmldecode', 'urldecode'];
/**
* Class name of meta object
* @var string
*/
protected $_metaObject;
/**
* Constructor function
*
* @param string $sTable The table to use as information source
* @param string $sPrimaryKey The primary key to use
* @param int $iLifetime
*/
public function __construct($sTable = '', $sPrimaryKey = '', $iLifetime = 10)
{
parent::__construct($sTable, $sPrimaryKey, get_parent_class($this), $iLifetime);
}
function __destruct()
{
//print_r(self::$_oCache);
}
/**
* Loads an item by colum/field from the database.
*
* @param string $sField Specifies the field
* @param mixed $mValue Specifies the value
* @param bool $bSafe Use inFilter or not
* @return bool True if the load was successful
*/
public function loadBy($sField, mixed $mValue, $bSafe = true): bool
{
if ($bSafe) {
$mValue = $this->_inFilter($mValue);
}
if ($sField === $this->primaryKey) {
$aRecordSet = self::$_oCache->getItem($this->table . "_" . $mValue);
} else {
$aRecordSet = self::$_oCache->getItemByProperty($this->table . "_" . $sField, $mValue);
}
if ($aRecordSet) {
// entry in cache found, load entry from cache
$this->loadByRecordSet($aRecordSet);
return true;
}
// SQL-Statement to select by field
$sql = sprintf("SELECT * FROM `%s` WHERE %s = '%s'", $this->table, $sField, $mValue);
//$sql = $this->db->prepare($sql, $this->table, $sField, $mValue);
// Query the database
$this->db->query($sql);
$this->_lastSQL = $sql;
if ($this->db->num_rows() > 1) {
$sMsg = "Tried to load a single line with field $sField and value $mValue from "
. $this->table . " but found more than one row";
cWarning(__FILE__, __LINE__, $sMsg);
}
// Advance to the next record, return false if nothing found
if (!$this->db->next_record()) {
return false;
}
$this->loadByRecordSet($this->db->toArray());
return true;
}
/**
* Loads an item by passed where clause from the database.
* This function is expensive, since it executes allways a query to the database
* to retrieve the primary key, even if the record set is aleady cached.
* NOTE: Passed value has to be escaped before. This will not be done by this function.
*
* @param string $sWhere The where clause like 'idart = 123 AND idlang = 1'
* @return bool True if the load was successful
*/
protected function _loadByWhereClause($sWhere)
{
// SQL-Statement to select by whee clause
$sql = sprintf("SELECT %s AS pk FROM `%s` WHERE ", $this->primaryKey, $this->table) . $sWhere;
//$sql = $this->db->prepare($sql, $this->primaryKey, $this->table);
// Query the database
$this->db->query($sql);
$this->_lastSQL = $sql;
if ($this->db->num_rows() > 1) {
$sMsg = "Tried to load a single line with where clause '" . $sWhere . "' from "
. $this->table . " but found more than one row";
cWarning(__FILE__, __LINE__, $sMsg);
}
// Advance to the next record, return false if nothing found
if (!$this->db->next_record()) {
return false;
}
$id = $this->db->f('pk');
return $this->loadByPrimaryKey($id);
}
/**
* Loads an item by ID from the database.
*
* @param string $mValue Specifies the primary key value
* @return bool True if the load was successful
*/
public function loadByPrimaryKey($mValue)
{
$bSuccess = $this->loadBy($this->primaryKey, $mValue);
if (($bSuccess == true) && method_exists($this, '_onLoad')) {
$this->_onLoad();
}
return $bSuccess;
}
/**
* Loads an item by it's recordset.
*
* @param array $aRecordSet The recordset of the item
*/
public function loadByRecordSet(array $aRecordSet)
{
$this->values = $aRecordSet;
$this->oldPrimaryKey = $this->values[$this->primaryKey];
$this->virgin = false;
self::$_oCache->addItem($this->table . "_" . $this->oldPrimaryKey, $this->values);
}
/**
* Checks if a the item is already loaded.
* @return boolean
*/
public function isLoaded()
{
return !$this->virgin;
}
/**
* Function which is called whenever an item is loaded.
* Inherited classes should override this function if desired.
*
* @return void
*/
protected function _onLoad()
{
}
/**
* Gets the value of a specific field.
*
* @param string $sField Specifies the field to retrieve
* @return mixed Value of the field
*/
public function getField($sField)
{
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
return $this->_outFilter($this->values[$sField]);
}
/**
* Wrapper for getField (less to type).
*
* @param string $sField Specifies the field to retrieve
* @return mixed Value of the field
*/
public function get($sField)
{
return $this->getField($sField);
}
/**
* Sets the value of a specific field.
*
* @param string $sField Field name
* @param string $mValue Value to set
* @param bool $bSafe Flag to run defined inFilter on passed value
*/
public function setField($sField, $mValue, $bSafe = true): bool
{
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
$this->modifiedValues[$sField] = true;
if ($sField == $this->primaryKey) {
$this->oldPrimaryKey = $this->values[$sField];
}
$this->values[$sField] = $bSafe == true ? $this->_inFilter($mValue) : $mValue;
return true;
}
/**
* Shortcut to setField.
*
* @param string $sField Field name
* @param string $mValue Value to set
* @param bool $bSafe Flag to run defined inFilter on passed value
*/
public function set($sField, $mValue, $bSafe = true)
{
return $this->setField($sField, $mValue, $bSafe);
}
/**
* Stores the loaded and modified item to the database.
*
* @return bool
*/
public function store()
{
if (!$this->isLoaded()) {
$this->lasterror = 'No item loaded';
return false;
}
$sql = 'UPDATE `' . $this->table . '` SET ';
$first = true;
if (!is_array($this->modifiedValues)) {
return true;
}
foreach (array_keys($this->modifiedValues) as $key) {
if ($first == true) {
$sql .= "`$key` = '" . $this->values[$key] . "'";
$first = false;
} else {
$sql .= ", `$key` = '" . $this->values[$key] . "'";
}
}
$sql .= " WHERE " . $this->primaryKey . " = '" . $this->oldPrimaryKey . "'";
$this->db->query($sql);
$this->_lastSQL = $sql;
if ($this->db->affected_rows() > 0) {
self::$_oCache->addItem($this->table . "_" . $this->oldPrimaryKey, $this->values);
}
return $this->db->affected_rows() >= 1;
}
/**
* Returns current item data as an assoziative array.
*/
public function toArray(): array|false
{
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
$aReturn = [];
foreach (array_keys($this->values) as $field) {
$aReturn[$field] = $this->getField($field);
}
return $aReturn;
}
/**
* Returns current item data as an object.
*/
public function toObject(): stdClass|false
{
$return = $this->toArray();
return (false !== $return) ? (object)$return : $return;
}
/**
* Sets a custom property.
*
* @param string $sType Specifies the type
* @param string $sName Specifies the name
* @param mixed $mValue Specifies the value
* @return bool
*/
public function setProperty($sType, $sName, mixed $mValue)
{
// If this object wasn't loaded before, return false
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
// Set the value
$oProperties = $this->_getPropertiesCollectionInstance();
return $oProperties->setValue(
$this->primaryKey, $this->get($this->primaryKey), $sType, $sName, $mValue
);
}
/**
* Returns a custom property.
*
* @param string $sType Specifies the type
* @param string $sName Specifies the name
* @return mixed Value of the given property or false
*/
public function getProperty($sType, $sName)
{
// If this object wasn't loaded before, return false
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
// Return the value
$oProperties = $this->_getPropertiesCollectionInstance();
return $oProperties->getValue(
$this->primaryKey, $this->get($this->primaryKey), $sType, $sName
);
}
/**
* Deletes a custom property.
*
* @param string $sType Specifies the type
* @param string $sName Specifies the name
* @return bool
*/
public function deleteProperty($sType, $sName)
{
// If this object wasn't loaded before, return false
if ($this->virgin == true) {
$this->lasterror = 'No item loaded';
return false;
}
// Delete the value
$oProperties = $this->_getPropertiesCollectionInstance();
return $oProperties->deleteValue(
$this->primaryKey, $this->get($this->primaryKey), $sType, $sName
);
}
/**
* Deletes a custom property by its id.
*
* @param int $idprop Id of property
* @return bool
*/
public function deletePropertyById($idprop)
{
$oProperties = $this->_getPropertiesCollectionInstance();
return $oProperties->delete($idprop);
}
/**
* Deletes the current item
*
* @return void
*/
// Method doesn't work, remove in future versions
// function delete()
// {
// $this->_collectionInstance->delete($item->get($this->primaryKey));
//}
/**
* Define the filter functions used when data is being stored or retrieved
* from the database.
*
* Examples:
* <pre>
* $obj->setFilters(array('addslashes'), array('stripslashes'));
* $obj->setFilters(array('htmlencode', 'addslashes'), array('stripslashes', 'htmlencode'));
* </pre>
*
* @param array $aInFilters Array with function names
* @param array $aOutFilters Array with function names
*
* @return void
*/
public function setFilters($aInFilters = [], $aOutFilters = [])
{
$this->_arrInFilters = $aInFilters;
$this->_arrOutFilters = $aOutFilters;
}
/**
* Filters the passed data using the functions defines in the _arrInFilters array.
*
* @param mixed $mData Data to filter
* @return mixed Filtered data
* @see setFilters
*
* @todo This method is used from public scope, but it should be protected
*
*/
public function _inFilter(mixed $mData)
{
if (is_numeric($mData) || is_array($mData)) {
return $mData;
}
if (is_null($mData)) {
$mData = '';
}
foreach ($this->_arrInFilters as $_arrInFilter) {
if (function_exists($_arrInFilter)) {
$mData = $_arrInFilter($mData);
}
}
return $mData;
}
/**
* Filters the passed data using the functions defines in the _arrOutFilters array.
*
* @param mixed $mData Data to filter
* @return mixed Filtered data
* @see setFilters
*
*/
protected function _outFilter(mixed $mData)
{
if (is_numeric($mData))
return $mData;
foreach ($this->_arrOutFilters as $_arrOutFilter) {
if (function_exists($_arrOutFilter)) {
$mData = $_arrOutFilter($mData);
}
}
return $mData;
}
protected function _setMetaObject($sObjectName)
{
$this->_metaObject = $sObjectName;
}
public function getMetaObject()
{
global $_metaObjectCache;
if (!is_array($_metaObjectCache)) {
$_metaObjectCache = [];
}
$sClassName = $this->_metaObject;
$qclassname = strtolower($sClassName);
if (array_key_exists($qclassname, $_metaObjectCache) && is_object($_metaObjectCache[$qclassname])) {
if (strtolower($_metaObjectCache[$qclassname]::class) === $qclassname) {
$_metaObjectCache[$qclassname]->setPayloadObject($this);
return $_metaObjectCache[$qclassname];
}
}
if (class_exists($sClassName)) {
$_metaObjectCache[$qclassname] = new $sClassName($this);
return $_metaObjectCache[$qclassname];
}
}
}

Datei anzeigen

@ -1,12 +1,16 @@
<?php
/**
*
*/
namespace ConLite\GenericDb;
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
abstract class cItemBaseAbstract {
use DB_ConLite;
use PropertyCollection;
abstract class ItemBaseAbstract
{
/**
* Database instance, contains the database object
@ -29,9 +33,9 @@ abstract class cItemBaseAbstract {
/**
* Item cache instance
* @var Contenido_ItemCache
* @var ItemCache
*/
protected static $_oCache;
protected static ItemCache $_oCache;
/**
* GenericDB settings, see $cfg['sql']
@ -85,17 +89,17 @@ abstract class cItemBaseAbstract {
* @var string
*/
protected $_className;
protected $_bDebug;
/**
* Sets some common properties
*
* @param string $sTable Name of table
* @param string $sPrimaryKey Primary key of table
* @param string $sClassName Name of parent class
* @param int $iLifetime Lifetime of the object in seconds (NOT USED!)
* @throws Contenido_ItemException If table name or primary key is not set
* @param string $sTable Name of table
* @param string $sPrimaryKey Primary key of table
* @param string $sClassName Name of parent class
* @param int $iLifetime Lifetime of the object in seconds (NOT USED!)
* @throws ItemException
*/
protected function __construct($sTable, $sPrimaryKey, $sClassName, $iLifetime = 10) {
global $cfg;
@ -104,17 +108,17 @@ abstract class cItemBaseAbstract {
if ($sTable == '') {
$sMsg = "$sClassName: No table specified. Inherited classes *need* to set a table";
throw new Contenido_ItemException($sMsg);
throw new ItemException($sMsg);
} elseif ($sPrimaryKey == '') {
$sMsg = "No primary key specified. Inherited classes *need* to set a primary key";
throw new Contenido_ItemException($sMsg);
throw new ItemException($sMsg);
}
$this->_settings = $cfg['sql'];
// instanciate caching
$aCacheOpt = (isset($this->_settings['cache'])) ? $this->_settings['cache'] : array();
self::$_oCache = cItemCache::getInstance($sTable, $aCacheOpt);
self::$_oCache = ItemCache::getInstance($sTable, $aCacheOpt);
$this->table = $sTable;
$this->primaryKey = $sPrimaryKey;
@ -159,6 +163,4 @@ abstract class cItemBaseAbstract {
return $this->properties;
}
}
?>
}

Datei anzeigen

@ -1,30 +1,25 @@
<?php
/**
*
*/
namespace ConLite\GenericDb;
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
class cItemCache {
class ItemCache
{
/**
* List of self instances (Contenido_ItemCache)
* @var array
*/
protected static $_oInstances = array();
protected static $_oInstances = [];
/**
* Assoziative cache array
* @var array
*/
protected $_aItemsCache = array();
/**
* Table name for current instance
* @var string
*/
protected $_sTable = '';
protected $_aItemsCache = [];
/**
* Max number of items to cache
@ -41,18 +36,17 @@ class cItemCache {
/**
* Contructor of Contenido_ItemCache
* @param string $sTable Table name
* @param string $_sTable Table name
* @param array $aOptions Options array as follows:
* - $aOptions['max_items_to_cache'] = (int) Number of items to cache
* - $aOptions['enable'] = (bool) Flag to enable caching
*/
protected function __construct($sTable, array $aOptions = array()) {
$this->_sTable = $sTable;
protected function __construct(protected $_sTable, array $aOptions = []) {
if (isset($aOptions['max_items_to_cache']) && (int) $aOptions['max_items_to_cache'] > 0) {
$this->_iMaxItemsToCache = (int) $aOptions['max_items_to_cache'];
}
if (isset($aOptions['enable']) && is_bool($aOptions['enable'])) {
$this->_bEnable = (bool) $aOptions['enable'];
$this->_bEnable = $aOptions['enable'];
}
if (isset($_GET['frame']) && is_numeric($_GET['frame'])) {
@ -62,13 +56,6 @@ class cItemCache {
}
}
/**
* Prevent cloning
*/
protected function __clone() {
}
/**
* Returns item cache instance, creates it, if not done before.
* Works as a singleton for one specific table.
@ -78,7 +65,7 @@ class cItemCache {
* - $aOptions['max_items_to_cache'] = (int) Number of items to cache
* - $aOptions['enable'] = (bool) Flag to enable caching
*/
public static function getInstance($sTable, array $aOptions = array()) {
public static function getInstance($sTable, array $aOptions = []) {
if (!isset(self::$_oInstances[$sTable])) {
self::$_oInstances[$sTable] = new self($sTable, $aOptions);
}
@ -96,11 +83,8 @@ class cItemCache {
/**
* Returns existing entry from cache by it's id.
*
* @param mixed $mId
* @return array|null
*/
public function getItem($mId) {
public function getItem(mixed $mId): ?array {
if (!$this->_bEnable) {
return null;
}
@ -114,19 +98,15 @@ class cItemCache {
/**
* Returns existing entry from cache by matching propery value.
*
* @param mixed $mProperty
* @param mixed $mValue
* @return array|null
*/
public function getItemByProperty($mProperty, $mValue) {
public function getItemByProperty(mixed $mProperty, mixed $mValue): ?array {
if (!$this->_bEnable) {
return null;
}
// loop thru all cached entries and try to find a entry by it's property
if (is_array($this->_aItemsCache[$this->_iFrame]) && count($this->_aItemsCache[$this->_iFrame]) > 0) {
foreach ($this->_aItemsCache[$this->_iFrame] as $id => $aEntry) {
if (is_array($this->_aItemsCache[$this->_iFrame]) && $this->_aItemsCache[$this->_iFrame] !== []) {
foreach ($this->_aItemsCache[$this->_iFrame] as $aEntry) {
if (isset($aEntry[$mProperty]) && $aEntry[$mProperty] == $mValue) {
return $aEntry;
}
@ -139,28 +119,23 @@ class cItemCache {
* Returns existing entry from cache by matching properties and their values.
*
* @param array $aProperties Assoziative key value pairs
* @return array|null
*/
public function getItemByProperties(array $aProperties) {
public function getItemByProperties(array $aProperties): ?array {
if (!$this->_bEnable) {
return null;
}
// loop thru all cached entries and try to find a entry by it's property
foreach ($this->_aItemsCache as $id => $aEntry) {
foreach ($this->_aItemsCache as $_aItemCache) {
$mFound = null;
foreach ($aProperties as $key => $value) {
if (isset($aEntry[$key]) && $aEntry[$key] == $value) {
if (null === $mFound) {
$mFound = true;
}
if (isset($_aItemCache[$key]) && $_aItemCache[$key] == $value) {
$mFound = true;
} else {
$mFound = false;
break;
}
if (true === $mFound) {
return $aEntry;
}
return $_aItemCache;
}
}
return null;
@ -169,11 +144,10 @@ class cItemCache {
/**
* Adds passed item data to internal cache
*
* @param mixed $mId
* @param array $aData Usually the recordset
* @return void
*/
public function addItem($mId, array $aData) {
public function addItem(mixed $mId, array $aData) {
if (!$this->_bEnable) {
return null;
}
@ -181,7 +155,7 @@ class cItemCache {
if (isset($this->_aItemsCache[$this->_iFrame])) {
$aTmpItemsArray = $this->_aItemsCache[$this->_iFrame];
if ($this->_iMaxItemsToCache == count($aTmpItemsArray)) {
if ($this->_iMaxItemsToCache == (is_countable($aTmpItemsArray) ? count($aTmpItemsArray) : 0)) {
// we have reached the maximum number of cached items, remove first entry
$firstEntryKey = array_shift($aTmpItemsArray);
if (is_array($firstEntryKey))
@ -197,10 +171,9 @@ class cItemCache {
/**
* Removes existing cache entry by it's key
*
* @param mixed $mId
* @return void
*/
public function removeItem($mId) {
public function removeItem(mixed $mId) {
if (!$this->_bEnable) {
return null;
}
@ -211,4 +184,4 @@ class cItemCache {
}
}
}
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -0,0 +1,9 @@
<?php
namespace ConLite\GenericDb;
use Exception;
class ItemException extends Exception {
}

Datei anzeigen

@ -0,0 +1,7 @@
<?php
namespace ConLite\Html;
class Html extends HtmlCommon
{
}

Datei anzeigen

@ -0,0 +1,42 @@
<?php
namespace ConLite\Html;
abstract class HtmlCommon implements \ArrayAccess
{
protected string|array|null $attributes = null;
public function __construct(array|string|null $attributes = null)
{
$this->attributes = $attributes;
}
#[\ReturnTypeWillChange]
public function offsetExists(mixed $offset): bool
{
return isset($this->attributes[strtolower($offset)]);
}
#[\ReturnTypeWillChange]
public function offsetGet(mixed $offset)
{
return $this->getAttribute($offset);
}
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value): void
{
if (null !== $offset) {
$this->setAttribute($offset, $value);
} else {
$this->setAttribute($value);
}
}
#[\ReturnTypeWillChange]
public function offsetUnset($offset): void
{
$this->removeAttribute($offset);
}
}

306
conlite/classes/Log/Log.php Normale Datei
Datei anzeigen

@ -0,0 +1,306 @@
<?php
namespace ConLite\Log;
use ConLite\Exceptions\InvalidArgumentException;
use cString;
use ReflectionClass;
class Log
{
/**
* logging level
*
* @var int
*/
const EMERG = 0;
/**
* logging level
*
* @var int
*/
const ALERT = 1;
/**
* logging level
*
* @var int
*/
const CRIT = 2;
/**
* logging level
*
* @var int
*/
const ERR = 3;
/**
* logging level
*
* @var int
*/
const WARN = 4;
/**
* logging level
*
* @var int
*/
const NOTICE = 5;
/**
* logging level
*
* @var int
*/
const INFO = 6;
/**
* logging level
*
* @var int
*/
const DEBUG = 7;
protected $writer;
protected $shortcutHandlers = [];
protected $priorities = [];
protected $defaultPriorities = [];
protected $buffer = [];
/**
* @throws InvalidArgumentException
*/
public function __construct(LogWriter $writer = null)
{
$createWriter = false;
if(!$writer) {
$createWriter = true;
} elseif (!is_object($writer) || !($writer instanceof LogWriter)) {
cWarning(__FILE__, __LINE__, 'The passed class is not a subclass of ConLite LogWriter. Creating new one.');
$createWriter = true;
}
if($createWriter) {
$options = ['destination' => \cRegistry::getConfigValue('path', 'logs') . 'conlite.log'];
$writer = LogWriter::factory('File', $options);
}
$this->setWriter($writer);
$this->setShortcutHandler('%date', [$this, 'shDate']);
$this->setShortcutHandler('%level', [$this, 'shLevel']);
$this->setShortcutHandler('%message', [$this, 'shMessage']);
$this->getWriter()->setOption('log_format', '[%date] [%level] %message', false);
$reflection = new ReflectionClass($this);
$this->priorities = $this->defaultPriorities = array_flip($reflection->getConstants());
}
public function getWriter() {
return $this->writer;
}
public function setWriter(LogWriter $writer): void
{
$this->writer = $writer;
}
/**
* @throws InvalidArgumentException
*/
public function setShortcutHandler($shortcut, $handler): bool
{
if ($shortcut == '') {
throw new InvalidArgumentException('The shortcut name must not be empty.');
}
if (cString::getPartOfString($shortcut, 0, 1) == '%') {
$shortcut = cString::getPartOfString($shortcut, 1);
}
if (!is_callable($handler)) {
throw new InvalidArgumentException('The specified shortcut handler does not exist.');
}
if (array_key_exists($shortcut, $this->shortcutHandlers)) {
throw new InvalidArgumentException('The shortcut ' . $shortcut . ' is already in use!');
}
$this->shortcutHandlers[$shortcut] = $handler;
return true;
}
public function unsetShortcutHandler($shortcut)
{
if(!in_array($shortcut, $this->shortcutHandlers)) {
throw new InvalidArgumentException('The specified shortcut handler does not exist.');
}
unset($this->shortcutHandlers[$shortcut]);
return true;
}
public function buffer(string $message, $priority = null): void
{
$this->buffer[] = [$message, $priority];
}
public function commit(bool $clearBuffer = true)
{
if (count($this->buffer) == 0) {
cWarning(__FILE__, __LINE__, 'There are no buffered messages to commit.');
return false;
}
foreach ($this->buffer as $bufferInfo) {
$this->log($bufferInfo[0], $bufferInfo[1]);
}
if ($clearBuffer) {
$this->clearBuffer();
}
}
public function clearBuffer(): void
{
$this->buffer = [];
}
public function log(string $message, $priority = null): void
{
if ($priority && !is_int($priority) && in_array($priority, $this->priorities)) {
$priority = array_search($priority, $this->priorities);
}
if ($priority === null || !array_key_exists($priority, $this->priorities)) {
$priority = $this->getWriter()->getOption('default_priority');
}
$logMessage = $this->getWriter()->getOption('log_format');
$lineEnding = $this->getWriter()->getOption('line_ending');
foreach ($this->shortcutHandlers as $shortcut => $handler) {
if (cString::getPartOfString($shortcut, 0, 1) != '%') {
$shortcut = '%' . $shortcut;
}
$info = [
'message' => $message,
'priority' => $priority
];
$value = call_user_func($handler, $info);
$logMessage = str_replace($shortcut, $value, $logMessage);
}
$this->getWriter()->write($logMessage . $lineEnding, $priority);
}
/**
* @throws InvalidArgumentException
*/
public function addPriority(string $name, int $value): void
{
if ($name == '') {
throw new InvalidArgumentException('Priority name must not be empty.');
}
if (in_array($name, $this->priorities)) {
throw new InvalidArgumentException('The given priority name already exists.');
}
if (array_key_exists($value, $this->priorities)) {
throw new InvalidArgumentException('The priority value already exists.');
}
$this->priorities[$value] = $name;
}
/**
* @throws InvalidArgumentException
*/
public function removePriority(string $name): void
{
if ($name == '') {
throw new InvalidArgumentException('Priority name must not be empty.');
}
if (!in_array($name, $this->priorities)) {
throw new InvalidArgumentException('Priority name does not exist.');
}
if (in_array($name, $this->defaultPriorities)) {
throw new InvalidArgumentException('Removing default priorities is not allowed.');
}
$priorityIndex = array_search($name, $this->priorities);
unset($this->priorities[$priorityIndex]);
}
/**
* @throws InvalidArgumentException
*/
public function __call(string $method, array $arguments) {
$priorityName = cString::toUpperCase($method);
if (!in_array($priorityName, $this->priorities)) {
throw new InvalidArgumentException('The given priority ' . $priorityName . ' is not supported.');
}
$priorityIndex = array_search($priorityName, $this->priorities);
$this->log($arguments[0], $priorityIndex);
}
/**
* Shortcut Handler Date.
* Returns the current date.
*
* @return string
* The current date
*/
public function shDate(): string
{
return date('Y-m-d H:i:s');
}
/**
* Shortcut Handler Level.
* Returns the canonical name of the priority.
* The canonical name is padded to 10 characters to achieve a better
* formatting.
*
* @param array $info
* @return string
* The canonical log level
*/
public function shLevel(array $info): string
{
$logLevel = $info['priority'];
return str_pad($this->priorities[$logLevel], 10, ' ', STR_PAD_BOTH);
}
/**
* Shortcut Handler Message.
* Returns the log message.
*
* @param array $info
* @return string
* The log message
*/
public function shMessage(array $info): string
{
return $info['message'];
}
}

Datei anzeigen

@ -0,0 +1,66 @@
<?php
namespace ConLite\Log;
use ConLite\Exceptions\InvalidArgumentException;
abstract class LogWriter
{
/**
* @param array $options
*/
public function __construct(
protected array $options = []
)
{
$this->setOptions($options);
$this->setOption('default_priority', Log::INFO, false);
$this->setOption('line_ending', PHP_EOL, false);
}
/**
* @throws invalidArgumentException
*/
public static function factory($writerName, array $writerOptions): LogWriter
{
$logWriterClassName = __NAMESPACE__ . '\\LogWriter' . ucfirst($writerName);
if(!class_exists($logWriterClassName)) {
throw new InvalidArgumentException('Unknown ConLite LogWriter class: ' . $logWriterClassName);
}
$writer = new $logWriterClassName($writerOptions);
if(!($writer instanceof LogWriter)) {
throw new InvalidArgumentException('Provided class is not an instance of ConLite LogWriter');
}
return $writer;
}
public function getOptions(): array
{
return $this->options;
}
public function getOption($option) {
return $this->options[$option];
}
public function setOptions(array $options): void
{
$this->options = $options;
}
public function setOption($option, $value, $force = false) {
if (!$force && isset($this->options[$option])) {
return;
}
$this->options[$option] = $value;
}
public function removeOption($option) {
unset($this->options[$option]);
}
abstract function write($message, $priority);
}

Datei anzeigen

@ -0,0 +1,135 @@
<?php
namespace ConLite\Log;
use ConLite\Exceptions\Exception;
use ConLite\Exceptions\FileNotFoundException;
use DirectoryIterator;
class LogWriterFile extends LogWriter
{
/**
* @var resource
*/
protected $handle = NULL;
/**
* @var int
*/
protected int $maxLogFileSize = 1024;
/**
* @var int
*/
protected int $maxRotationFiles = 10;
/**
* @throws FileNotFoundException
* @throws Exception
*/
public function __construct(array $options = []) {
parent::__construct($options);
$logFileSize = (int) getEffectiveSetting('log', 'writer-file-size-' . basename($this->getOption('destination')), $this->getOption('logFileSize') ?? 0);
if($logFileSize > 0) {
$this->maxLogFileSize = $logFileSize;
}
$this->createHandle();
}
/**
* @param string $message
* @param int $priority
* @return bool
*/
public function write($message, $priority): bool
{
$this->rotateLog();
return fwrite($this->handle, $message) != false;
}
public function __destruct()
{
$this->closeHandle();
}
/**
* @throws Exception
* @throws FileNotFoundException
*/
protected function createHandle(): void
{
$destination = $this->getOption('destination');
if ($destination == '') {
throw new Exception('No destination was specified.');
}
if (($this->handle = fopen($destination, 'a')) === false) {
throw new FileNotFoundException('Destination handle could not be created.');
}
}
protected function closeHandle(): void
{
fclose($this->handle);
}
protected function rotateLog()
{
$logfile = $this->getOption('destination');
if(!file_exists($logfile)) {
cWarning(__FILE__, __LINE__, 'Logfile ' . $logfile . ' not found.');
return false;
} elseif (!is_readable($logfile)) {
cWarning(__FILE__, __LINE__, 'Logfile ' . $logfile . ' not readable.');
return false;
}
if (filesize($logfile) >= $this->maxLogFileSize * 1024) {
$pathInfo = pathinfo($logfile);
$baseDirectory = $pathInfo['dirname'];
$baseName = $pathInfo['basename'];
$numMap = [];
foreach (new DirectoryIterator($baseDirectory) as $fileInfo) {
if ($fileInfo->isDot() || !$fileInfo->isFile()) {
continue;
}
if (preg_match('/^' . $baseName . '\.?([0-9]*)$/', $fileInfo->getFilename(), $matches)) {
$num = $matches[1];
$file2move = $fileInfo->getFilename();
if ($num == '') {
$num = 0;
}
$numMap[$num] = $file2move;
}
}
krsort($numMap);
foreach ($numMap as $num => $file2move) {
$targetN = $num + 1;
if($targetN > $this->maxRotationFiles) {
unlink($baseDirectory . DIRECTORY_SEPARATOR . $file2move);
continue;
}
rename($baseDirectory . DIRECTORY_SEPARATOR . $file2move, $baseDirectory . DIRECTORY_SEPARATOR .$baseName . '.' . $targetN);
}
return true;
}
return false;
}
public function getMaxLogFileSize(): int
{
return $this->maxLogFileSize;
}
public function setMaxLogFileSize(int $maxLogFileSize): void
{
$this->maxLogFileSize = $maxLogFileSize;
}
}

Datei anzeigen

@ -0,0 +1,8 @@
<?php
namespace ConLite\Log;
class ModuleLog extends Log
{
}

Datei anzeigen

@ -5,7 +5,7 @@
*
* Description:
* Base Class for all cHTML Elements
*
*
* @category ConLite
* @package Core
* @subpackage cHTML
@ -20,11 +20,7 @@
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
/*
if (!class_exists("HTML_Common2")) {
cInclude("pear", "HTML/Common2.php");
}
*/
/* Global ID counter */
$cHTMLIDCount = 0;
@ -33,11 +29,12 @@ $cHTMLIDCount = 0;
*
* @author Ortwin Pinke <o.pinke@conlite.org>
*/
class cHTML extends cHTML5Common {
class cHTML extends cHTML5Common
{
/**
* Storage of the open SGML tag template
* @var string
* @var string
*/
protected $_skeleton_open;
@ -61,15 +58,15 @@ class cHTML extends cHTML5Common {
/**
* Defines the style definitions
* @var string
* @var array
*/
protected $_styledefs;
protected $_styledefs = [];
/**
* Defines all scripts which are required by the current element
* @var array
*/
protected $_requiredScripts;
protected $_requiredScripts = [];
/**
* @var boolean Defines if the current tag is a contentless tag
@ -79,31 +76,32 @@ class cHTML extends cHTML5Common {
/**
* @var array Defines which JS events contain which scripts
*/
protected $_aEventDefinitions;
protected $_aEventDefinitions = [];
/**
* @var array Style definitions
*/
protected $_aStyleDefinitions;
* @var array Style definitions
*/
protected $_aStyleDefinitions = [];
/**
* @var string The content itself
*/
* @var string The content itself
*/
protected $_content;
protected $_aCfg;
/**
* Constructor Function
* Initializes the SGML open/close tags
*
* @param none
* @return void
*/
public function __construct() {
global $cfg;
$this->_aCfg = $cfg;
* Constructor Function
* Initializes the SGML open/close tags
*
* @param none
* @return void
*/
public function __construct()
{
$this->_aCfg = cRegistry::getConfig();
parent::__construct();
$this->_skeleton_open = '<%s%s>';
$this->_skeleton_close = '</%s>';
@ -112,50 +110,52 @@ class cHTML extends cHTML5Common {
/* Cache the XHTML setting for performance reasons */
if (!is_array($this->_aCfg) || !array_key_exists("generate_xhtml", $this->_aCfg)) {
if (function_exists("getEffectiveSetting")) {
$bXhtml = (getEffectiveSetting("generator", "xhtml") == 'true'
|| getEffectiveSetting("generator", "xhtml") === TRUE)?true:false;
$bXhtml = (getEffectiveSetting("generator", "xhtml") == 'true'
|| getEffectiveSetting("generator", "xhtml") === TRUE) ? true : false;
$this->_aCfg["generate_xhtml"] = $bXhtml;
} else {
$this->_aCfg["generate_xhtml"] = false;
$this->_aCfg["generate_xhtml"] = false;
}
}
if($this->_aCfg["generate_xhtml"] === true) {
if ($this->_aCfg["generate_xhtml"] === true) {
$this->_skeleton_single = '<%s%s />';
} else {
$this->_skeleton_single = '<%s%s>';
}
$this->_styledefs = array ();
$this->_aStyleDefinitions = array();
$this->_styledefs = [];
$this->_aStyleDefinitions = [];
$this->setContentlessTag();
$this->advanceID();
$this->_requiredScripts = array ();
$this->_aEventDefinitions = array ();
$this->_requiredScripts = [];
$this->_aEventDefinitions = [];
}
/**
*
* @param type $contentlessTag
* @param type $contentlessTag
*/
public function setContentlessTag($contentlessTag = true) {
public function setContentlessTag($contentlessTag = true)
{
$this->_contentlessTag = $contentlessTag;
}
/**
* advances to the next ID available in the system.
*
*
* This function is useful if you need to use HTML elements
* in a loop, but don't want to re-create new objects each time.
*
* @return void
* @return void
*/
public function advanceID() {
public function advanceID()
{
global $cHTMLIDCount;
$cHTMLIDCount ++;
$this->updateAttributes(array ("id" => "m".$cHTMLIDCount));
$cHTMLIDCount++;
$this->updateAttributes(array("id" => "m" . $cHTMLIDCount));
}
/**
@ -163,24 +163,26 @@ class cHTML extends cHTML5Common {
*
* @return string current ID
*/
public function getID() {
public function getID()
{
return $this->getAttribute("id");
}
/**
* setAlt: sets the alt and title attributes
*
* Sets the "alt" and "title" tags. Usually, "alt" is used
* Sets the "alt" and "title" tags. Usually, "alt" is used
* for accessibility and "title" for mouse overs.
*
*
* To set the text for all browsers for mouse over, set "alt"
* and "title". IE behaves incorrectly and shows "alt" on
* and "title". IE behaves incorrectly and shows "alt" on
* mouse over. Mozilla browsers only show "title" as mouse over.
*
* @param string $alt Text to set as the "alt" attribute
*/
public function setAlt($alt) {
$attributes = array ("alt" => $alt, "title" => $alt);
public function setAlt($alt)
{
$attributes = array("alt" => $alt, "title" => $alt);
$this->updateAttributes($attributes);
}
@ -189,8 +191,9 @@ class cHTML extends cHTML5Common {
*
* @param string $class Text to set as the "id"
*/
public function setID($id) {
$this->updateAttributes(array ("id" => $id));
public function setID($id)
{
$this->updateAttributes(array("id" => $id));
}
/**
@ -198,8 +201,9 @@ class cHTML extends cHTML5Common {
*
* @param string $class Text to set as the "class" attribute
*/
public function setClass($class) {
$this->updateAttributes(array ("class" => $class));
public function setClass($class)
{
$this->updateAttributes(array("class" => $class));
}
/**
@ -207,8 +211,9 @@ class cHTML extends cHTML5Common {
*
* @param $class string Text to set as the "style" attribute
*/
public function setStyle($style) {
$this->updateAttributes(array ("style" => $style));
public function setStyle($style)
{
$this->updateAttributes(array("style" => $style));
}
/**
@ -220,11 +225,12 @@ class cHTML extends cHTML5Common {
* @param $event string Type of the event
* @param $action string Function or action to call (JavaScript Code)
*/
public function setEvent($event, $action) {
public function setEvent($event, $action)
{
if (substr($event, 0, 2) != "on") {
$this->updateAttributes(array ("on".$event => $action));
$this->updateAttributes(array("on" . $event => $action));
} else {
$this->updateAttributes(array ($event => $action));
$this->updateAttributes(array($event => $action));
}
}
@ -236,9 +242,10 @@ class cHTML extends cHTML5Common {
*
* @param $event string Type of the event
*/
public function unsetEvent($event) {
public function unsetEvent($event)
{
if (substr($event, 0, 2) != "on") {
$this->removeAttribute("on".$event);
$this->removeAttribute("on" . $event);
} else {
$this->removeAttribute($event);
}
@ -246,7 +253,7 @@ class cHTML extends cHTML5Common {
/**
* fillSkeleton: Fills the open SGML tag skeleton
*
*
* fillSkeleton fills the SGML opener tag with the
* specified attributes. Attributes need to be passed
* in the stringyfied variant.
@ -254,11 +261,12 @@ class cHTML extends cHTML5Common {
* @param $attributes string Attributes to set
* @return string filled SGML opener skeleton
*/
public function fillSkeleton($attributes) {
public function fillSkeleton($attributes)
{
if ($this->_contentlessTag == true) {
return sprintf($this->_skeleton_single, $this->_tag, $attributes);
} else {
return sprintf($this->_skeleton_open, $this->_tag, $attributes);
return is_null($this->_skeleton_open) ? '' : sprintf($this->_skeleton_open, $this->_tag, $attributes);
}
}
@ -268,63 +276,68 @@ class cHTML extends cHTML5Common {
* @param none
* @return string filled SGML closer skeleton
*/
public function fillCloseSkeleton() {
return sprintf($this->_skeleton_close, $this->_tag);
public function fillCloseSkeleton()
{
return is_null($this->_skeleton_close) ? '' : sprintf($this->_skeleton_close, $this->_tag);
}
/**
* addStyleDefinition
*
* @deprecated name change, use attachStyleDefinition
* @param $entity string Entity to define
* @param $definition string Definition for the given entity
* @param $definition string Definition for the given entity
* @return string filled SGML closing skeleton
* @deprecated name change, use attachStyleDefinition
*/
public function setStyleDefinition($entity, $definition) {
public function setStyleDefinition($entity, $definition)
{
$this->_styledefs[$entity] = $definition;
}
/**
* attachStyleDefinition: Attaches a style definition.
*
*
* This function is not restricted to a single style, e.g.
* you can set multiple style definitions as-is to the handler.
*
*
* $example->attachStyle("myIdentifier",
* "border: 1px solid black; white-space: nowrap");
* "border: 1px solid black; white-space: nowrap");
* $example->attachStyle("myIdentifier2",
* "padding: 0px");
*
* "padding: 0px");
*
* Results in:
*
*
* style="border: 1px solid black; white-space: nowrap; padding: 0px;"
*
* @param $sName string Name for a style definition
* @param $sDefinition string Definition for the given entity
* @param $sName string Name for a style definition
* @param $sDefinition string Definition for the given entity
* @return string filled SGML closing skeleton
*/
public function attachStyleDefinition($sName, $sDefinition) {
public function attachStyleDefinition($sName, $sDefinition)
{
$this->_aStyleDefinitions[$sName] = $sDefinition;
}
/**
*
*
* @param string $script
*/
public function addRequiredScript($script) {
public function addRequiredScript($script)
{
if (!is_array($this->_requiredScripts)) {
$this->_requiredScripts = array ();
$this->_requiredScripts = [];
}
$this->_requiredScripts[] = $script;
$this->_requiredScripts = array_unique($this->_requiredScripts);
}
/**
*
*
* @param array $aAttributes
* @return array
*/
public function updateAttributes($aAttributes) {
public function updateAttributes($aAttributes)
{
return $this->mergeAttributes($aAttributes);
}
@ -334,20 +347,21 @@ class cHTML extends cHTML5Common {
* @param $content string/object String with the content or an object to render.
*
*/
public function _setContent($content) {
public function _setContent($content)
{
$this->setContentlessTag(false);
/* Is it an array? */
if(is_array($content)) {
if (is_array($content)) {
unset ($this->_content);
$this->_content = "";
foreach($content as $item) {
if(is_object($item)) {
if(method_exists($item, "render")) {
foreach ($content as $item) {
if (is_object($item)) {
if (method_exists($item, "render")) {
$this->_content .= $item->render();
}
if(count($item->_requiredScripts) > 0) {
if (count($item->_requiredScripts) > 0) {
$this->_requiredScripts = array_merge($this->_requiredScripts, $item->_requiredScripts);
}
} else {
@ -355,12 +369,12 @@ class cHTML extends cHTML5Common {
}
}
} else {
if(is_object($content)) {
if(method_exists($content, "render")) {
if (is_object($content)) {
if (method_exists($content, "render")) {
$this->_content = $content->render();
}
if(count($content->_requiredScripts) > 0) {
if (is_countable($content->_requiredScripts) && count($content->_requiredScripts) > 0) {
$this->_requiredScripts = array_merge($this->_requiredScripts, $content->_requiredScripts);
}
return;
@ -372,92 +386,95 @@ class cHTML extends cHTML5Common {
/**
* attachEventDefinition: Attaches the code for an event
*
*
* Example to attach an onClick handler:
* setEventDefinition("foo", "onClick", "alert('foo');");
*
*
* @param $sName string defines the name of the event
* @param $sEvent string defines the event (e.g. onClick)
* @param $sCode string defines the code
*/
public function attachEventDefinition($sName, $sEvent, $sCode) {
public function attachEventDefinition($sName, $sEvent, $sCode)
{
$this->_aEventDefinitions[strtolower($sEvent)][$sName] = $sCode;
}
/**
* setAttribte: Sets a specific attribute
*
*
* @param $sAttributeName string Name of the attribute
* @param $sValue string Value of the attribute
*/
public function setAttribute($sAttributeName, $sValue = NULL) {
public function setAttribute($sAttributeName, $sValue = NULL)
{
$sAttributeName = strtolower($sAttributeName);
if (is_null($sValue)) {
$sValue = $sAttributeName;
}
$this->updateAttributes(array ($sAttributeName => $sValue));
$this->updateAttributes(array($sAttributeName => $sValue));
}
/**
*
*
* @return string
*/
public function __toString() {
public function __toString()
{
return $this->toHtml();
}
/**
* Renders the output
* If the tag
*/
public function toHTML() {
/* Fill style definition */
$style = $this->getAttribute("style");
/* If the style doesn't end with a semicolon, append one */
if(is_string($style)) {
$style = trim($style);
if (substr($style, strlen($style) - 1) != ";") {
$style .= ";";
}
}
foreach($this->_aStyleDefinitions as $sEntry) {
$style .= $sEntry;
if (substr($style, strlen($style) - 1) != ";") {
$style .= ";";
}
}
foreach($this->_aEventDefinitions as $sEventName => $sEntry) {
$aFullCode = array();
foreach ($sEntry as $sName => $sCode) {
$aFullCode[] = $sCode;
}
$this->setAttribute($sEventName, $this->getAttribute($sEventName).implode(" ", $aFullCode));
}
/* Apply all stored styles */
foreach ($this->_styledefs as $key => $value) {
$style .= "$key: $value;";
}
if ($style != "") {
$this->setStyle($style);
}
if ($this->_content != "" || $this->_contentlessTag == false) {
$attributes = $this->getAttributes(true);
return $this->fillSkeleton($attributes).$this->_content.$this->fillCloseSkeleton();
} else {
/* This is a single style tag */
$attributes = $this->getAttributes(true);
return $this->fillSkeleton($attributes);
}
}
/**
* Renders the output
* If the tag
*/
public function toHTML()
{
/* Fill style definition */
$style = $this->getAttribute("style");
/* If the style doesn't end with a semicolon, append one */
if (!empty($style) && is_string($style)) {
$style = trim($style);
if (substr($style, strlen($style) - 1) != ";") {
$style .= ";";
}
}
foreach ($this->_aStyleDefinitions as $sKey => $sEntry) {
$style .= $sKey . ': ' . $sEntry;
if (substr($style, strlen($style) - 1) != ";") {
$style .= ";";
}
}
/* Apply all stored styles */
foreach ($this->_styledefs as $key => $value) {
$style .= "$key: $value;";
}
if ($style != "") {
$this->setStyle($style);
}
foreach ($this->_aEventDefinitions as $sEventName => $sEntry) {
$aFullCode = [];
foreach ($sEntry as $sName => $sCode) {
$aFullCode[] = $sCode;
}
$this->setAttribute($sEventName, $this->getAttribute($sEventName) . implode(" ", $aFullCode));
}
if ($this->_content != "" || $this->_contentlessTag == false) {
$attributes = $this->getAttributes(true);
return $this->fillSkeleton($attributes) . $this->_content . $this->fillCloseSkeleton();
} else {
/* This is a single style tag */
$attributes = $this->getAttributes(true);
return $this->fillSkeleton($attributes);
}
}
/**
* render(): Alias for toHtml
@ -465,8 +482,8 @@ class cHTML extends cHTML5Common {
* @param none
* @return string Rendered HTML
*/
public function render() {
public function render()
{
return $this->toHtml();
}
}
?>
}

Datei anzeigen

@ -34,7 +34,7 @@ class cArticleCollector implements SeekableIterator, Countable {
protected $_aStartArticles = array();
protected $_aOptions = array();
protected $_aOptionsDefault = array();
private $_bAsObject = TRUE;
private $_bAsObject = true;
/**
*
@ -65,14 +65,12 @@ class cArticleCollector implements SeekableIterator, Countable {
}
if (count($this->_aStartArticles) > 0) {
print_r($this->_aStartArticles);
if ($this->_aOptions['start'] == false) {
$oArtLangColl->setWhere("cApiArticleLanguageCollection.idartlang", $this->_aStartArticles, "NOTIN");
//$sqlStartArticles = "a.idartlang NOT IN ('" . implode("','", $this->_startArticles) . "') AND ";
}
if ($this->_aOptions['startonly'] == true) {
echo "startonly";
$oArtLangColl->setWhere("cApiArticleLanguageCollection.idartlang", $this->_aStartArticles, "IN");
//$sqlStartArticles = "a.idartlang IN ('" . implode("','", $this->_startArticles) . "') AND ";
}
@ -89,7 +87,6 @@ class cArticleCollector implements SeekableIterator, Countable {
$oArtLangColl->setWhere("cApiArticleLanguageCollection.idlang", $this->_aOptions['lang']);
$oArtLangColl->query();
echo $oArtLangColl->_lastSQL;
if ($oArtLangColl->count() > 0) {
$aTable = $oArtLangColl->fetchTable();
//echo $oArtLangColl->_lastSQL;
@ -97,7 +94,6 @@ class cArticleCollector implements SeekableIterator, Countable {
foreach ($aTable as $aItem) {
$this->_aArticles[] = $aItem['idartlang'];
}
print_r($this->_aArticles);
}
}
@ -162,7 +158,7 @@ class cArticleCollector implements SeekableIterator, Countable {
*
* @return cApiArticleLanguage|int returns article language object or idartlang
*/
public function current() {
public function current() :cApiArticleLanguage|int{
$iIdartlang = $this->_aArticles[$this->_iCurrentPosition];
if ($this->_bAsObject) {
$oArticle = new cApiArticleLanguage($iIdartlang);

Datei anzeigen

@ -382,7 +382,8 @@ class DBFSItem extends Item {
parent::store();
}
public function setField($field, $value, $safe = true) {
public function setField($field, $value, $safe = true): bool
{
if ($field == "dirname" || $field == "filename" || $field == "mimetype") {
// Don't do safe encoding
$safe = false;
@ -391,7 +392,7 @@ class DBFSItem extends Item {
$value = str_replace('"', "", $value);
}
parent::setField($field, $value, $safe);
return parent::setField($field, $value, $safe);
}
}

Datei anzeigen

@ -157,12 +157,12 @@ class FrontendUser extends Item
* @param string $field Specifies the field to set
* @param string $value Specifies the value to set
*/
public function setField($field, $value, $safe = true)
public function setField($field, $value, $safe = true): bool
{
if ($field == "password") {
parent::setField($field, md5($value), $safe);
return parent::setField($field, md5($value), $safe);
} else {
parent::setField($field, $value, $safe);
return parent::setField($field, $value, $safe);
}
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -57,8 +57,7 @@ class cHTMLFormElement extends cHTML {
if (is_string($id) && !empty($id)) {
$this->updateAttributes(array("id" => $id));
}
$this->setClass("text_medium"); // TODO: Remove this...
$this->setDisabled($disabled);
$this->setTabindex($tabindex);
$this->setAccessKey($accesskey);
@ -594,7 +593,7 @@ class cHTMLSelectElement extends cHTMLFormElement {
* All cHTMLOptionElements
* @var array
*/
var $_options;
var $_options = [];
/**
* Constructor. Creates an HTML select field (aka "DropDown").
@ -867,6 +866,7 @@ class cHTMLRadiobutton extends cHTMLFormElement {
* @access private
*/
var $_value;
protected string $_labelText;
/**
* Constructor. Creates an HTML radio button element.
@ -931,7 +931,7 @@ class cHTMLRadiobutton extends cHTMLFormElement {
*/
function toHtml($renderLabel = true) {
$attributes = $this->getAttributes(true);
//print_r($attributes);
if ($renderLabel == false) {
return $this->fillSkeleton($attributes);
}
@ -1029,37 +1029,30 @@ class cHTMLCheckbox extends cHTMLFormElement {
* @return string Rendered HTML
*/
function toHtml($renderlabel = true) {
$attributes = $this->getAttributes(true);
if ($renderlabel == false) {
return $this->fillSkeleton($attributes);
}
$id = $this->getAttribute("id");
$renderedLabel = "";
if ($renderlabel == true) {
if ($id != "") {
$label = new cHTMLLabel($this->_value, $this->getAttribute("id"));
if ($id != "") {
$label = new cHTMLLabel($this->_value, $this->getAttribute("id"));
$label->setClass($this->getAttribute("class"));
if ($this->_labelText != "") {
$label->setLabelText($this->_labelText);
}
$renderedLabel = $label->toHtml();
} else {
$renderedLabel = $this->_value;
if ($this->_labelText != "") {
$label = new cHTMLLabel($this->_value, $this->getAttribute("id"));
$label->setLabelText($this->_labelText);
$renderedLabel = $label->toHtml();
}
if ($this->_labelText != "") {
$label->setLabelText($this->_labelText);
}
return '<table border="0" cellspacing="0" cellpadding="0"><tr><td nowrap="nowrap">' . parent::toHTML() . '</td><td nowrap="nowrap">' . $renderedLabel . '</td></tr></table>';
$renderedLabel = $label->toHtml();
} else {
return parent::toHTML();
$renderedLabel = $this->_value;
}
}
return $this->fillSkeleton($attributes) . $renderedLabel;
}
}
/**
@ -1162,6 +1155,8 @@ class cHTMLLink extends cHTML {
/* Stores the custom entries */
var $_custom;
protected $_type;
/**
* Constructor. Creates an HTML link.
@ -1449,6 +1444,9 @@ class cHTMLImage extends cHTML {
* @access private
*/
var $_height;
protected $_border;
protected $_type;
/**
* Constructor. Creates an HTML IMG element.

Datei anzeigen

@ -130,12 +130,7 @@ class cI18n {
// Is emulator to use?
if (!$cfg['native_i18n']) {
$ret = self::emulateGettext($string, $domain);
// hopefully a proper replacement for
// mb_convert_encoding($string, 'HTML-ENTITIES', 'utf-8');
// see http://stackoverflow.com/q/11974008
$ret = htmlspecialchars_decode(utf8_decode(conHtmlentities($ret, ENT_COMPAT, 'utf-8', false)));
return $ret;
return self::emulateGettext($string, $domain);
}
// Try to use native gettext implementation

Datei anzeigen

@ -255,7 +255,7 @@ class InUseCollection extends ItemCollection
}
if (!is_object($notification)) {
$notification = new Contenido_Notification;
$notification = new Contenido_Notification();
}
$noti = $notification->messageBox("warning", $message.$override, 0);
@ -293,6 +293,4 @@ class InUseItem extends Item
$this->loadByPrimaryKey($mId);
}
}
}
?>
}

Datei anzeigen

@ -447,7 +447,7 @@ class PropertyItem extends Item
* @param string $value
* @param bool $safe Flag to run filter on passed value
*/
public function setField($field, $value, $safe = true)
public function setField($field, $value, $safe = true): bool
{
if (array_key_exists($field, $this->maximumLength)) {
if (strlen($value) > $this->maximumLength[$field]) {
@ -455,7 +455,7 @@ class PropertyItem extends Item
}
}
parent::setField($field, $value, $safe);
return parent::setField($field, $value, $safe);
}
}

Datei anzeigen

@ -225,13 +225,13 @@ class Index extends SearchBaseAbstract {
*
* @var array
*/
var $cms_type = array();
protected static $_cms_type = [];
/**
* the suffix of all available cms types
* @var array
*/
var $cms_type_suffix = array();
protected static $_cms_type_suffix = [];
/**
* Constructor, set object properties
@ -270,6 +270,8 @@ class Index extends SearchBaseAbstract {
$this->idart = $idart;
}
$this->_debug('Start Index for ', $this->idart);
$this->place = $place;
$this->keycode = $aContent;
$this->setStopwords($aStopwords);
@ -283,7 +285,14 @@ class Index extends SearchBaseAbstract {
$old_keys = array_keys($this->keywords_old);
$this->keywords_del = array_diff($old_keys, $new_keys);
/*
echo '<pre>';
print_r($new_keys);
print_r($old_keys);
print_r($this->keywords_del);
echo '</pre>';
*
*/
if (count($this->keywords_del) > 0) {
$this->deleteKeywords();
}
@ -312,7 +321,7 @@ class Index extends SearchBaseAbstract {
foreach ($this->keycode as $idtype => $data) {
if ($this->checkCmsType($idtype)) {
foreach ($data as $typeid => $code) {
$this->_debug('code', $code);
$this->_debug('createKeywords: raw code from data array', $code);
$code = stripslashes($code); // remove backslash
$code = str_ireplace(array('<br>', '<br />'), "\n", $code); // replace HTML line breaks with newlines
@ -320,13 +329,18 @@ class Index extends SearchBaseAbstract {
if (strlen($code) > 0) {
$code = clHtmlEntityDecode($code);
}
$this->_debug('code', $code);
$this->_debug('createKeywords: code after clean', $code);
$tmp_keys = preg_split('/[\s,]+/', trim($code)); // split content by any number of commas or space characters
$this->_debug('tmp_keys', $tmp_keys);
$this->_debug('createKeywords: tmp_keys', $tmp_keys);
foreach ($tmp_keys as $value) {
$value = strtolower($value); // index terms are stored with lower case
$value = preg_replace('/[^\w]+/u', '', $value);
if (empty(trim($value))) {
continue;
}
if (!in_array($value, $this->stopwords)) {
// eliminate stopwords
@ -335,6 +349,7 @@ class Index extends SearchBaseAbstract {
if (strlen($value) > 1) {
// do not index single characters
$this->keywords[$value] = $this->keywords[$value] . $idtype . '-' . $typeid . ' ';
$this->_debug('createKeywords: entry array keywords', $this->keywords);
}
}
}
@ -345,7 +360,7 @@ class Index extends SearchBaseAbstract {
}
}
$this->_debug('keywords', $this->keywords);
$this->_debug('createKeywords: keywords returned', $this->keywords);
}
/**
@ -357,9 +372,10 @@ class Index extends SearchBaseAbstract {
$tmp_count = array();
foreach ($this->keywords as $keyword => $count) {
$bProceed = true;
$this->_debug('keyword', $keyword);
$tmp_count = preg_split('/[\s]/', trim($count));
$this->_debug('tmp_count', $tmp_count);
$occurrence = count($tmp_count);
$tmp_count = array_unique($tmp_count);
$cms_types = implode(',', $tmp_count);
@ -376,8 +392,12 @@ class Index extends SearchBaseAbstract {
('" . Contenido_Security::escapeDB($keyword, $this->db) . "', '" . Contenido_Security::escapeDB($index_string, $this->db) . "', " . Contenido_Security::toInteger($this->lang) . ", " . Contenido_Security::toInteger($nextid) . ")";
} else {
// if keyword allready exists, create new index_string
if (preg_match("/&$this->idart=/", $this->keywords_old[$keyword])) {
$index_string = preg_replace("/&$this->idart=[0-9]+\([\w-,]+\)/", $index_string, $this->keywords_old[$keyword]);
if (preg_match("/&" . $this->idart . "=/", $this->keywords_old[$keyword])) {
$index_string = preg_replace("/&" . $this->idart . "=[0-9]+\([,\w-]+\)/", $index_string, $this->keywords_old[$keyword]);
if ($index_string === $this->keywords_old[$keyword]) {
$bProceed = false;
$this->_debug('db update', 'no update needed');
}
} else {
$index_string = $this->keywords_old[$keyword] . $index_string;
}
@ -386,9 +406,11 @@ class Index extends SearchBaseAbstract {
SET " . $this->place . " = '" . $index_string . "'
WHERE idlang='" . Contenido_Security::toInteger($this->lang) . "' AND keyword='" . Contenido_Security::escapeDB($keyword, $this->db) . "'";
}
$this->_debug('sql', $sql);
$this->db->query($sql);
if ($bProceed) {
$this->_debug('sql', $sql);
$this->db->query($sql);
}
}
}
@ -431,7 +453,7 @@ class Index extends SearchBaseAbstract {
idlang=" . Contenido_Security::toInteger($this->lang) . " AND
(keyword IN ('" . $keys . "') OR " . $this->place . " REGEXP '&" . Contenido_Security::toInteger($this->idart) . "=')";
$this->_debug('sql', $sql);
$this->_debug('getKeywords: sql', $sql);
$this->db->query($sql);
@ -440,6 +462,8 @@ class Index extends SearchBaseAbstract {
while ($this->db->next_record()) {
$this->keywords_old[$this->db->f('keyword')] = $this->db->f($place);
}
$this->_debug('getKeywords: array keywords_old', $this->keywords_old);
}
/**
@ -448,6 +472,7 @@ class Index extends SearchBaseAbstract {
* @return $key
*/
function removeSpecialChars($key) {
$aSpecialChars = array(
"-", "_", "'", ".", "!", "\"", "#", "$", "%", "&", "(", ")", "*", "+", ",", "/",
":", ";", "<", "=", ">", "?", "@", "[", "\\", "]", "^", "`", "{", "|", "}", "~"
@ -461,6 +486,7 @@ class Index extends SearchBaseAbstract {
// a client and should not be treated in this method.
// modified 2007-10-01, H. Librenz - added as hotfix for encoding problems (doesn't find any words with
// umlaut vowels in it since you turn on UTF-8 as language encoding)
$sEncoding = getEncodingByLanguage($this->db, $this->lang, $this->cfg);
if (strtolower($sEncoding) != 'iso-8859-2') {
@ -486,6 +512,9 @@ class Index extends SearchBaseAbstract {
$key = clHtmlEntityDecode($key);
$key = str_replace($aSpecialChars, '', $key);
ini_set('mbstring.substitute_character', "none");
$key = mb_convert_encoding($key, 'UTF-8', 'UTF-8');
return $key;
}
@ -516,6 +545,21 @@ class Index extends SearchBaseAbstract {
return $key;
}
/**
*
* @return array array with arrays of type and typesuffix
*/
public function getContentTypes(): array {
if (empty(self::$_cms_type)) {
$this->setContentTypes();
}
return array(
'cms_type' => self::$_cms_type,
'cms_type_suffix' => self::$_cms_type_suffix
);
}
/**
* set the array of stopwords which should not be indexed
* @param array $aStopwords
@ -537,8 +581,8 @@ class Index extends SearchBaseAbstract {
$this->_debug('sql', $sql);
$this->db->query($sql);
while ($this->db->next_record()) {
$this->cms_type[$this->db->f('type')] = $this->db->f('idtype');
$this->cms_type_suffix[$this->db->f('idtype')] = substr($this->db->f('type'), 4, strlen($this->db->f('type')));
self::$_cms_type[$this->db->f('type')] = $this->db->f('idtype');
self::$_cms_type_suffix[$this->db->f('idtype')] = substr($this->db->f('type'), 4, strlen($this->db->f('type')));
}
}
@ -554,11 +598,11 @@ class Index extends SearchBaseAbstract {
if (strlen($opt) > 0) {
if (!stristr($opt, 'cms_')) {
if (in_array($opt, $this->cms_type_suffix)) {
if (in_array($opt, $this->getContentTypes()['cms_type_suffix'])) {
$this->cms_options[$opt] = 'CMS_' . $opt;
}
} else {
if (array_key_exists($opt, $this->cms_type)) {
if (array_key_exists($opt, $this->getContentTypes()['cms_type'])) {
$this->cms_options[$opt] = $opt;
}
}
@ -788,8 +832,8 @@ class Search extends SearchBaseAbstract {
$this->index = new Index($oDB);
$this->cms_type = $this->index->cms_type;
$this->cms_type_suffix = $this->index->cms_type_suffix;
$this->cms_type = $this->index->getContentTypes()['cms_type'];
$this->cms_type_suffix = $this->index->getContentTypes()['cms_type_suffix'];
$this->search_option = (array_key_exists('db', $options)) ? strtolower($options['db']) : 'regexp';
$this->search_combination = (array_key_exists('combine', $options)) ? strtolower($options['combine']) : 'or';
@ -1339,11 +1383,11 @@ class SearchResult extends SearchBaseAbstract {
$cms_type = strtoupper($cms_type);
if (strlen($cms_type) > 0) {
if (!stristr($cms_type, 'cms_')) {
if (in_array($cms_type, $this->index->cms_type_suffix)) {
if (in_array($cms_type, $this->index->getContentTypes()['cms_type'])) {
$cms_type = 'CMS_' . $cms_type;
}
} else {
if (!array_key_exists($cms_type, $this->index->cms_type)) {
if (!array_key_exists($cms_type, $this->index->getContentTypes()['cms_type_suffix'])) {
return array();
}
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -508,23 +508,47 @@ class Contenido_UpdateNotifier {
$response = false;
if ($this->_bUseCurl) {
if ($bCheckCon) {
$ch = $this->_checkCon2Host($sHost);
} else {
$ch = curl_init("http://" . $sHost);
}
if (is_resource($ch)) {
curl_setopt($ch, CURLOPT_URL, "http://" . $sHost . $sFile);
$sUrl = "https://" . $sHost . $sFile;
$ch = $this->_checkCon2Host($sUrl);
if ($ch !== false) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
//Check for errors.
if (curl_errno($ch)) {
throw new Exception(curl_error($ch));
}
curl_close($ch);
}
/*
if ($bCheckCon) {
$ch = $this->_checkCon2Host($sHost);
} else {
$ch = curl_init("https://" . $sHost);
}
if (is_resource($ch)) {
curl_setopt($ch, CURLOPT_URL, "https://" . $sHost . $sFile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
$response = curl_exec($ch);
curl_close($ch);
} */
} else {
$source = file_get_contents("http://" . $sHost . $sFile);
if ($source !== false AND ! empty($source)) {
$arrContextOptions = array(
"ssl" => array(
"verify_peer" => false,
"verify_peer_name" => false,
)
);
$source = file_get_contents("https://" . $sHost . $sFile, false, stream_context_create($arrContextOptions));
if ($source !== false AND !empty($source)) {
$response = $source;
}
}
@ -539,13 +563,12 @@ class Contenido_UpdateNotifier {
* @param string $sHost
* @return obj|boolean curl object or false
*/
protected function _checkCon2Host($sHost) {
$ch = curl_init("http://" . $sHost);
if (!is_resource($ch)) {
protected function _checkCon2Host($sUrl) {
$ch = curl_init($sUrl);
if ($ch === false) {
$sErrorMessage = i18n('Unable to check for updates!') . " "
. sprintf(i18n('Connection to %s failed!'), $sHost);
$this->sErrorOutput = $this->renderOutput($sErrorMessage);
return false;
}
return $ch;
}
@ -700,7 +723,7 @@ class Contenido_UpdateNotifier {
if (strlen($sText) > 150) {
$sText = capiStrTrimAfterWord($sText, 150) . '...';
}
//echo $aItem->title;
//echo $aItem->title;
$oTpl->set("d", "NEWS_DATE", $aItem->pubDate);
$oTpl->set("d", "NEWS_TITLE", utf8_decode($aItem->title));
$oTpl->set("d", "NEWS_TEXT", $sText);

Datei anzeigen

@ -32,7 +32,7 @@ class cRegistry {
*/
public static function getBackendPath() {
$cfg = self::getConfig();
return $cfg['path']['contenido'];
return $cfg['path']['conlite'];
}
/**
@ -219,6 +219,11 @@ class cRegistry {
return self::_fetchGlobalVariable('edit', FALSE);
}
public static function getCurrentModule()
{
return self::_fetchGlobalVariable('cCurrentModule', 0);
}
/**
* Fetches the global variable requested.
* If variable is not set, the default value is returned.
@ -246,5 +251,4 @@ class cRegistry {
return new $apiClassName($objectId);
}
}
?>
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* File:
* class.articlelanguage.php
@ -18,14 +19,12 @@
*
* $Id$
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class cApiArticleLanguageCollection extends ItemCollection {
public function __construct($select = false) {
global $cfg;
parent::__construct($cfg["tab"]["art_lang"], "idartlang");
@ -36,26 +35,26 @@ class cApiArticleLanguageCollection extends ItemCollection {
$this->select($select);
}
}
public function getIdArtLang($iIdart, $iIdlang) {
$this->setWhere('idart', Contenido_Security::toInteger($iIdart));
$this->setWhere('idlang', Contenido_Security::toInteger($iIdlang));
if($this->query() && $this->count() > 0) {
if ($this->query() && $this->count() > 0) {
return $this->next()->get('idartlang');
}
return false;
}
}
class cApiArticleLanguage extends Item {
class cApiArticleLanguage extends Item
{
/**
* Constructor Function
* @param mixed $mId Specifies the ID of item to load
*
* @global type $cfg
* @param type $mId
*/
public function __construct($mId = false)
{
public function __construct($mId = false) {
global $cfg;
parent::__construct($cfg["tab"]["art_lang"], "idartlang");
$this->setFilters(array(), array());
@ -63,24 +62,23 @@ class cApiArticleLanguage extends Item
$this->loadByPrimaryKey($mId);
}
}
public function loadByArticleAndLanguageId($idart, $idlang) {
$result = true;
if (!$this->isLoaded()) {
if (!$this->isLoaded()) {
$idartlang = $this->_getIdArtLang($idart, $idlang);
$result = $this->loadByPrimaryKey($idartlang);
}
return $result;
}
protected function _getIdArtLang($idart, $idlang) {
$sql = sprintf('SELECT idartlang FROM `%s` WHERE idart = %d AND idlang = %d', cRegistry::getConfigValue('tab', 'art_lang'), $idart, $idlang);
$this->db->query($sql);
$this->db->next_record();
return $this->db->f('idartlang');
}
public function getContent($type = '', $id = NULL) {
if (NULL === $this->content) {
$this->_loadArticleContent();
@ -108,16 +106,16 @@ class cApiArticleLanguage extends Item
// return String
return (isset($this->content[$type][$id])) ? $this->content[$type][$id] : '';
}
protected function _loadArticleContent() {
if (NULL !== $this->content) {
return;
}
$sql = "SELECT b.type, a.typeid, a.value FROM `".cRegistry::getConfigValue('tab', 'content')
."` AS a, `".cRegistry::getConfigValue('tab', 'type')
."` AS b WHERE a.idartlang = ".$this->get('idartlang')
." AND b.idtype = a.idtype ORDER BY a.idtype, a.typeid";
$sql = "SELECT b.type, a.typeid, a.value FROM `" . cRegistry::getConfigValue('tab', 'content')
. "` AS a, `" . cRegistry::getConfigValue('tab', 'type')
. "` AS b WHERE a.idartlang = " . $this->get('idartlang')
. " AND b.idtype = a.idtype ORDER BY a.idtype, a.typeid";
$this->db->query($sql);
@ -126,5 +124,7 @@ class cApiArticleLanguage extends Item
$this->content[strtolower($this->db->f('type'))][$this->db->f('typeid')] = urldecode($this->db->f('value'));
}
}
}
?>

Datei anzeigen

@ -52,6 +52,4 @@ class cApiCategory extends Item {
}
}
}
?>
}

Datei anzeigen

@ -51,17 +51,18 @@ class cApiCategoryLanguage extends Item {
}
}
public function setField($field, $value, $bSafe = true) {
public function setField($field, $value, $bSafe = true): bool
{
switch ($field) {
case "name":
$this->setField("urlname", $value);
self::setField("urlname", $value, $bSafe);
break;
case "urlname":
$value = clHtmlSpecialChars(capiStrCleanURLCharacters($value), ENT_QUOTES);
break;
}
parent::setField($field, $value);
return parent::setField($field, $value, $bSafe);
}
public function assignTemplate($idtpl) {

Datei anzeigen

@ -6,7 +6,7 @@
*
* Description:
* cApi class
*
*
* @package Core
* @subpackage cApi
* @version $Rev$
@ -16,9 +16,13 @@
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*
*
* $Id$
*/
use ConLite\Log\LogWriter;
use ConLite\Log\Log;
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -57,10 +61,8 @@ class cApiModuleCollection extends ItemCollection {
$oMod = $this->_itemClassInstance;
$oMod->_bNoted = TRUE;
$oMod->loadByPrimaryKey($iIdMod);
if ($oMod->isLoaded()) {
if ($oMod->hasModuleFolder()) {
$oMod->deleteModuleFolder();
}
if ($oMod->isLoaded() && $oMod->hasModuleFolder()) {
$oMod->deleteModuleFolder();
}
unset($oMod);
return parent::delete($iIdMod);
@ -73,6 +75,12 @@ class cApiModuleCollection extends ItemCollection {
*/
class cApiModule extends Item {
public $_oldumask;
/**
* @var mixed
*/
public $_sModAliasOld;
public $_bNoted;
protected $_error;
/**
@ -83,10 +91,7 @@ class cApiModule extends Item {
protected $_bOutputFromFile = false;
protected $_bInputFromFile = false;
/**
* @var array
*/
private $aUsedTemplates = array();
private array $aUsedTemplates = [];
/**
* Configuration Array of ModFileEdit
@ -94,25 +99,12 @@ class cApiModule extends Item {
*
* @var array
*/
private $_aModFileEditConf = array(
'use' => false,
'modFolderName' => 'data/modules'
);
private $_aModFileEditConf = ['use' => false, 'modFolderName' => 'data/modules'];
/**
*
* @var string
*/
private $_sModAlias;
private ?string $_sModAlias = null;
/**
*
* @var string
*/
private $_sModPath;
private $_aModDefaultStruct = array(
'css', 'js', 'php', 'template', 'image', 'lang', 'xml'
);
private ?string $_sModPath = null;
private array $_aModDefaultStruct = ['css', 'js', 'php', 'template', 'image', 'lang', 'xml'];
/**
* Constructor Function
@ -128,13 +120,9 @@ class cApiModule extends Item {
// That's why you don't have to stripslashes values if you store them
// using ->set. You have to add slashes, if you store data directly
// (data not from a form field)
$this->setFilters(array(), array());
$this->setFilters([], []);
$this->_packageStructure = array(
"jsfiles" => $cfgClient["js"]["path"],
"tplfiles" => $cfgClient["tpl"]["path"],
"cssfiles" => $cfgClient["css"]["path"]
);
$this->_packageStructure = ["jsfiles" => $cfgClient["js"]["path"], "tplfiles" => $cfgClient["tpl"]["path"], "cssfiles" => $cfgClient["css"]["path"]];
if (isset($cfg['dceModEdit']) && is_array($cfg['dceModEdit'])) {
$this->_aModFileEditConf['clientPath'] = $cfgClient["path"]["frontend"];
@ -145,9 +133,9 @@ class cApiModule extends Item {
}
}
$oClient = new cApiClient(cRegistry::getClientId());
$aClientProp = $oClient->getPropertiesByType('modfileedit');
if (count($aClientProp) > 0) {
$cApiClient = new cApiClient(cRegistry::getClientId());
$aClientProp = $cApiClient->getPropertiesByType('modfileedit');
if ($aClientProp !== []) {
$this->_aModFileEditConf = array_merge($this->_aModFileEditConf, $aClientProp);
}
@ -158,15 +146,15 @@ class cApiModule extends Item {
public function createModuleFolder() {
//echo $this->_aModFileEditConf['modPath'];
$sPathErrorLog = cRegistry::getConfigValue('path', 'logs').'errorlog.txt';
$sPathErrorLog = cRegistry::getConfigValue('path', 'logs') . 'errorlog.txt';
if (is_writable($this->_aModFileEditConf['clientPath']) && !file_exists($this->_aModFileEditConf['modPath'])) {
try {
mkdir($this->_aModFileEditConf['modPath'], 0777, true);
} catch (Exception $ex) {
$oWriter = cLogWriter::factory("File", array('destination' => $sPathErrorLog));
$oLog = new cLog($oWriter);
$oLog->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), cLog::WARN);
$writer = LogWriter::factory("File", ['destination' => $sPathErrorLog]);
$log = new Log($writer);
$log->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), Log::WARN);
}
}
@ -176,9 +164,9 @@ class cApiModule extends Item {
try {
mkdir($this->getModulePath(), 0777);
} catch (Exception $ex) {
$oWriter = cLogWriter::factory("File", array('destination' => $sPathErrorLog));
$oLog = new cLog($oWriter);
$oLog->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), cLog::WARN);
$writer = LogWriter::factory("File", ['destination' => $sPathErrorLog]);
$log = new Log($writer);
$log->log($ex->getFile() . " (" . $ex->getLine() . "): " . $ex->getMessage(), Log::WARN);
}
if (is_writable($this->getModulePath())) {
@ -187,18 +175,16 @@ class cApiModule extends Item {
umask($this->_oldumask);
}
} else {
$oWriter = cLogWriter::factory("File", array('destination' => $sPathErrorLog));
$oLog = new cLog($oWriter);
$oLog->log(__FILE__ . " (" . __LINE__ . "): " . 'Error: Cannot create mod path '.$this->getModulePath(), cLog::WARN);
$writer = LogWriter::factory("File", ['destination' => $sPathErrorLog]);
$log = new Log($writer);
$log->log(__FILE__ . " (" . __LINE__ . "): " . 'Error: Cannot create mod path '.$this->getModulePath(), Log::WARN);
}
return FALSE;
}
public function deleteModuleFolder() {
if ($this->_aModFileEditConf['use'] == TRUE && is_writable($this->_aModFileEditConf['modPath'])) {
if (is_dir($this->getModulePath())) {
return $this->_recursiveRemoveDirectory($this->getModulePath());
}
if ($this->_aModFileEditConf['use'] == TRUE && is_writable($this->_aModFileEditConf['modPath']) && is_dir($this->getModulePath())) {
return $this->_recursiveRemoveDirectory($this->getModulePath());
}
return FALSE;
}
@ -262,7 +248,9 @@ class cApiModule extends Item {
*
* @return array Found strings for this module
*/
public function parseModuleForStrings() {
public function parseModuleForStrings(): bool|array
{
global $cfg;
if ($this->virgin == true) {
return false;
}
@ -272,12 +260,12 @@ class cApiModule extends Item {
$code .= $this->get("input");
// Initialize array
$strings = array();
$strings = [];
// Split the code into mi18n chunks
$varr = preg_split('/mi18n([\s]*)\(([\s]*)"/', $code, -1);
if (count($varr) > 1) {
if ((is_countable($varr) ? count($varr) : 0) > 1) {
foreach ($varr as $key => $value) {
// Search first closing
$closing = strpos($value, '")');
@ -297,7 +285,7 @@ class cApiModule extends Item {
preg_match_all('/mi18n([\s]*)\("(.*)"\)/', $varr[$key], $results);
// Append to strings array if there are any results
if (is_array($results[1]) && count($results[2]) > 0) {
if (is_array($results[1]) && (is_countable($results[2]) ? count($results[2]) : 0) > 0) {
$strings = array_merge($strings, $results[2]);
}
@ -309,7 +297,7 @@ class cApiModule extends Item {
// adding dynamically new module translations by content types
// this function was introduced with contenido 4.8.13
// checking if array is set to prevent crashing the module translation page
if (is_array($cfg['translatable_content_types']) && count($cfg['translatable_content_types']) > 0) {
if (is_array($cfg['translatable_content_types']) && $cfg['translatable_content_types'] !== []) {
// iterate over all defines cms content types
foreach ($cfg['translatable_content_types'] as $sContentType) {
// check if the content type exists and include his class file
@ -320,7 +308,7 @@ class cApiModule extends Item {
// add the additional translations for the module
if (class_exists($sContentType) && method_exists($sContentType, 'addModuleTranslations') && preg_match('/' . strtoupper($sContentType) . '\[\d+\]/', $code)) {
$strings = call_user_func(array($sContentType, 'addModuleTranslations'), $strings);
$strings = call_user_func([$sContentType, 'addModuleTranslations'], $strings);
}
}
}
@ -337,7 +325,7 @@ class cApiModule extends Item {
public function moduleInUse($module, $bSetData = false) {
global $cfg;
$db = new DB_ConLite();
$dbConLite = new DB_ConLite();
$sql = "SELECT
c.idmod, c.idtpl, t.name
@ -349,17 +337,17 @@ class cApiModule extends Item {
t.idtpl=c.idtpl
GROUP BY c.idtpl
ORDER BY t.name";
$db->query($sql);
$dbConLite->query($sql);
if ($db->nf() == 0) {
if ($dbConLite->nf() == 0) {
return false;
} else {
$i = 0;
// save the datas of used templates in array
if ($bSetData === true) {
while ($db->next_record()) {
$this->aUsedTemplates[$i]['tpl_name'] = $db->f('name');
$this->aUsedTemplates[$i]['tpl_id'] = (int) $db->f('idmod');
while ($dbConLite->next_record()) {
$this->aUsedTemplates[$i]['tpl_name'] = $dbConLite->f('name');
$this->aUsedTemplates[$i]['tpl_id'] = (int) $dbConLite->f('idmod');
$i++;
}
}
@ -379,21 +367,21 @@ class cApiModule extends Item {
/**
* Checks if the module is a pre-4.3 module
* @return boolean true if this module is an old one
*
*
* @deprecated since version 2.0
*/
public function isOldModule() {
// Keywords to scan
$scanKeywords = array('$cfgTab', 'idside', 'idsidelang');
$scanKeywords = ['$cfgTab', 'idside', 'idsidelang'];
$input = $this->get("input");
$output = $this->get("output");
foreach ($scanKeywords as $keyword) {
if (strstr($input, $keyword)) {
foreach ($scanKeywords as $scanKeyword) {
if (strstr($input, $scanKeyword)) {
return true;
}
if (strstr($output, $keyword)) {
if (strstr($output, $scanKeyword)) {
return true;
}
}
@ -402,11 +390,8 @@ class cApiModule extends Item {
public function getField($field) {
$value = parent::getField($field);
switch ($field) {
case "name":
if ($value == "") {
$value = i18n("- Unnamed Module -");
}
if ($field === "name" && $value == "") {
$value = i18n("- Unnamed Module -");
}
return ($value);
}
@ -414,7 +399,7 @@ class cApiModule extends Item {
public function store($bJustStore = false) {
global $cfg;
/* dceModFileEdit (c)2009-2011 www.dceonline.de */
if ($this->_aModFileEditConf['use'] == true && ($this->_aModFileEditConf['allModsFromFile'] == true || in_array($this->get('idmod'), $this->_aModFileEditConf['modsFromFile']))) {
if ($this->_aModFileEditConf['use'] == true && ($this->_aModFileEditConf['allModsFromFile'] == true || (is_array($this->_aModFileEditConf['modsFromFile']) && in_array($this->get('idmod'), $this->_aModFileEditConf['modsFromFile'])))) {
$this->modifiedValues['output'] = true;
$this->modifiedValues['input'] = true;
}
@ -429,11 +414,9 @@ class cApiModule extends Item {
conGenerateCodeForAllArtsUsingMod($this->get("idmod"));
if ($this->_shouldStoreToFile()) {
if ($this->_makeFileDirectoryStructure()) {
$sRootPath = $cfg['path']['contenido'] . $cfg['path']['modules'] . $this->get("idclient") . "/";
file_put_contents($sRootPath . $this->get("idmod") . ".xml", $this->export($this->get("idmod") . ".xml", true));
}
if ($this->_shouldStoreToFile() && $this->_makeFileDirectoryStructure()) {
$sRootPath = $cfg['path']['contenido'] . $cfg['path']['modules'] . $this->get("idclient") . "/";
file_put_contents($sRootPath . $this->get("idmod") . ".xml", $this->export($this->get("idmod") . ".xml", true));
}
}
}
@ -442,7 +425,7 @@ class cApiModule extends Item {
return $this->_aModFileEditConf;
}
protected function _recursiveRemoveDirectory($directory) {
protected function _recursiveRemoveDirectory($directory): bool {
foreach (glob("{$directory}/*") as $file) {
if (is_dir($file)) {
$this->_recursiveRemoveDirectory($file);
@ -481,6 +464,14 @@ class cApiModule extends Item {
}
}
/**
* @return mixed
*/
public function getError()
{
return $this->_error;
}
protected function _shouldLoadFromFiles() {
if (getSystemProperty("modules", "loadfromfiles") == "true") {
return true;
@ -499,26 +490,23 @@ class cApiModule extends Item {
private function _parseImportFile($sFile, $sType = "module", $sEncoding = "ISO-8859-1") {
global $_mImport;
$oParser = new clXmlParser($sEncoding);
$clXmlParser = new clXmlParser($sEncoding);
if ($sType == "module") {
$oParser->setEventHandlers(array("/module/name" => "cHandler_ModuleData",
"/module/description" => "cHandler_ModuleData",
"/module/type" => "cHandler_ModuleData",
"/module/input" => "cHandler_ModuleData",
"/module/output" => "cHandler_ModuleData"));
$clXmlParser->setEventHandlers(["/module/name" => "cHandler_ModuleData", "/module/description" => "cHandler_ModuleData", "/module/type" => "cHandler_ModuleData", "/module/input" => "cHandler_ModuleData", "/module/output" => "cHandler_ModuleData"]);
} else {
$aHandler = array("/modulepackage/guid" => "cHandler_ModuleData",
$aHandler = [
"/modulepackage/guid" => "cHandler_ModuleData",
#"/modulepackage/repository_guid" => "cHandler_ModuleData",
"/modulepackage/module/name" => "cHandler_ModuleData",
"/modulepackage/module/description" => "cHandler_ModuleData",
"/modulepackage/module/type" => "cHandler_ModuleData",
"/modulepackage/module/input" => "cHandler_ModuleData",
"/modulepackage/module/output" => "cHandler_ModuleData",
"/modulepackage/module/input" => "cHandler_ModuleData");
"/modulepackage/module/input" => "cHandler_ModuleData",
];
// Add file handler (e.g. js, css, templates)
foreach ($this->_packageStructure As $sFileType => $sFilePath) {
foreach (array_keys($this->_packageStructure) As $sFileType) {
// Note, that $aHandler["/modulepackage/" . $sFileType] and using
// a handler which uses the node name (here: FileType) doesn't work,
// as the event handler for the filetype node will be fired
@ -541,13 +529,13 @@ class cApiModule extends Item {
$aHandler["/modulepackage/translations/string/original"] = "cHandler_ItemName";
$aHandler["/modulepackage/translations/string/translation"] = "cHandler_Translation";
$oParser->setEventHandlers($aHandler);
$clXmlParser->setEventHandlers($aHandler);
}
if ($oParser->parseFile($sFile)) {
if ($clXmlParser->parseFile($sFile)) {
return true;
} else {
$this->_error = $oParser->error;
$this->_error = $clXmlParser->error;
return false;
}
}
@ -586,8 +574,8 @@ class cApiModule extends Item {
* @param $return boolean if false, the result is immediately sent to the browser
*/
public function export($filename, $return = false) {
$tree = new XmlTree('1.0', 'ISO-8859-1');
$root = & $tree->addRoot('module');
$xmlTree = new XmlTree('1.0', 'ISO-8859-1');
$root = & $xmlTree->addRoot('module');
$root->appendChild("name", clHtmlSpecialChars($this->get("name")));
$root->appendChild("description", clHtmlSpecialChars($this->get("description")));
@ -598,11 +586,11 @@ class cApiModule extends Item {
if ($return == false) {
ob_end_clean();
header("Content-Type: text/xml");
header("Etag: " . md5(mt_rand()));
header("Etag: " . md5(random_int(0, mt_getrandmax())));
header("Content-Disposition: attachment;filename=\"$filename\"");
$tree->dump(false);
$xmlTree->dump(false);
} else {
return stripslashes($tree->dump(true));
return stripslashes($xmlTree->dump(true));
}
}
@ -610,13 +598,13 @@ class cApiModule extends Item {
global $_mImport;
if ($this->_parseImportFile($sFile, "package")) {
$aData = array();
$aData = [];
$aData["guid"] = $_mImport["module"]["guid"];
$aData["repository_guid"] = $_mImport["module"]["repository_guid"];
$aData["name"] = $_mImport["module"]["name"];
// Files
foreach ($this->_packageStructure as $sFileType => $sFilePath) {
foreach (array_keys($this->_packageStructure) as $sFileType) {
if (is_array($_mImport["items"][$sFileType])) {
$aData[$sFileType] = array_keys($_mImport["items"][$sFileType]);
}
@ -641,8 +629,8 @@ class cApiModule extends Item {
/**
* Imports a module package from a XML file Uses xmlparser and callbacks
*
* @param string $sFile Filename of data file (including path)
* @param array $aOptions Optional. An array of arrays specifying, how the items
* @param string $sFile Filename of data file (including path)
* @param array $aOptions Optional. An array of arrays specifying, how the items
* of the xml file will be imported. If specified, has to
* contain an array of this structure:
*
@ -657,26 +645,27 @@ class cApiModule extends Item {
*
* @return bool Returns true, if import has been successfully finished
*/
public function importPackage($sFile, $aOptions = array()) {
public function importPackage($sFile, $aOptions = []) {
$bStore = null;
global $_mImport, $client;
cInclude("includes", "functions.file.php");
cInclude("includes", "functions.lay.php"); // You won't believe the code in there (or what is missing in class.layout.php...)
// Ensure correct options structure
foreach ($this->_packageStructure as $sFileType => $sFilePath) {
foreach (array_keys($this->_packageStructure) as $sFileType) {
if (!is_array($aOptions["items"][$sFileType])) {
$aOptions["items"][$sFileType] = array();
$aOptions["items"][$sFileType] = [];
}
}
// Layouts
if (!is_array($aOptions["items"]["layouts"])) {
$aOptions["items"]["layouts"] = array();
$aOptions["items"]["layouts"] = [];
}
// Translations
if (!is_array($aOptions["translations"])) {
$aOptions["translations"] = array();
$aOptions["translations"] = [];
}
// Parse file
@ -703,7 +692,7 @@ class cApiModule extends Item {
createFile($sFileName, $sFilePath);
}
fileEdit($sFileName, $aContent["content"], $sFilePath);
} else if ($aOptions["items"][$sFileType][clHtmlSpecialChars($sFileName)] == "append") {
} elseif ($aOptions["items"][$sFileType][clHtmlSpecialChars($sFileName)] == "append") {
$sOriginalContent = getFileContent($sFileName, $sFilePath);
fileEdit($sFileName, $sOriginalContent . $aContent["content"], $sFilePath);
}
@ -742,13 +731,13 @@ class cApiModule extends Item {
// Translations
if (is_array($_mImport["translations"])) {
$oTranslations = new cApiModuleTranslationCollection();
$cApiModuleTranslationCollection = new cApiModuleTranslationCollection();
$iID = $this->get($this->primaryKey);
foreach ($_mImport["translations"] as $sPackageLang => $aTranslations) {
foreach (array_keys($_mImport["translations"]) as $sPackageLang) {
if (array_key_exists($sPackageLang, $aOptions["translations"])) {
foreach ($_mImport["translations"][$sPackageLang] as $sOriginal => $sTranslation) {
$oTranslations->create($iID, $aOptions["translations"][$sPackageLang], $sOriginal, $sTranslation);
$cApiModuleTranslationCollection->create($iID, $aOptions["translations"][$sPackageLang], $sOriginal, $sTranslation);
}
}
}
@ -762,33 +751,33 @@ class cApiModule extends Item {
/**
* Exports the specified module and attached files to a file
*
* @param string $sPackageFileName Filename to return
* @param bool $bReturn if false, the result is immediately sent to the browser
* @param string $sPackageFileName Filename to return
* @param bool $bReturn if false, the result is immediately sent to the browser
*/
public function exportPackage($sPackageFileName, $bReturn = false) {
global $cfgClient, $client;
cInclude("includes", "functions.file.php");
$oTree = new XmlTree('1.0', 'ISO-8859-1');
$oRoot = & $oTree->addRoot('modulepackage');
$xmlTree = new XmlTree('1.0', 'ISO-8859-1');
$oRoot = & $xmlTree->addRoot('modulepackage');
$oRoot->appendChild("package_guid", $this->get("package_guid"));
$oRoot->appendChild("package_data", $this->get("package_data")); // This is serialized and more or less informal data
$aData = unserialize($this->get("package_data"));
if (!is_array($aData)) {
$aData = array();
$aData = [];
$aData["repository_guid"] = "";
$aData["jsfiles"] = array();
$aData["tplfiles"] = array();
$aData["cssfiles"] = array();
$aData["layouts"] = array();
$aData["translations"] = array();
$aData["jsfiles"] = [];
$aData["tplfiles"] = [];
$aData["cssfiles"] = [];
$aData["layouts"] = [];
$aData["translations"] = [];
}
// Export basic module
$oNodeModule = & $oRoot->appendChild("module");
$oNodeModule = &$oRoot->appendChild("module");
$oNodeModule->appendChild("name", clHtmlSpecialChars($this->get("name")));
$oNodeModule->appendChild("description", clHtmlSpecialChars($this->get("description")));
$oNodeModule->appendChild("type", clHtmlSpecialChars($this->get("type")));
@ -798,27 +787,25 @@ class cApiModule extends Item {
// Export files (e.g. js, css, templates)
foreach ($this->_packageStructure As $sFileType => $sFilePath) {
$oNodeFiles = & $oRoot->appendChild($sFileType);
if (count($aData[$sFileType]) > 0) {
foreach ($aData[$sFileType] as $sFileName) {
if (is_readable($sFilePath . $sFileName)) {
$sContent = getFileContent($sFileName, $sFilePath);
$oNodeFiles->appendChild("area", clHtmlSpecialChars($sFileType));
$oNodeFiles->appendChild("name", clHtmlSpecialChars($sFileName));
$oNodeFiles->appendChild("content", clHtmlSpecialChars($sContent));
}
foreach ($aData[$sFileType] as $sFileName) {
if (is_readable($sFilePath . $sFileName)) {
$sContent = getFileContent($sFileName, $sFilePath);
$oNodeFiles->appendChild("area", clHtmlSpecialChars($sFileType));
$oNodeFiles->appendChild("name", clHtmlSpecialChars($sFileName));
$oNodeFiles->appendChild("content", clHtmlSpecialChars($sContent));
}
}
}
unset($sContent);
// Export layouts
$oNodeLayouts = & $oRoot->appendChild("layouts");
$oNodeLayouts = &$oRoot->appendChild("layouts");
$oLayouts = new cApiLayoutCollection;
$oLayouts->setWhere("idclient", $client);
$oLayouts->query();
$cApiLayoutCollection = new cApiLayoutCollection;
$cApiLayoutCollection->setWhere("idclient", $client);
$cApiLayoutCollection->query();
while ($oLayout = $oLayouts->next()) {
while ($oLayout = $cApiLayoutCollection->next()) {
if (in_array($oLayout->get($oLayout->primaryKey), $aData["layouts"])) {
$oNodeLayouts->appendChild("area", "layouts");
$oNodeLayouts->appendChild("name", clHtmlSpecialChars($oLayout->get("name")));
@ -827,24 +814,23 @@ class cApiModule extends Item {
}
}
unset($oLayout);
unset($oLayouts);
unset($cApiLayoutCollection);
// Export translations
$oLangs = new cApiLanguageCollection();
$oLangs->setOrder("idlang");
$oLangs->query();
$cApiLanguageCollection = new cApiLanguageCollection();
$cApiLanguageCollection->setOrder("idlang");
$cApiLanguageCollection->query();
if ($oLangs->count() > 0) {
if ($cApiLanguageCollection->count() > 0) {
$iIDMod = $this->get($this->primaryKey);
while ($oLang = $oLangs->next()) {
while ($oLang = $cApiLanguageCollection->next()) {
$iID = $oLang->get($oLang->primaryKey);
if (in_array($iID, $aData["translations"])) {
$oNodeTrans = & $oRoot->appendChild("translations");
$oNodeTrans = &$oRoot->appendChild("translations");
// This is nice, but it doesn't help so much,
// as this data is available too late on import ...
$oNodeTrans->setNodeAttribs(array("origin-language-id" => $iID,
"origin-language-name" => clHtmlSpecialChars($oLang->get("name"))));
$oNodeTrans->setNodeAttribs(["origin-language-id" => $iID, "origin-language-name" => clHtmlSpecialChars($oLang->get("name"))]);
// ... so we store the important information with the data
$oNodeTrans->appendChild("language", clHtmlSpecialChars($oLang->get("name")));
@ -854,24 +840,24 @@ class cApiModule extends Item {
$oTranslations->query();
while ($oTranslation = $oTranslations->next()) {
$oNodeString = & $oNodeTrans->appendChild("string");
$oNodeString = &$oNodeTrans->appendChild("string");
$oNodeString->appendChild("original", clHtmlSpecialChars($oTranslation->get("original")));
$oNodeString->appendChild("translation", clHtmlSpecialChars($oTranslation->get("translation")));
}
}
}
}
unset($oLangs);
unset($cApiLanguageCollection);
unset($oLang);
if ($bReturn == false) {
ob_end_clean();
header("Content-Type: text/xml");
header("Etag: " . md5(mt_rand()));
header("Etag: " . md5(random_int(0, mt_getrandmax())));
header("Content-Disposition: attachment;filename=\"$sPackageFileName\"");
$oTree->dump(false);
$xmlTree->dump(false);
} else {
return stripslashes($oTree->dump(true));
return stripslashes($xmlTree->dump(true));
}
}
@ -879,7 +865,7 @@ class cApiModule extends Item {
/**
* Overridden parent method for hooking dceModFileEdit
*
*
* @return void
*/
protected function _onLoad() {
@ -891,7 +877,7 @@ class cApiModule extends Item {
/**
* Use a PHP-file, if present, for module output
*
*
* @return boolean
*/
private function _setOutputFromPhpFile() {
@ -904,7 +890,7 @@ class cApiModule extends Item {
/**
* Use a PHP-file, if present, for module input
*
*
* @return boolean
*/
private function _setInputFromPhpFile() {
@ -917,7 +903,7 @@ class cApiModule extends Item {
}
private function _displayNoteFromFile($bIsOldPath = FALSE) {
if (isset($this->_bNoted) && $this->_bNoted === true) {
if (property_exists($this, '_bNoted') && $this->_bNoted !== null && $this->_bNoted === true) {
return;
}
global $frame, $area;
@ -926,23 +912,22 @@ class cApiModule extends Item {
if ($bIsOldPath) {
$sAddMess .= "<br>" . i18n("Using old CamelCase for name of modulefolder. You may lowercase the name for modulefolder");
}
$oNote = new Contenido_Notification();
$oNote->displayNotification('warning', i18n("Module uses Output- and/or InputFromFile. Editing and Saving may not be possible in backend.") . $sAddMess);
$contenidoNotification = new Contenido_Notification();
$contenidoNotification->displayNotification('warning', i18n("Module uses Output- and/or InputFromFile. Editing and Saving may not be possible in backend.") . $sAddMess);
$this->_bNoted = true;
}
}
/**
* read file and set an object field
*
* @param string $sFile
*
* @param string $sFile
* @param string $sField
* @return boolean
*/
private function _setFieldFromFile($sField, $sFile) {
private function _setFieldFromFile($sField, $sFile): bool {
$bIsOldPath = TRUE;
$sFile = strtolower($sFile);
if (FALSE === strstr($sFile, $this->_aModFileEditConf['modPath'])) {
if (!str_contains($sFile, $this->_aModFileEditConf['modPath'])) {
$sFile = $this->_aModFileEditConf['modPath'] . $sFile;
}
// check for new struct since CL 2.0
@ -987,17 +972,12 @@ class cApiModule extends Item {
}
public function isLoadedFromFile($sWhat = "all") {
switch ($sWhat) {
case "all":
return (($this->_bOutputFromFile || $this->_bInputFromFile) ? TRUE : FALSE);
break;
case "output":
return $this->_bOutputFromFile;
case "input":
return $this->_bInputFromFile;
default:
return false;
}
return match ($sWhat) {
"all" => $this->_bOutputFromFile || $this->_bInputFromFile,
"output" => $this->_bOutputFromFile,
"input" => $this->_bInputFromFile,
default => false,
};
}
/* End dceModFileEdit (c)2009-2012 www.dceonline.de */
@ -1017,10 +997,7 @@ class cApiModule extends Item {
private function _createModulePhpFiles() {
$sPath = $this->_sModPath . "php/";
$aFileTpl = array(
'output' => "<?php\n\n?>",
'input' => "?><?php\n\n?><?php"
);
$aFileTpl = ['output' => "<?php\n\n?>", 'input' => "?><?php\n\n?><?php"];
if (is_writable($sPath)) {
$sOutputFile = $sPath . $this->_sModAlias . "_output.php";
@ -1057,7 +1034,7 @@ class cApiModule extends Item {
class cApiModuleTranslationCollection extends ItemCollection {
protected $_error;
protected $f_obj;
/**
@ -1076,8 +1053,8 @@ class cApiModuleTranslationCollection extends ItemCollection {
public function create($idmod, $idlang, $original, $translation = false) {
// Check if the original already exists. If it does,
// update the translation if passed
$mod = new cApiModuleTranslation();
$sorg = $mod->_inFilter($original);
$cApiModuleTranslation = new cApiModuleTranslation();
$sorg = $cApiModuleTranslation->_inFilter($original);
$this->select("idmod = '$idmod' AND idlang = '$idlang' AND original = '$sorg'");
@ -1133,21 +1110,20 @@ class cApiModuleTranslationCollection extends ItemCollection {
public function import($idmod, $idlang, $file) {
global $_mImport;
$parser = new clXmlParser("ISO-8859-1");
$clXmlParser = new clXmlParser("ISO-8859-1");
$parser->setEventHandlers(array("/module/translation/string/original" => "cHandler_ItemName",
"/module/translation/string/translation" => "cHandler_Translation"));
$clXmlParser->setEventHandlers(["/module/translation/string/original" => "cHandler_ItemName", "/module/translation/string/translation" => "cHandler_Translation"]);
$_mImport["current_item_area"] = "current"; // Pre-specification, as this won't be set from the XML file (here)
if ($parser->parseFile($file)) {
if ($clXmlParser->parseFile($file)) {
foreach ($_mImport["translations"]["current"] as $sOriginal => $sTranslation) {
$this->create($idmod, $idlang, $sOriginal, $sTranslation);
}
return true;
} else {
$this->_error = $parser->error;
$this->_error = $clXmlParser->error;
return false;
}
}
@ -1161,21 +1137,20 @@ class cApiModuleTranslationCollection extends ItemCollection {
* @param $return boolean if false, the result is immediately sent to the browser
*/
public function export($idmod, $idlang, $filename, $return = false) {
$langobj = new cApiLanguage($idlang);
$cApiLanguage = new cApiLanguage($idlang);
#$langstring = $langobj->get("name") . ' ('.$idlang.')';
$translations = new cApiModuleTranslationCollection;
$translations->select("idmod = '$idmod' AND idlang='$idlang'");
$cApiModuleTranslationCollection = new cApiModuleTranslationCollection;
$cApiModuleTranslationCollection->select("idmod = '$idmod' AND idlang='$idlang'");
$tree = new XmlTree('1.0', 'ISO-8859-1');
$root = & $tree->addRoot('module');
$xmlTree = new XmlTree('1.0', 'ISO-8859-1');
$root = &$xmlTree->addRoot('module');
$translation = & $root->appendChild('translation');
$translation->setNodeAttribs(array("origin-language-id" => $idlang,
"origin-language-name" => $langobj->get("name")));
$translation = &$root->appendChild('translation');
$translation->setNodeAttribs(["origin-language-id" => $idlang, "origin-language-name" => $cApiLanguage->get("name")]);
while ($otranslation = $translations->next()) {
while ($otranslation = $cApiModuleTranslationCollection->next()) {
$string = &$translation->appendChild("string");
$string->appendChild("original", clHtmlSpecialChars($otranslation->get("original")));
@ -1184,11 +1159,11 @@ class cApiModuleTranslationCollection extends ItemCollection {
if ($return == false) {
header("Content-Type: text/xml");
header("Etag: " . md5(mt_rand()));
header("Etag: " . md5(random_int(0, mt_getrandmax())));
header("Content-Disposition: attachment;filename=\"$filename\"");
$tree->dump(false);
$xmlTree->dump(false);
} else {
return $tree->dump(true);
return $xmlTree->dump(true);
}
}

Datei anzeigen

@ -1,46 +0,0 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* @package Contenido Backend classes
* @version 1.3
* @author Timo Hummel
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* $Id$
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class gdbDriver {
var $_sEncoding;
var $_oItemClassInstance;
public function __construct() {
}
public function setEncoding($sEncoding) {
$this->_sEncoding = $sEncoding;
}
public function setItemClassInstance($oInstance) {
$this->_oItemClassInstance = $oInstance;
}
public function buildJoinQuery($destinationTable, $destinationClass, $destinationPrimaryKey, $sourceClass, $primaryKey) {
}
public function buildOperator($sField, $sOperator, $sRestriction) {
}
}
?>

Datei anzeigen

@ -1,8 +0,0 @@
This directory contains driver classes for use with Contenido's GenericDB. These
drivers are responsible for building joins and handling database metadata, but
NOT for sending queries and returning results.
Dieses Verzeichnis enthält Treiberklassen für die Verwendung mit der Contenido
GenericDB. Diese Treiber sind ausschließlich dafür da, um Joins aufzubauen und
um die Metadaten zu verwalten. Sie sind NICHT für das Senden von Queries oder
das zurückgeben von Query-Ergebnissen zuständig.

Datei anzeigen

@ -1,40 +0,0 @@
<?php
/**
* File:
* class.frontend.navigation.abstract.php
*
* Description:
* Abstract Class for Frontend Navigations
*
* @package Core
* @subpackage Frontend
* @version $Rev$
* @since 2.0
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2016, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*
* $Id$
*/
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
class cFrontendNavigationAbstract {
/**
*
* @var DB_ConLite
*/
protected $_oDB;
public function __construct() {
;
}
protected function _getDB() {
}
}

Datei anzeigen

@ -1,27 +0,0 @@
<?php
/**
* File:
* class.frontend.navigation.php
*
* Description:
* Helper Class for Frontend Navigations
*
* @package Core
* @subpackage Frontend
* @version $Rev$
* @since 2.0
* @author Ortwin Pinke <o.pinke@conlite.org>
* @copyright (c) 2016, conlite.org
* @license http://www.gnu.de/documents/gpl.en.html GPL v3 (english version)
* @license http://www.gnu.de/documents/gpl.de.html GPL v3 (deutsche Version)
* @link http://www.conlite.org ConLite.org
*
* $Id$
*/
// security check
defined('CON_FRAMEWORK') or die('Illegal call');
class cFrontendNavigation extends cFrontendNavigationAbstract {
//put your code here
}

Datei anzeigen

@ -1,393 +0,0 @@
<?php
/**
* This file contains the log class.
*
* @package Core
* @subpackage Log
* @version SVN Revision $Rev$
*
* @author Dominik Ziegler
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*/
defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
/**
* This class contains the main functionalities for the logging in CONTENIDO.
*
* Examples:
*
* $writer = cLogWriter::factory("File", array('destination' => 'contenido.log'));
* $log = new cLog($writer);
*
* $log->addPriority("CONTENIDO", 10);
* $log->log("Contenido Log Message.", "CONTENIDO");
* $log->contenido("Same log entry in short notation.");
* $log->removePriority("CONTENIDO");
*
* $log->emerg("System down.");
*
* $log->log('Notice Log Message', cLog::NOTICE);
*
* $log->buffer('Buffered Log Message', cLog::WARN);
* $log->commit();
*
* @package Core
* @subpackage Log
*/
class cLog {
/**
* @var int logging level
*/
const EMERG = 0;
/**
* @var int logging level
*/
const ALERT = 1;
/**
* @var int logging level
*/
const CRIT = 2;
/**
* @var int logging level
*/
const ERR = 3;
/**
* @var int logging level
*/
const WARN = 4;
/**
* @var int logging level
*/
const NOTICE = 5;
/**
* @var int logging level
*/
const INFO = 6;
/**
* @var int logging level
*/
const DEBUG = 7;
/**
* @var cLogWriter Contains the local log writer instance.
*/
protected $_writer;
/**
* @var array Contains all shortcut handlers
*/
protected $_shortcutHandlers = array();
/**
* @var array Contains all available priorities
*/
protected $_priorities = array();
/**
* @var array Contains all default priorities
*/
protected $_defaultPriorities = array();
/**
* @var array Contains all buffered messages
*/
protected $_buffer = array();
/**
* Creates a new instance of the CONTENIDO Log mechanism.
*
* The log format interface of cLog is capable of being extended by subclasses. See the note about
* the log shortcuts below.
*
*
* About Log Shortcuts
* -------------------
* Log shortcuts are placeholders which are replaced when a log entry is created. Placeholders start with a
* percentage sign (%) and contain one or more characters. Each placeholder is handled by an own function which
* decides what to do.
*
* @param mixed $writer Writer object (any subclass of cLogWriter), or false if cLog should handle the writer creation
*/
public function __construct($writer = false) {
$cfg = cRegistry::getConfig();
$createWriter = false;
if ($writer == false) {
$createWriter = true;
} else if (!is_object($writer) || ($writer instanceof cLogWriter) == false) {
cWarning(__FILE__, __LINE__, "The passed class is not a subclass of cLogWriter. Creating new one.");
$createWriter = true;
}
if ($createWriter == true) {
$options = array(
'destination' => cRegistry::getConfigValue('path', 'contenido')
.cRegistry::getConfigValue('path', 'logs')
.'contenido.log');
$writer = cLogWriter::factory("File", $options);
}
$this->setWriter($writer);
$this->setShortcutHandler("%date", array($this, "shDate"));
$this->setShortcutHandler("%level", array($this, "shLevel"));
$this->setShortcutHandler("%message", array($this, "shMessage"));
$this->getWriter()->setOption('log_format', '[%date] [%level] %message', false);
$reflection = new ReflectionClass($this);
$this->_priorities = $this->_defaultPriorities = array_flip($reflection->getConstants());
}
/**
* Returns the local writer instance.
* @return cLogWriter
*/
public function getWriter() {
return $this->_writer;
}
/**
* Sets the local writer instance.
*
* @param cLogWriter $writer Writer instacne
*/
public function setWriter(cLogWriter $writer) {
$this->_writer = $writer;
}
/**
* Defines a custom shortcut handler.
*
* Each shortcut handler receives an array with the
* message and the priority of the entry.
*
* @param string $shortcut Shortcut name
* @param string $handler Name of the function to call
* @throws cInvalidArgumentException if the given shortcut is empty or
* already in use or if the handler is not callable
* @return bool True if setting was successful
*/
public function setShortcutHandler($shortcut, $handler) {
if ($shortcut == '') {
throw new Exception('The shortcut name must not be empty.');
}
if (substr($shortcut, 0, 1) == "%") {
$shortcut = substr($shortcut, 1);
}
if (is_callable($handler) == false) {
throw new Exception('The specified shortcut handler does not exist.');
}
if (array_key_exists($shortcut, $this->_shortcutHandlers)) {
throw new Exception('The shortcut ' . $shortcut . ' is already in use!');
}
$this->_shortcutHandlers[$shortcut] = $handler;
return true;
}
/**
* Unsets a specific shortcut handler.
*
* @param string $shortcut Name of the shortcut
* @throws cInvalidArgumentException if the given shortcut handler does not
* exist
* @return boolean
*/
public function unsetShortcutHandler($shortcut) {
if (!in_array($shortcut, $this->_shortcutHandlers)) {
throw new Exception('The specified shortcut handler does not exist.');
}
unset($this->_shortcutHandlers[$shortcut]);
return true;
}
/**
* Buffers a log message for committing them on a later moment.
*
* @param string $message Message to buffer
* @param mixed $priority Priority of the log entry (optional)
*/
public function buffer($message, $priority = NULL) {
$this->_buffer[] = array($message, $priority);
}
/**
* Commits all buffered messages and empties the message buffer if parameter is not false.
*
* @param boolean $revoke Flag, whether the buffer is cleared or not (optional, default: true)
*/
public function commit($revoke = true) {
if (count($this->_buffer) == 0) {
cWarning(__FILE__, __LINE__, "There are no buffered messages to commit.");
return false;
}
foreach ($this->_buffer as $bufferInfo) {
$this->log($bufferInfo[0], $bufferInfo[1]);
}
if ($revoke == true) {
$this->revoke();
}
}
/**
* Empties the message buffer.
*/
public function revoke() {
$this->_buffer = array();
}
/**
* Logs a message using the local writer instance
*
* @param string $message Message to log
* @param mixed $priority Priority of the log entry (optional)
*/
public function log($message, $priority = NULL) {
if ($priority && is_int($priority) == false && in_array($priority, $this->_priorities)) {
$priority = array_search($priority, $this->_priorities);
}
if ($priority === NULL || array_key_exists($priority, $this->_priorities) == false) {
$priority = $this->getWriter()->getOption('default_priority');
}
$logMessage = $this->getWriter()->getOption('log_format');
$lineEnding = $this->getWriter()->getOption('line_ending');
foreach ($this->_shortcutHandlers as $shortcut => $handler) {
if (substr($shortcut, 0, 1) != "%") {
$shortcut = "%" . $shortcut;
}
$info = array(
'message' => $message,
'priority' => $priority
);
$value = call_user_func($handler, $info);
$logMessage = str_replace($shortcut, $value, $logMessage);
}
$this->getWriter()->write($logMessage . $lineEnding, $priority);
}
/**
* Adds a new priority to the log.
*
* @param string $name Name of the log priority
* @param int $value Index value of the log priority
* @throws cInvalidArgumentException if the given name is empty, already
* exists or the value already exists
*/
public function addPriority($name, $value) {
if ($name == '') {
throw new Exception('Priority name must not be empty.');
}
if (in_array($name, $this->_priorities)) {
throw new Exception('The given priority name already exists.');
}
if (array_key_exists($value, $this->_priorities)) {
throw new Exception('The priority value already exists.');
}
$this->_priorities[$value] = $name;
}
/**
* Removes a priority from log.
* Default properties can not be removed.
*
* @param string $name Name of the log priority to remove
* @throws cInvalidArgumentException if the given name is empty, does not
* exist or is a default priority
*/
public function removePriority($name) {
if ($name == '') {
throw new Exception('Priority name must not be empty.');
}
if (in_array($name, $this->_priorities) == false) {
throw new Exception('Priority name does not exist.');
}
if (in_array($name, $this->_defaultPriorities) == true) {
throw new Exception('Removing default priorities is not allowed.');
}
$priorityIndex = array_search($name, $this->_priorities);
unset($this->_priorities[$priorityIndex]);
}
/**
* Magic call method for direct priority named calls.
*
* @param string $method Name of the method
* @param array $arguments Array with the method arguments
* @throws cInvalidArgumentException if the given priority is not supported
*/
public function __call($method, $arguments) {
$priorityName = strtoupper($method);
if (in_array($priorityName, $this->_priorities) == false) {
throw new Exception('The given priority ' . $priorityName . ' is not supported.');
}
$priorityIndex = array_search($priorityName, $this->_priorities);
return $this->log($arguments[0], $priorityIndex);
}
/**
* Shortcut Handler Date.
* Returns the current date
* @return string The current date
*/
public function shDate() {
return date("Y-m-d H:i:s");
}
/**
* Shortcut Handler Level.
* Returns the canonical name of the priority.
* The canonical name is padded to 10 characters to achieve a better formatting.
* @return string The canonical log level
*/
public function shLevel($info) {
$logLevel = $info['priority'];
return str_pad($this->_priorities[$logLevel], 10, " ", STR_PAD_BOTH);
}
/**
* Shortcut Handler Message.
* Returns the log message.
* @return string The log message
*/
public function shMessage($info) {
return $info['message'];
}
}
?>

Datei anzeigen

@ -1,67 +0,0 @@
<?php
/**
* This file contains the log file writer class.
*
* @package Core
* @subpackage Log
* @version SVN Revision $Rev$
*
* @author Dominik Ziegler
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*/
defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
/**
* This class contains the file writer class for the logging mechanism.
*
* @package Core
* @subpackage Log
*/
class cLogWriterFile extends cLogWriter {
/**
* @var resource Destination handle
*/
protected $_handle = NULL;
/**
* Constructor of the writer instance.
* @param array $options Array with options for the writer instance (optional)
*/
public function __construct($options = array()) {
parent::__construct($options);
$this->_createHandle();
}
/**
* Checks destination and creates the handle for the write process.
*
* @throws cException if not destination is specified
* @throws cFileNotFoundException if the destination file could not be read
*/
protected function _createHandle() {
$destination = $this->getOption('destination');
if ($destination == '') {
throw new Exception('No destination was specified.');
}
if (($this->_handle = fopen($destination, 'a')) === false) {
throw new Exception('Destination handle could not be created.');
}
}
/**
* Writes the content to file handle.
*
* @param string $message Message to write
* @param int $priority Priority of the log entry
* @return boolean State of the write process
*/
public function write($message, $priority) {
return (fwrite($this->_handle, $message) != false);
}
}

Datei anzeigen

@ -1,127 +0,0 @@
<?php
/**
* This file contains the abstract log writer class.
*
* @package Core
* @subpackage Log
* @version SVN Revision $Rev$
*
* @author Dominik Ziegler
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*/
defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
/**
* This class contains the main functionalities for the logging writer in CONTENIDO.
*
* @package Core
* @subpackage Log
*/
abstract class cLogWriter {
/**
* @var array Contains all options of the current writer instance.
*/
protected $_options = array();
/**
* Constructor of the writer instance.
* @param array $options Array with options for the writer instance (optional)
*/
public function __construct($options = array()) {
$this->setOptions($options);
// Set all default options if they were not set already
$this->setOption('default_priority', cLog::INFO, false);
$this->setOption('line_ending', PHP_EOL, false);
}
/**
* Factory method for a new writer instance.
*
* @param string $writerName Name of the writer
* @param array $writerOptions Options array for the writer instance
* @throws cInvalidArgumentException if the writer class with the given name
* does not exist or is not an instance of clogWriter
* @return cLogWriter Log writer instance
*/
public static function factory($writerName, array $writerOptions) {
$logWriterClassName = 'cLogWriter' . ucfirst($writerName);
if (!class_exists($logWriterClassName)) {
throw new Exception('Unknown writer class: ' . $writerName);
}
$writer = new $logWriterClassName($writerOptions);
if (($writer instanceof cLogWriter) == false) {
throw new Exception('Provided class is not an instance of cLogWriter');
}
return $writer;
}
/**
* Sets the whole options array.
*
* @param array $options Array with options
*/
public function setOptions(array $options) {
$this->_options = $options;
}
/**
* Returns an array with all options.
* @return array Array with all options
*/
public function getOptions() {
return $this->_options;
}
/**
* Sets a option. If option was set previously, it must be forced to overwrite the value.
*
* @param string $option Name of the option
* @param mixed $value Value of the option
* @param boolean $force Flag to force setting the option value (optional, default: false)
*/
public function setOption($option, $value, $force = false) {
if ($force == false && isset($this->_options[$option]) == true) {
return;
}
$this->_options[$option] = $value;
}
/**
* Returns the value of an option entry.
*
* @param string $option Name of the option
*
* @return mixed Value of the option entry
*/
public function getOption($option) {
return $this->_options[$option];
}
/**
* Removes an option entry.
*
* @param string $option Name of the option
*/
public function removeOption($option) {
unset($this->_options[$option]);
}
/**
* Abstract function for the write process.
* This method must be implemented in the specific writer.
*
* @param string $message Message to write
* @param int $priority Priority of the log entry
*
* @return boolean State of the write process
*/
abstract function write($message, $priority);
}

Datei anzeigen

@ -1,90 +0,0 @@
<?php
/**
* This file contains the module log class.
*
* @package Core
* @subpackage Log
* @version SVN Revision $Rev$
*
* @author Dominik Ziegler
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*/
defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
/**
* This class contains the main functionalities for the module logging in
* CONTENIDO.
* The funcationality is almost the same like normal logging with the exception,
* that log entries contains an additional information about the used module.
*
* Example:
* $writer = cLogWriter::factory("File", array('destination' =>
* 'contenido.log'));
*
* $log = new cModuleLog($writer);
* $log->setModule(1);
* $log->log("Anything you want to log.");
*
* @package Core
* @subpackage Log
*/
class cModuleLog extends cLog {
/**
* @var cApiModule instance of module model
*/
private $_module;
/**
* Constructor of the module log.
*
* @param mixed $writer Writer object (any subclass of cLogWriter), or false
* if cLog should handle the writer creation
*
*/
public function __construct($writer = false) {
parent::__construct($writer);
$this->setShortcutHandler('module', array(
$this,
'shModule'
));
$this->getWriter()->setOption("log_format", "[%date] [%level] [%module] %message", true);
}
/**
* Sets the module to use.
*
* setModule automatically buffers basic module information to the log to
* assist the developer in debugging his modules.
*
* @param int $idmod The module ID to use
* @throws cException if the module with the given idmod could not be loaded
*/
public function setModule($idmod) {
$this->_module = new cApiModule($idmod);
if ($this->_module->isLoaded() == false) {
throw new Exception('Could not load module information.');
}
}
/**
* Shortcut Handler Module.
* Returns the ID and the name of the module.
*
* @return string ID and name of the module
*/
public function shModule() {
if ($this->_module->isLoaded() == false) {
return '';
}
return $this->_module->get("idmod") . ": " . $this->_module->get("name");
}
}
?>

Datei anzeigen

@ -184,7 +184,6 @@ class Template {
global $cCurrentModule;
$cfg = cRegistry::getConfig();
$aCfgClient = cRegistry::getClientConfig(cRegistry::getClientId());
$bModTplUsed = FALSE;
if (isset($cCurrentModule) && $cfg['dceModEdit']['use']) {
@ -201,15 +200,19 @@ class Template {
}
}
if (is_file("templates/" . $template) && !$bModTplUsed) {
$template = "templates/" . $template;
if (is_file(cRegistry::getFrontendPath() . "templates/" . $template) && !$bModTplUsed) {
$template = cRegistry::getFrontendPath() . "templates/" . $template;
}
//check if the template is a file or a string
if (!is_file($template)) {
$content = & $template; //template is a string (it is a reference to save memory!!!)
} else {
$content = implode("", file($template)); //template is a file
if(cFileHandler::readable($template)) {
$content = implode("", file($template)); //template is a file
} else {
return $template;
}
}
$content = (($note) ? "<!-- Generated by ConLite " . $cfg['version'] . "-->\n" : "") . $content;

Datei anzeigen

@ -320,8 +320,12 @@ class cPage extends cHTML {
}
$meta = '';
if ($this->_encoding != "" && !$this->_isHtml5) {
$meta .= '<meta http-equiv="Content-type" content="text/html;charset=' . $this->_encoding . '">' . "\n";
if(!empty($this->_encoding)) {
if($this->_isHtml5) {
$meta .= '<meta charset="' . $this->_encoding . '">' . "\n";
} else {
$meta .= '<meta http-equiv="Content-type" content="text/html;charset=' . $this->_encoding . '">' . "\n";
}
}
if ($this->_object !== false && method_exists($this->_object, "render")) {

Datei anzeigen

@ -25,27 +25,26 @@ if (!defined("CON_FRAMEWORK")) {
// Contenido startup process
include_once ('../includes/startup.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.user.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.xml.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.navigation.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'template/class.template.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.backend.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.table.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.notification.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.area.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.layout.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.client.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.cat.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.treeitem.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_language_de.inc.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'functions.con.php');
$classPath = cRegistry::getConfigValue('path', 'conlite') . cRegistry::getConfigValue('path', 'classes');
$includesPath = cRegistry::getConfigValue('path', 'conlite') . cRegistry::getConfigValue('path', 'includes');
include_once ($classPath . 'class.user.php');
include_once ($classPath . 'class.xml.php');
include_once ($classPath . 'class.navigation.php');
include_once ($classPath . 'template/class.template.php');
include_once ($classPath . 'class.backend.php');
include_once ($classPath . 'class.table.php');
include_once ($classPath . 'class.notification.php');
include_once ($classPath . 'class.area.php');
include_once ($classPath . 'class.layout.php');
include_once ($classPath . 'class.client.php');
include_once ($classPath . 'class.cat.php');
include_once ($classPath . 'class.treeitem.php');
include_once ($includesPath . 'cfg_language_de.inc.php');
include_once ($includesPath . 'functions.con.php');
if(!isRunningFromWeb() || function_exists("runJob") || $area == "cronjobs") {
$db = new DB_ConLite;
conFlagOnOffline();
conMoveArticles();
}
?>
}

Datei anzeigen

@ -25,20 +25,23 @@ if (!defined("CON_FRAMEWORK")) {
// Contenido startup process
include_once ('../includes/startup.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.user.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.xml.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.navigation.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'template/class.template.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.backend.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.table.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.notification.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.area.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.layout.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.client.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.cat.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.treeitem.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_language_de.inc.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'functions.stat.php');
$classPath = cRegistry::getConfigValue('path', 'conlite') . cRegistry::getConfigValue('path', 'classes');
$includesPath = cRegistry::getConfigValue('path', 'conlite') . cRegistry::getConfigValue('path', 'includes');
include_once ($classPath . 'class.user.php');
include_once ($classPath . 'class.xml.php');
include_once ($classPath . 'class.navigation.php');
include_once ($classPath . 'template/class.template.php');
include_once ($classPath . 'class.backend.php');
include_once ($classPath . 'class.table.php');
include_once ($classPath . 'class.notification.php');
include_once ($classPath . 'class.area.php');
include_once ($classPath . 'class.layout.php');
include_once ($classPath . 'class.client.php');
include_once ($classPath . 'class.cat.php');
include_once ($classPath . 'class.treeitem.php');
include_once ($includesPath . 'cfg_language_de.inc.php');
include_once ($includesPath . 'functions.stat.php');
if (!isRunningFromWeb() || function_exists("runJob") || $area == "cronjobs")
{
@ -57,5 +60,4 @@ if (!isRunningFromWeb() || function_exists("runJob") || $area == "cronjobs")
statsArchive(sprintf("%04d%02d",$year,$month));
}
?>
}

Datei anzeigen

@ -25,37 +25,41 @@ if (!defined("CON_FRAMEWORK")) {
// Contenido startup process
include_once ('../includes/startup.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.user.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.xml.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.navigation.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'template/class.template.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.backend.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.table.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.notification.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.area.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.layout.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.client.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.cat.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.treeitem.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_language_de.inc.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'functions.stat.php');
$classPath = cRegistry::getConfigValue('path', 'conlite') . cRegistry::getConfigValue('path', 'classes');
$includesPath = cRegistry::getConfigValue('path', 'conlite') . cRegistry::getConfigValue('path', 'includes');
include_once ($classPath . 'class.user.php');
include_once ($classPath . 'class.xml.php');
include_once ($classPath . 'class.navigation.php');
include_once ($classPath . 'template/class.template.php');
include_once ($classPath . 'class.backend.php');
include_once ($classPath . 'class.table.php');
include_once ($classPath . 'class.notification.php');
include_once ($classPath . 'class.area.php');
include_once ($classPath . 'class.layout.php');
include_once ($classPath . 'class.client.php');
include_once ($classPath . 'class.cat.php');
include_once ($classPath . 'class.treeitem.php');
include_once ($includesPath . 'cfg_language_de.inc.php');
include_once ($includesPath . 'functions.stat.php');
global $cfg;
if(!isRunningFromWeb() || function_exists("runJob") || $area == "cronjobs") {
$db = new DB_ConLite;
foreach ($cfg["tab"] as $key => $value)
$tables = cRegistry::getConfigValue('tab');
foreach ($tables as $key => $value)
{
$sql = "OPTIMIZE TABLE ".$value;
$db->query($sql);
}
if ($cfg["statistics_heap_table"]) {
$sHeapTable = $cfg['tab']['stat_heap_table'];
if (cRegistry::getConfigValue('statistics_heap_table')) {
$sHeapTable = cRegistry::getConfigValue('tab', 'stat_heap_table');
buildHeapTable ($sHeapTable, $db);
}
}
?>
}

Datei anzeigen

@ -1,11 +1,11 @@
<?php
/**
* Project:
* Project:
* Contenido Content Management System
*
* Description:
*
* Description:
* Job to set frontendusers active / inactive depending on the date entered in BE
*
*
* @package Backend
* @subpackage Cronjobs
* @version $Rev$
@ -23,38 +23,33 @@ if (!defined("CON_FRAMEWORK")) {
}
// Contenido startup process
include_once ('../includes/startup.php');
include_once('../includes/startup.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.user.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.xml.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.navigation.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'template/class.template.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.backend.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.table.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.notification.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.area.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.layout.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.client.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.cat.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.treeitem.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.inuse.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_language_de.inc.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'functions.stat.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.user.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.xml.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.navigation.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'template/class.template.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.backend.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.table.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.notification.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.area.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.layout.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.client.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.cat.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.treeitem.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["classes"] . 'class.inuse.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["includes"] . 'cfg_language_de.inc.php');
include_once($cfg['path']['contenido'] . $cfg["path"]["includes"] . 'functions.stat.php');
require_once($cfg['path']['contenido'].$cfg["path"]["includes"] . 'pseudo-cron.inc.php');
require_once($cfg['path']['contenido'] . $cfg["path"]["includes"] . 'pseudo-cron.inc.php');
if (!isRunningFromWeb() || function_exists("runJob") || $area == "cronjobs")
{
$db = new DB_ConLite();
if (!isRunningFromWeb() || function_exists("runJob") || $area == "cronjobs") {
$db = new DB_ConLite();
$sSql = "UPDATE " . $cfg['tab']['frontendusers'] . "
$sSql = "UPDATE " . $cfg['tab']['frontendusers'] . "
SET active = 0
WHERE
(valid_to < NOW() AND valid_to != '1000-01-01')
OR
(valid_from > NOW() AND valid_from != '1000-01-01')";
//echo $sSql;
$db->query($sSql);
WHERE (UNIX_TIMESTAMP(valid_to) <> 0 AND valid_to < NOW() AND valid_to != '1000-01-01 00:00:00')
OR (UNIX_TIMESTAMP(valid_from) <> 0 AND valid_from > NOW() AND valid_from != '1000-01-01 00:00:00')";
}
?>
$db->query($sSql);
}

Datei anzeigen

@ -1,25 +0,0 @@
<?php
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit4710875e1096bb659e0da9fbf88400bb::getLoader();

Datei anzeigen

@ -92,7 +92,7 @@ if ($cfg["use_pseudocron"] == true) {
* PHPLIB application development toolkit
* @see http://sourceforge.net/projects/phplib
*/
if (!empty($contenido)) {
if (isset($contenido)) {
//Backend
page_open(array('sess' => 'Contenido_Session', 'auth' => 'Contenido_Challenge_Crypt_Auth', 'perm' => 'Contenido_Perm'));
i18nInit($cfg["path"]["contenido"] . $cfg["path"]["locale"], $belang);
@ -130,9 +130,6 @@ if (isset($_GET['action']) && $_GET['action'] == 'get_compressed') {
exit();
}
// Call hook after plugins are loaded, added by Murat Purc, 2008-09-07
CEC_Hook::execute('Contenido.Frontend.AfterLoadPlugins');
if (!isset($encoding) || !is_array($encoding) || count($encoding) == 0) {
// get encodings of all languages
$encoding = array();
@ -241,7 +238,7 @@ $errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams);
* Note: These variables can be set via http globals e.g. front_content.php?idcat=41&idart=34&idcatart=35&idartlang=42
* If not the values will be computed.
*/
if ($idart && !$idcat && !$idcatart) {
if (!empty($idart) && empty($idcat) && empty($idcatart)) {
/* Try to fetch the first idcat */
$sql = "SELECT idcat FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "'";
$db->query($sql);
@ -410,7 +407,7 @@ if ($cfg["cache"]["disable"] != '1') {
* The reason is to avoid cross-site scripting errors in the backend, if the backend domain differs from
* the frontend domain.
*/
if ($contenido) {
if (isset($contenido)) {
$perm->load_permissions();
/* Change mode edit / view */
@ -533,7 +530,7 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p
##############################################
/* Mark submenuitem 'Preview' in the Contenido Backend (Area: Contenido --> Articles --> Preview) */
if ($contenido) {
if (isset($contenido)) {
$markscript = markSubMenuItem(4, true);
}
@ -610,9 +607,11 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p
/* If article is in use, display notification */
if (!empty($sHtmlInUseCss) && !empty($sHtmlInUseMessage)) {
$code = preg_replace("/<\/head>/i", "$sHtmlInUseCss\n</head>", $code, 1);
$code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1);
if(!preg_match("/(<body[^>]*)>.*/i", $code)) {
$code = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $code, 1);
$bInUseSet = true;
}
}
/* Check if category is public */
$sql = "SELECT public FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang='" . Contenido_Security::toInteger($lang) . "'";
@ -651,7 +650,7 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p
WHERE B.name = 'front_allow' AND C.name = 'str' AND A.user_id = '" . Contenido_Security::escapeDB($user_id, $db2) . "' AND A.idcat = '" . Contenido_Security::toInteger($idcat) . "'
AND A.idarea = C.idarea AND B.idaction = A.idaction";
$db2 = new DB_ConLite;
$db2 = new DB_ConLite();
$db2->query($sql);
if ($db2->num_rows() > 0) {
@ -795,12 +794,16 @@ if (empty($inUse) && (isset($allow) && $allow == true) && $view == "edit" && ($p
if (in_array(Contenido_Security::toInteger($idart), $aExclude)) {
eval("?>\n" . $code . "\n<?php\n");
} else {
chdir($cfgClient[$client]["path"]["frontend"]);
// write html output into output buffer and assign it to an variable
ob_start();
eval("?>\n" . $code . "\n<?php\n");
$htmlCode = ob_get_contents();
ob_end_clean();
if(!empty($sHtmlInUseMessage) && empty($bInUseSet)) {
$htmlCode = preg_replace("/(<body[^>]*)>/i", "\${1}> \n $sHtmlInUseMessage", $htmlCode, 1);
}
// process CEC to do some preparations before output
$htmlCode = CEC_Hook::executeAndReturn('Contenido.Frontend.HTMLCodeOutput', $htmlCode);

Datei anzeigen

@ -1,18 +0,0 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'EasyPeasyICS' => $vendorDir . '/phpmailer/phpmailer/extras/EasyPeasyICS.php',
'PHPMailer' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php',
'PHPMailerOAuth' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauth.php',
'PHPMailerOAuthGoogle' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauthgoogle.php',
'POP3' => $vendorDir . '/phpmailer/phpmailer/class.pop3.php',
'SMTP' => $vendorDir . '/phpmailer/phpmailer/class.smtp.php',
'ntlm_sasl_client_class' => $vendorDir . '/phpmailer/phpmailer/extras/ntlm_sasl_client.php',
'phpmailerException' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php',
);

Datei anzeigen

@ -1,12 +0,0 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
return array(
'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'),
'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qr-code/src'),
'Conlite\\External\\' => array($vendorDir . ''),
);

Datei anzeigen

@ -1,38 +0,0 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit4710875e1096bb659e0da9fbf88400bb
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit4710875e1096bb659e0da9fbf88400bb', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit4710875e1096bb659e0da9fbf88400bb', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit4710875e1096bb659e0da9fbf88400bb::getInitializer($loader));
$loader->register(true);
return $loader;
}
}

Datei anzeigen

@ -1,60 +0,0 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit4710875e1096bb659e0da9fbf88400bb
{
public static $prefixLengthsPsr4 = array (
'S' =>
array (
'Symfony\\Component\\OptionsResolver\\' => 34,
),
'E' =>
array (
'Endroid\\QrCode\\' => 15,
),
'C' =>
array (
'Conlite\\External\\' => 17,
),
);
public static $prefixDirsPsr4 = array (
'Symfony\\Component\\OptionsResolver\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/options-resolver',
),
'Endroid\\QrCode\\' =>
array (
0 => __DIR__ . '/..' . '/endroid/qr-code/src',
),
'Conlite\\External\\' =>
array (
0 => __DIR__ . '/../../..' . '/conlite/external',
),
);
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'EasyPeasyICS' => __DIR__ . '/..' . '/phpmailer/phpmailer/extras/EasyPeasyICS.php',
'PHPMailer' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmailer.php',
'PHPMailerOAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmaileroauth.php',
'PHPMailerOAuthGoogle' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmaileroauthgoogle.php',
'POP3' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.pop3.php',
'SMTP' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.smtp.php',
'ntlm_sasl_client_class' => __DIR__ . '/..' . '/phpmailer/phpmailer/extras/ntlm_sasl_client.php',
'phpmailerException' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmailer.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit4710875e1096bb659e0da9fbf88400bb::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit4710875e1096bb659e0da9fbf88400bb::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit4710875e1096bb659e0da9fbf88400bb::$classMap;
}, null, ClassLoader::class);
}
}

Datei anzeigen

@ -1,240 +0,0 @@
{
"packages": [
{
"name": "endroid/qr-code",
"version": "1.9.3",
"version_normalized": "1.9.3.0",
"source": {
"type": "git",
"url": "https://github.com/endroid/qr-code.git",
"reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/endroid/qr-code/zipball/c9644bec2a9cc9318e98d1437de3c628dcd1ef93",
"reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93",
"shasum": ""
},
"require": {
"ext-gd": "*",
"php": ">=5.4",
"symfony/options-resolver": "^2.3|^3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0|^5.0",
"sensio/framework-extra-bundle": "^3.0",
"symfony/browser-kit": "^2.3|^3.0",
"symfony/framework-bundle": "^2.3|^3.0",
"symfony/http-kernel": "^2.3|^3.0"
},
"time": "2017-04-08T09:13:59+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Endroid\\QrCode\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jeroen van den Enden",
"email": "info@endroid.nl",
"homepage": "http://endroid.nl/"
}
],
"description": "Endroid QR Code",
"homepage": "https://github.com/endroid/QrCode",
"keywords": [
"bundle",
"code",
"endroid",
"qr",
"qrcode",
"symfony"
],
"support": {
"issues": "https://github.com/endroid/qr-code/issues",
"source": "https://github.com/endroid/qr-code/tree/1.9.3"
},
"install-path": "../endroid/qr-code"
},
{
"name": "phpmailer/phpmailer",
"version": "v6.5.3",
"version_normalized": "6.5.3.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "baeb7cde6b60b1286912690ab0693c7789a31e71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/baeb7cde6b60b1286912690ab0693c7789a31e71",
"reference": "baeb7cde6b60b1286912690ab0693c7789a31e71",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"php": ">=5.0.0"
},
"require-dev": {
"doctrine/annotations": "1.2.*",
"jms/serializer": "0.16.*",
"phpdocumentor/phpdocumentor": "2.*",
"phpunit/phpunit": "4.8.*",
"symfony/debug": "2.8.*",
"symfony/filesystem": "2.8.*",
"symfony/translation": "2.8.*",
"symfony/yaml": "2.8.*",
"zendframework/zend-cache": "2.5.1",
"zendframework/zend-config": "2.5.1",
"zendframework/zend-eventmanager": "2.5.1",
"zendframework/zend-filter": "2.5.1",
"zendframework/zend-i18n": "2.5.1",
"zendframework/zend-json": "2.5.1",
"zendframework/zend-math": "2.5.1",
"zendframework/zend-serializer": "2.5.*",
"zendframework/zend-servicemanager": "2.5.*",
"zendframework/zend-stdlib": "2.5.1"
},
"suggest": {
"league/oauth2-google": "Needed for Google XOAUTH2 authentication"
},
"time": "2021-11-25T16:34:11+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"classmap": [
"class.phpmailer.php",
"class.phpmaileroauth.php",
"class.phpmaileroauthgoogle.php",
"class.smtp.php",
"class.pop3.php",
"extras/EasyPeasyICS.php",
"extras/ntlm_sasl_client.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.3"
},
"funding": [
{
"url": "https://marcus.bointon.com/donations/",
"type": "custom"
},
{
"url": "https://github.com/Synchro",
"type": "github"
},
{
"url": "https://www.patreon.com/marcusbointon",
"type": "patreon"
}
],
"install-path": "../phpmailer/phpmailer"
},
{
"name": "symfony/options-resolver",
"version": "v3.4.47",
"version_normalized": "3.4.47.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744",
"reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8"
},
"time": "2020-10-24T10:57:07+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Component\\OptionsResolver\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony OptionsResolver Component",
"homepage": "https://symfony.com",
"keywords": [
"config",
"configuration",
"options"
],
"support": {
"source": "https://github.com/symfony/options-resolver/tree/v3.4.47"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"install-path": "../symfony/options-resolver"
}
],
"dev": false,
"dev-package-names": []
}

Datei anzeigen

@ -1,59 +0,0 @@
<?php return array(
'root' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'type' => 'library',
'install_path' => __DIR__ . '/../../../',
'aliases' => array(),
'reference' => 'eea9100b3e2c72ca8b239c6a9fcb2671780ef12f',
'name' => 'vendor/con-lite21',
'dev' => false,
),
'versions' => array(
'bacon/bacon-qr-code' => array(
'pretty_version' => '2.0.4',
'version' => '2.0.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../bacon/bacon-qr-code',
'aliases' => array(),
'reference' => 'f73543ac4e1def05f1a70bcd1525c8a157a1ad09',
'dev_requirement' => false,
),
'dasprid/enum' => array(
'pretty_version' => '1.0.3',
'version' => '1.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../dasprid/enum',
'aliases' => array(),
'reference' => '5abf82f213618696dda8e3bf6f64dd042d8542b2',
'dev_requirement' => false,
),
'endroid/qr-code' => array(
'pretty_version' => '4.2.2',
'version' => '4.2.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../endroid/qr-code',
'aliases' => array(),
'reference' => '53bfce79da95bf082484301fecbc1d77a3907f78',
'dev_requirement' => false,
),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v6.5.3',
'version' => '6.5.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(),
'reference' => 'baeb7cde6b60b1286912690ab0693c7789a31e71',
'dev_requirement' => false,
),
'vendor/con-lite21' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'type' => 'library',
'install_path' => __DIR__ . '/../../../',
'aliases' => array(),
'reference' => 'eea9100b3e2c72ca8b239c6a9fcb2671780ef12f',
'dev_requirement' => false,
),
),
);

Datei anzeigen

@ -1,45 +0,0 @@
{
"name": "endroid/qrcode",
"description": "Endroid QR Code",
"keywords": ["endroid", "qrcode", "qr", "code", "bundle", "symfony"],
"homepage": "https://github.com/endroid/QrCode",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Jeroen van den Enden",
"email": "info@endroid.nl",
"homepage": "http://endroid.nl/"
}
],
"require": {
"php": ">=5.4",
"ext-gd": "*",
"symfony/options-resolver": "^2.3|^3.0"
},
"require-dev": {
"symfony/browser-kit": "^2.3|^3.0",
"symfony/framework-bundle": "^2.3|^3.0",
"symfony/http-kernel": "^2.3|^3.0",
"sensio/framework-extra-bundle": "^3.0",
"phpunit/phpunit": "^4.0|^5.0"
},
"autoload": {
"psr-4": {
"Endroid\\QrCode\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Endroid\\QrCode\\Tests\\": "tests/"
}
},
"config": {
"bin-dir": "bin"
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
}
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,49 +0,0 @@
<?php
/**
* PHPMailer SPL autoloader.
* PHP Version 5
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailer SPL autoloader.
* @param string $classname The name of the class to load
*/
function PHPMailerAutoload($classname)
{
//Can't use __DIR__ as it's only in PHP 5.3+
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
if (is_readable($filename)) {
require $filename;
}
}
if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
//SPL autoloading was introduced in PHP 5.1.2
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
spl_autoload_register('PHPMailerAutoload', true, true);
} else {
spl_autoload_register('PHPMailerAutoload');
}
} else {
/**
* Fall back to traditional autoload for old PHP versions
* @param string $classname The name of the class to load
*/
function __autoload($classname)
{
PHPMailerAutoload($classname);
}
}

Datei anzeigen

@ -1 +0,0 @@
5.2.28

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,197 +0,0 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.4
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailerOAuth - PHPMailer subclass adding OAuth support.
* @package PHPMailer
* @author @sherryl4george
* @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
*/
class PHPMailerOAuth extends PHPMailer
{
/**
* The OAuth user's email address
* @var string
*/
public $oauthUserEmail = '';
/**
* The OAuth refresh token
* @var string
*/
public $oauthRefreshToken = '';
/**
* The OAuth client ID
* @var string
*/
public $oauthClientId = '';
/**
* The OAuth client secret
* @var string
*/
public $oauthClientSecret = '';
/**
* An instance of the PHPMailerOAuthGoogle class.
* @var PHPMailerOAuthGoogle
* @access protected
*/
protected $oauth = null;
/**
* Get a PHPMailerOAuthGoogle instance to use.
* @return PHPMailerOAuthGoogle
*/
public function getOAUTHInstance()
{
if (!is_object($this->oauth)) {
$this->oauth = new PHPMailerOAuthGoogle(
$this->oauthUserEmail,
$this->oauthClientSecret,
$this->oauthClientId,
$this->oauthRefreshToken
);
}
return $this->oauth;
}
/**
* Initiate a connection to an SMTP server.
* Overrides the original smtpConnect method to add support for OAuth.
* @param array $options An array of options compatible with stream_context_create()
* @uses SMTP
* @access public
* @return bool
* @throws phpmailerException
*/
public function smtpConnect($options = array())
{
if (is_null($this->smtp)) {
$this->smtp = $this->getSMTPInstance();
}
if (is_null($this->oauth)) {
$this->oauth = $this->getOAUTHInstance();
}
// Already connected?
if ($this->smtp->connected()) {
return true;
}
$this->smtp->setTimeout($this->Timeout);
$this->smtp->setDebugLevel($this->SMTPDebug);
$this->smtp->setDebugOutput($this->Debugoutput);
$this->smtp->setVerp($this->do_verp);
$hosts = explode(';', $this->Host);
$lastexception = null;
foreach ($hosts as $hostentry) {
$hostinfo = array();
if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) {
// Not a valid host entry
continue;
}
// $hostinfo[2]: optional ssl or tls prefix
// $hostinfo[3]: the hostname
// $hostinfo[4]: optional port number
// The host string prefix can temporarily override the current setting for SMTPSecure
// If it's not specified, the default value is used
$prefix = '';
$secure = $this->SMTPSecure;
$tls = ($this->SMTPSecure == 'tls');
if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
$prefix = 'ssl://';
$tls = false; // Can't have SSL and TLS at the same time
$secure = 'ssl';
} elseif ($hostinfo[2] == 'tls') {
$tls = true;
// tls doesn't use a prefix
$secure = 'tls';
}
//Do we need the OpenSSL extension?
$sslext = defined('OPENSSL_ALGO_SHA1');
if ('tls' === $secure or 'ssl' === $secure) {
//Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
if (!$sslext) {
throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
}
}
$host = $hostinfo[3];
$port = $this->Port;
$tport = (integer)$hostinfo[4];
if ($tport > 0 and $tport < 65536) {
$port = $tport;
}
if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
try {
if ($this->Helo) {
$hello = $this->Helo;
} else {
$hello = $this->serverHostname();
}
$this->smtp->hello($hello);
//Automatically enable TLS encryption if:
// * it's not disabled
// * we have openssl extension
// * we are not already using SSL
// * the server offers STARTTLS
if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
$tls = true;
}
if ($tls) {
if (!$this->smtp->startTLS()) {
throw new phpmailerException($this->lang('connect_host'));
}
// We must resend HELO after tls negotiation
$this->smtp->hello($hello);
}
if ($this->SMTPAuth) {
if (!$this->smtp->authenticate(
$this->Username,
$this->Password,
$this->AuthType,
$this->Realm,
$this->Workstation,
$this->oauth
)
) {
throw new phpmailerException($this->lang('authenticate'));
}
}
return true;
} catch (phpmailerException $exc) {
$lastexception = $exc;
$this->edebug($exc->getMessage());
// We must have connected, but then failed TLS or Auth, so close connection nicely
$this->smtp->quit();
}
}
}
// If we get here, all connection attempts have failed, so close connection hard
$this->smtp->close();
// As we've caught all exceptions, just report whatever the last one was
if ($this->exceptions and !is_null($lastexception)) {
throw $lastexception;
}
return false;
}
}

Datei anzeigen

@ -1,77 +0,0 @@
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.4
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailerOAuthGoogle - Wrapper for League OAuth2 Google provider.
* @package PHPMailer
* @author @sherryl4george
* @author Marcus Bointon (@Synchro) <phpmailer@synchromedia.co.uk>
* @link https://github.com/thephpleague/oauth2-client
*/
class PHPMailerOAuthGoogle
{
private $oauthUserEmail = '';
private $oauthRefreshToken = '';
private $oauthClientId = '';
private $oauthClientSecret = '';
/**
* @param string $UserEmail
* @param string $ClientSecret
* @param string $ClientId
* @param string $RefreshToken
*/
public function __construct(
$UserEmail,
$ClientSecret,
$ClientId,
$RefreshToken
) {
$this->oauthClientId = $ClientId;
$this->oauthClientSecret = $ClientSecret;
$this->oauthRefreshToken = $RefreshToken;
$this->oauthUserEmail = $UserEmail;
}
private function getProvider()
{
return new League\OAuth2\Client\Provider\Google([
'clientId' => $this->oauthClientId,
'clientSecret' => $this->oauthClientSecret
]);
}
private function getGrant()
{
return new \League\OAuth2\Client\Grant\RefreshToken();
}
private function getToken()
{
$provider = $this->getProvider();
$grant = $this->getGrant();
return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]);
}
public function getOauth64()
{
$token = $this->getToken();
return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001");
}
}

Datei anzeigen

@ -1,407 +0,0 @@
<?php
/**
* PHPMailer POP-Before-SMTP Authentication Class.
* PHP Version 5
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailer POP-Before-SMTP Authentication Class.
* Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
* Does not support APOP.
* @package PHPMailer
* @author Richard Davey (original author) <rich@corephp.co.uk>
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
*/
class POP3
{
/**
* The POP3 PHPMailer Version number.
* @var string
* @access public
*/
public $Version = '5.2.28';
/**
* Default POP3 port number.
* @var integer
* @access public
*/
public $POP3_PORT = 110;
/**
* Default timeout in seconds.
* @var integer
* @access public
*/
public $POP3_TIMEOUT = 30;
/**
* POP3 Carriage Return + Line Feed.
* @var string
* @access public
* @deprecated Use the constant instead
*/
public $CRLF = "\r\n";
/**
* Debug display level.
* Options: 0 = no, 1+ = yes
* @var integer
* @access public
*/
public $do_debug = 0;
/**
* POP3 mail server hostname.
* @var string
* @access public
*/
public $host;
/**
* POP3 port number.
* @var integer
* @access public
*/
public $port;
/**
* POP3 Timeout Value in seconds.
* @var integer
* @access public
*/
public $tval;
/**
* POP3 username
* @var string
* @access public
*/
public $username;
/**
* POP3 password.
* @var string
* @access public
*/
public $password;
/**
* Resource handle for the POP3 connection socket.
* @var resource
* @access protected
*/
protected $pop_conn;
/**
* Are we connected?
* @var boolean
* @access protected
*/
protected $connected = false;
/**
* Error container.
* @var array
* @access protected
*/
protected $errors = array();
/**
* Line break constant
*/
const CRLF = "\r\n";
/**
* Simple static wrapper for all-in-one POP before SMTP
* @param $host
* @param integer|boolean $port The port number to connect to
* @param integer|boolean $timeout The timeout value
* @param string $username
* @param string $password
* @param integer $debug_level
* @return boolean
*/
public static function popBeforeSmtp(
$host,
$port = false,
$timeout = false,
$username = '',
$password = '',
$debug_level = 0
) {
$pop = new POP3;
return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
}
/**
* Authenticate with a POP3 server.
* A connect, login, disconnect sequence
* appropriate for POP-before SMTP authorisation.
* @access public
* @param string $host The hostname to connect to
* @param integer|boolean $port The port number to connect to
* @param integer|boolean $timeout The timeout value
* @param string $username
* @param string $password
* @param integer $debug_level
* @return boolean
*/
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
{
$this->host = $host;
// If no port value provided, use default
if (false === $port) {
$this->port = $this->POP3_PORT;
} else {
$this->port = (integer)$port;
}
// If no timeout value provided, use default
if (false === $timeout) {
$this->tval = $this->POP3_TIMEOUT;
} else {
$this->tval = (integer)$timeout;
}
$this->do_debug = $debug_level;
$this->username = $username;
$this->password = $password;
// Reset the error log
$this->errors = array();
// connect
$result = $this->connect($this->host, $this->port, $this->tval);
if ($result) {
$login_result = $this->login($this->username, $this->password);
if ($login_result) {
$this->disconnect();
return true;
}
}
// We need to disconnect regardless of whether the login succeeded
$this->disconnect();
return false;
}
/**
* Connect to a POP3 server.
* @access public
* @param string $host
* @param integer|boolean $port
* @param integer $tval
* @return boolean
*/
public function connect($host, $port = false, $tval = 30)
{
// Are we already connected?
if ($this->connected) {
return true;
}
//On Windows this will raise a PHP Warning error if the hostname doesn't exist.
//Rather than suppress it with @fsockopen, capture it cleanly instead
set_error_handler(array($this, 'catchWarning'));
if (false === $port) {
$port = $this->POP3_PORT;
}
// connect to the POP3 server
$this->pop_conn = fsockopen(
$host, // POP3 Host
$port, // Port #
$errno, // Error Number
$errstr, // Error Message
$tval
); // Timeout (seconds)
// Restore the error handler
restore_error_handler();
// Did we connect?
if (false === $this->pop_conn) {
// It would appear not...
$this->setError(array(
'error' => "Failed to connect to server $host on port $port",
'errno' => $errno,
'errstr' => $errstr
));
return false;
}
// Increase the stream time-out
stream_set_timeout($this->pop_conn, $tval, 0);
// Get the POP3 server response
$pop3_response = $this->getResponse();
// Check for the +OK
if ($this->checkResponse($pop3_response)) {
// The connection is established and the POP3 server is talking
$this->connected = true;
return true;
}
return false;
}
/**
* Log in to the POP3 server.
* Does not support APOP (RFC 2828, 4949).
* @access public
* @param string $username
* @param string $password
* @return boolean
*/
public function login($username = '', $password = '')
{
if (!$this->connected) {
$this->setError('Not connected to POP3 server');
}
if (empty($username)) {
$username = $this->username;
}
if (empty($password)) {
$password = $this->password;
}
// Send the Username
$this->sendString("USER $username" . self::CRLF);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
// Send the Password
$this->sendString("PASS $password" . self::CRLF);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
return true;
}
}
return false;
}
/**
* Disconnect from the POP3 server.
* @access public
*/
public function disconnect()
{
$this->sendString('QUIT');
//The QUIT command may cause the daemon to exit, which will kill our connection
//So ignore errors here
try {
@fclose($this->pop_conn);
} catch (Exception $e) {
//Do nothing
};
}
/**
* Get a response from the POP3 server.
* $size is the maximum number of bytes to retrieve
* @param integer $size
* @return string
* @access protected
*/
protected function getResponse($size = 128)
{
$response = fgets($this->pop_conn, $size);
if ($this->do_debug >= 1) {
echo "Server -> Client: $response";
}
return $response;
}
/**
* Send raw data to the POP3 server.
* @param string $string
* @return integer
* @access protected
*/
protected function sendString($string)
{
if ($this->pop_conn) {
if ($this->do_debug >= 2) { //Show client messages when debug >= 2
echo "Client -> Server: $string";
}
return fwrite($this->pop_conn, $string, strlen($string));
}
return 0;
}
/**
* Checks the POP3 server response.
* Looks for for +OK or -ERR.
* @param string $string
* @return boolean
* @access protected
*/
protected function checkResponse($string)
{
if (substr($string, 0, 3) !== '+OK') {
$this->setError(array(
'error' => "Server reported an error: $string",
'errno' => 0,
'errstr' => ''
));
return false;
} else {
return true;
}
}
/**
* Add an error to the internal error store.
* Also display debug output if it's enabled.
* @param $error
* @access protected
*/
protected function setError($error)
{
$this->errors[] = $error;
if ($this->do_debug >= 1) {
echo '<pre>';
foreach ($this->errors as $error) {
print_r($error);
}
echo '</pre>';
}
}
/**
* Get an array of error messages, if any.
* @return array
*/
public function getErrors()
{
return $this->errors;
}
/**
* POP3 connection error handler.
* @param integer $errno
* @param string $errstr
* @param string $errfile
* @param integer $errline
* @access protected
*/
protected function catchWarning($errno, $errstr, $errfile, $errline)
{
$this->setError(array(
'error' => "Connecting to the POP3 server raised a PHP warning: ",
'errno' => $errno,
'errstr' => $errstr,
'errfile' => $errfile,
'errline' => $errline
));
}
}

Datei anzeigen

@ -1,61 +0,0 @@
{
"name": "phpmailer/phpmailer",
"type": "library",
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"authors": [
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"require": {
"ext-ctype": "*",
"php": ">=5.0.0"
},
"require-dev": {
"doctrine/annotations": "1.2.*",
"jms/serializer": "0.16.*",
"phpdocumentor/phpdocumentor": "2.*",
"phpunit/phpunit": "4.8.*",
"symfony/debug": "2.8.*",
"symfony/filesystem": "2.8.*",
"symfony/translation": "2.8.*",
"symfony/yaml": "2.8.*",
"zendframework/zend-cache": "2.5.1",
"zendframework/zend-config": "2.5.1",
"zendframework/zend-eventmanager": "2.5.1",
"zendframework/zend-filter": "2.5.1",
"zendframework/zend-i18n": "2.5.1",
"zendframework/zend-json": "2.5.1",
"zendframework/zend-math": "2.5.1",
"zendframework/zend-serializer": "2.5.*",
"zendframework/zend-servicemanager": "2.5.*",
"zendframework/zend-stdlib": "2.5.1"
},
"suggest": {
"league/oauth2-google": "Needed for Google XOAUTH2 authentication"
},
"autoload": {
"classmap": [
"class.phpmailer.php",
"class.phpmaileroauth.php",
"class.phpmaileroauthgoogle.php",
"class.smtp.php",
"class.pop3.php",
"extras/EasyPeasyICS.php",
"extras/ntlm_sasl_client.php"
]
},
"license": "LGPL-2.1"
}

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,38 +0,0 @@
<?php
/**
* This example shows how to use DKIM message authentication with PHPMailer.
* There's more to using DKIM than just this code - check out this article:
* @link https://yomotherboard.com/how-to-setup-email-server-dkim-keys/
* See also the DKIM code in the PHPMailer unit tests,
* which shows how to make a key pair from PHP.
*/
require '../PHPMailerAutoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer DKIM test';
//This should be the same as the domain of your From address
$mail->DKIM_domain = 'example.com';
//Path to your private key file
$mail->DKIM_private = 'dkim_private.pem';
//Set this to your own selector
$mail->DKIM_selector = 'phpmailer';
//If your private key has a passphrase, set it here
$mail->DKIM_passphrase = '';
//The identity you're signing as - usually your From address
$mail->DKIM_identity = $mail->From;
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}

Datei anzeigen

@ -1,604 +0,0 @@
<?php
/*
* A web form that both generates and uses PHPMailer code.
* revised, updated and corrected 27/02/2013
* by matt.sturdy@gmail.com
*/
require '../PHPMailerAutoload.php';
$CFG['smtp_debug'] = 2; //0 == off, 1 for client output, 2 for client and server
$CFG['smtp_debugoutput'] = 'html';
$CFG['smtp_server'] = 'localhost';
$CFG['smtp_port'] = '25';
$CFG['smtp_authenticate'] = false;
$CFG['smtp_username'] = 'name@example.com';
$CFG['smtp_password'] = 'yourpassword';
$CFG['smtp_secure'] = 'None';
$from_name = (isset($_POST['From_Name'])) ? $_POST['From_Name'] : '';
$from_email = (isset($_POST['From_Email'])) ? $_POST['From_Email'] : '';
$to_name = (isset($_POST['To_Name'])) ? $_POST['To_Name'] : '';
$to_email = (isset($_POST['To_Email'])) ? $_POST['To_Email'] : '';
$cc_email = (isset($_POST['cc_Email'])) ? $_POST['cc_Email'] : '';
$bcc_email = (isset($_POST['bcc_Email'])) ? $_POST['bcc_Email'] : '';
$subject = (isset($_POST['Subject'])) ? $_POST['Subject'] : '';
$message = (isset($_POST['Message'])) ? $_POST['Message'] : '';
$test_type = (isset($_POST['test_type'])) ? $_POST['test_type'] : 'smtp';
$smtp_debug = (isset($_POST['smtp_debug'])) ? $_POST['smtp_debug'] : $CFG['smtp_debug'];
$smtp_server = (isset($_POST['smtp_server'])) ? $_POST['smtp_server'] : $CFG['smtp_server'];
$smtp_port = (isset($_POST['smtp_port'])) ? $_POST['smtp_port'] : $CFG['smtp_port'];
$smtp_secure = strtolower((isset($_POST['smtp_secure'])) ? $_POST['smtp_secure'] : $CFG['smtp_secure']);
$smtp_authenticate = (isset($_POST['smtp_authenticate'])) ?
$_POST['smtp_authenticate'] : $CFG['smtp_authenticate'];
$authenticate_password = (isset($_POST['authenticate_password'])) ?
$_POST['authenticate_password'] : $CFG['smtp_password'];
$authenticate_username = (isset($_POST['authenticate_username'])) ?
$_POST['authenticate_username'] : $CFG['smtp_username'];
// storing all status output from the script to be shown to the user later
$results_messages = array();
// $example_code represents the "final code" that we're using, and will
// be shown to the user at the end.
$example_code = "\nrequire_once '../PHPMailerAutoload.php';";
$example_code .= "\n\n\$results_messages = array();";
$mail = new PHPMailer(true); //PHPMailer instance with exceptions enabled
$mail->CharSet = 'utf-8';
ini_set('default_charset', 'UTF-8');
$mail->Debugoutput = $CFG['smtp_debugoutput'];
$example_code .= "\n\n\$mail = new PHPMailer(true);";
$example_code .= "\n\$mail->CharSet = 'utf-8';";
$example_code .= "\nini_set('default_charset', 'UTF-8');";
class phpmailerAppException extends phpmailerException
{
}
$example_code .= "\n\nclass phpmailerAppException extends phpmailerException {}";
$example_code .= "\n\ntry {";
// Convert a string to its JavaScript representation.
function JSString($s) {
static $from = array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"');
static $to = array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\\"');
return is_null($s)? 'null': '"' . str_replace($from, $to, "$s") . '"';
}
try {
if (isset($_POST["submit"]) && $_POST['submit'] == "Submit") {
$to = $to_email;
if (!PHPMailer::validateAddress($to)) {
throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!");
}
$example_code .= "\n\$to = '" . addslashes($to_email) . "';";
$example_code .= "\nif(!PHPMailer::validateAddress(\$to)) {";
$example_code .= "\n throw new phpmailerAppException(\"Email address \" . " .
"\$to . \" is invalid -- aborting!\");";
$example_code .= "\n}";
switch ($test_type) {
case 'smtp':
$mail->isSMTP(); // telling the class to use SMTP
$mail->SMTPDebug = (integer)$smtp_debug;
$mail->Host = $smtp_server; // SMTP server
$mail->Port = (integer)$smtp_port; // set the SMTP port
if ($smtp_secure) {
$mail->SMTPSecure = strtolower($smtp_secure);
}
$mail->SMTPAuth = array_key_exists('smtp_authenticate', $_POST); // enable SMTP authentication?
if (array_key_exists('smtp_authenticate', $_POST)) {
$mail->Username = $authenticate_username; // SMTP account username
$mail->Password = $authenticate_password; // SMTP account password
}
$example_code .= "\n\$mail->isSMTP();";
$example_code .= "\n\$mail->SMTPDebug = " . (integer) $smtp_debug . ";";
$example_code .= "\n\$mail->Host = \"" . addslashes($smtp_server) . "\";";
$example_code .= "\n\$mail->Port = \"" . addslashes($smtp_port) . "\";";
$example_code .= "\n\$mail->SMTPSecure = \"" . addslashes(strtolower($smtp_secure)) . "\";";
$example_code .= "\n\$mail->SMTPAuth = " . (array_key_exists(
'smtp_authenticate',
$_POST
) ? 'true' : 'false') . ";";
if (array_key_exists('smtp_authenticate', $_POST)) {
$example_code .= "\n\$mail->Username = \"" . addslashes($authenticate_username) . "\";";
$example_code .= "\n\$mail->Password = \"" . addslashes($authenticate_password) . "\";";
}
break;
case 'mail':
$mail->isMail(); // telling the class to use PHP's mail()
$example_code .= "\n\$mail->isMail();";
break;
case 'sendmail':
$mail->isSendmail(); // telling the class to use Sendmail
$example_code .= "\n\$mail->isSendmail();";
break;
case 'qmail':
$mail->isQmail(); // telling the class to use Qmail
$example_code .= "\n\$mail->isQmail();";
break;
default:
throw new phpmailerAppException('Invalid test_type provided');
}
try {
if ($_POST['From_Name'] != '') {
$mail->addReplyTo($from_email, $from_name);
$mail->setFrom($from_email, $from_name);
$example_code .= "\n\$mail->addReplyTo(\"" .
addslashes($from_email) . "\", \"" . addslashes($from_name) . "\");";
$example_code .= "\n\$mail->setFrom(\"" .
addslashes($from_email) . "\", \"" . addslashes($from_name) . "\");";
} else {
$mail->addReplyTo($from_email);
$mail->setFrom($from_email, $from_email);
$example_code .= "\n\$mail->addReplyTo(\"" . addslashes($from_email) . "\");";
$example_code .= "\n\$mail->setFrom(\"" .
addslashes($from_email) . "\", \"" . addslashes($from_email) . "\");";
}
if ($_POST['To_Name'] != '') {
$mail->addAddress($to, $to_name);
$example_code .= "\n\$mail->addAddress(\"$to\", \"" . addslashes($to_name) . "\");";
} else {
$mail->addAddress($to);
$example_code .= "\n\$mail->addAddress(\"$to\");";
}
if ($_POST['bcc_Email'] != '') {
$indiBCC = explode(" ", $bcc_email);
foreach ($indiBCC as $key => $value) {
$mail->addBCC($value);
$example_code .= "\n\$mail->addBCC(\"" . addslashes($value) . "\");";
}
}
if ($_POST['cc_Email'] != '') {
$indiCC = explode(" ", $cc_Email);
foreach ($indiCC as $key => $value) {
$mail->addCC($value);
$example_code .= "\n\$mail->addCC(\"" . addslashes($value) . "\");";
}
}
} catch (phpmailerException $e) { //Catch all kinds of bad addressing
throw new phpmailerAppException($e->getMessage());
}
$mail->Subject = $subject . ' (PHPMailer test using ' . strtoupper($test_type) . ')';
$example_code .= "\n\$mail->Subject = \"" . addslashes($subject) .
' (PHPMailer test using ' . addslashes(strtoupper($test_type)) . ')";';
if ($_POST['Message'] == '') {
$body = file_get_contents('contents.html');
} else {
$body = $message;
}
$example_code .= "\n\$body = <<<'EOT'\n$body\nEOT;";
$mail->WordWrap = 78; // set word wrap to the RFC2822 limit
$mail->msgHTML($body, dirname(__FILE__), true); //Create message bodies and embed images
$example_code .= "\n\$mail->WordWrap = 78;";
$example_code .= "\n\$mail->msgHTML(\$body, dirname(__FILE__), true); //Create message bodies and embed images";
$mail->addAttachment('images/phpmailer_mini.png', 'phpmailer_mini.png'); // optional name
$mail->addAttachment('images/phpmailer.png', 'phpmailer.png'); // optional name
$example_code .= "\n\$mail->addAttachment('images/phpmailer_mini.png'," .
"'phpmailer_mini.png'); // optional name";
$example_code .= "\n\$mail->addAttachment('images/phpmailer.png', 'phpmailer.png'); // optional name";
$example_code .= "\n\ntry {";
$example_code .= "\n \$mail->send();";
$example_code .= "\n \$results_messages[] = \"Message has been sent using " .
addslashes(strtoupper($test_type)) . "\";";
$example_code .= "\n}";
$example_code .= "\ncatch (phpmailerException \$e) {";
$example_code .= "\n throw new phpmailerAppException('Unable to send to: ' . \$to. ': '.\$e->getMessage());";
$example_code .= "\n}";
try {
$mail->send();
$results_messages[] = "Message has been sent using " . strtoupper($test_type);
} catch (phpmailerException $e) {
throw new phpmailerAppException("Unable to send to: " . $to . ': ' . $e->getMessage());
}
}
} catch (phpmailerAppException $e) {
$results_messages[] = $e->errorMessage();
}
$example_code .= "\n}";
$example_code .= "\ncatch (phpmailerAppException \$e) {";
$example_code .= "\n \$results_messages[] = \$e->errorMessage();";
$example_code .= "\n}";
$example_code .= "\n\nif (count(\$results_messages) > 0) {";
$example_code .= "\n echo \"<h2>Run results</h2>\\n\";";
$example_code .= "\n echo \"<ul>\\n\";";
$example_code .= "\nforeach (\$results_messages as \$result) {";
$example_code .= "\n echo \"<li>\$result</li>\\n\";";
$example_code .= "\n}";
$example_code .= "\necho \"</ul>\\n\";";
$example_code .= "\n}";
?><!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHPMailer Test Page</title>
<script type="text/javascript" src="scripts/shCore.js"></script>
<script type="text/javascript" src="scripts/shBrushPhp.js"></script>
<link type="text/css" rel="stylesheet" href="styles/shCore.css">
<link type="text/css" rel="stylesheet" href="styles/shThemeDefault.css">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 1em;
padding: 1em;
}
table {
margin: 0 auto;
border-spacing: 0;
border-collapse: collapse;
}
table.column {
border-collapse: collapse;
background-color: #FFFFFF;
padding: 0.5em;
width: 35em;
}
td {
font-size: 1em;
padding: 0.1em 0.25em;
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
border-radius: 1em;
}
td.colleft {
text-align: right;
width: 35%;
}
td.colrite {
text-align: left;
width: 65%;
}
fieldset {
padding: 1em 1em 1em 1em;
margin: 0 2em;
border-radius: 1.5em;
-webkit-border-radius: 1em;
-moz-border-radius: 1em;
}
fieldset.inner {
width: 40%;
}
fieldset:hover, tr:hover {
background-color: #fafafa;
}
legend {
font-weight: bold;
font-size: 1.1em;
}
div.column-left {
float: left;
width: 45em;
height: 31em;
}
div.column-right {
display: inline;
width: 45em;
max-height: 31em;
}
input.radio {
float: left;
}
div.radio {
padding: 0.2em;
}
</style>
<script>
SyntaxHighlighter.config.clipboardSwf = 'scripts/clipboard.swf';
SyntaxHighlighter.all();
function startAgain() {
var post_params = {
"From_Name": <?php echo JSString($from_name); ?>,
"From_Email": <?php echo JSString($from_email); ?>,
"To_Name": <?php echo JSString($to_name); ?>,
"To_Email": <?php echo JSString($to_email); ?>,
"cc_Email": <?php echo JSString($cc_email); ?>,
"bcc_Email": <?php echo JSString($bcc_email); ?>,
"Subject": <?php echo JSString($subject); ?>,
"Message": <?php echo JSString($message); ?>,
"test_type": <?php echo JSString($test_type); ?>,
"smtp_debug": <?php echo JSString($smtp_debug); ?>,
"smtp_server": <?php echo JSString($smtp_server); ?>,
"smtp_port": <?php echo JSString($smtp_port); ?>,
"smtp_secure": <?php echo JSString($smtp_secure); ?>,
"smtp_authenticate": <?php echo JSString($smtp_authenticate); ?>,
"authenticate_username": <?php echo JSString($authenticate_username); ?>,
"authenticate_password": <?php echo JSString($authenticate_password); ?>
};
var resetForm = document.createElement("form");
resetForm.setAttribute("method", "POST");
resetForm.setAttribute("path", "index.php");
for (var k in post_params) {
var h = document.createElement("input");
h.setAttribute("type", "hidden");
h.setAttribute("name", k);
h.setAttribute("value", post_params[k]);
resetForm.appendChild(h);
}
document.body.appendChild(resetForm);
resetForm.submit();
}
function showHideDiv(test, element_id) {
var ops = {"smtp-options-table": "smtp"};
if (test == ops[element_id]) {
document.getElementById(element_id).style.display = "block";
} else {
document.getElementById(element_id).style.display = "none";
}
}
</script>
</head>
<body>
<?php
if (version_compare(PHP_VERSION, '5.0.0', '<')) {
echo 'Current PHP version: ' . phpversion() . "<br>";
echo exit("ERROR: Wrong PHP version. Must be PHP 5 or above.");
}
if (count($results_messages) > 0) {
echo '<h2>Run results</h2>';
echo '<ul>';
foreach ($results_messages as $result) {
echo "<li>$result</li>";
}
echo '</ul>';
}
if (isset($_POST["submit"]) && $_POST["submit"] == "Submit") {
echo "<button type=\"submit\" onclick=\"startAgain();\">Start Over</button><br>\n";
echo "<br><span>Script:</span>\n";
echo "<pre class=\"brush: php;\">\n";
echo htmlentities($example_code);
echo "\n</pre>\n";
echo "\n<hr style=\"margin: 3em;\">\n";
}
?>
<form method="POST" enctype="multipart/form-data">
<div>
<div class="column-left">
<fieldset>
<legend>Mail Details</legend>
<table border="1" class="column">
<tr>
<td class="colleft">
<label for="From_Name"><strong>From</strong> Name</label>
</td>
<td class="colrite">
<input type="text" id="From_Name" name="From_Name" value="<?php echo htmlentities($from_name); ?>"
style="width:95%;" autofocus placeholder="Your Name">
</td>
</tr>
<tr>
<td class="colleft">
<label for="From_Email"><strong>From</strong> Email Address</label>
</td>
<td class="colrite">
<input type="text" id="From_Email" name="From_Email" value="<?php echo htmlentities($from_email); ?>"
style="width:95%;" required placeholder="Your.Email@example.com">
</td>
</tr>
<tr>
<td class="colleft">
<label for="To_Name"><strong>To</strong> Name</label>
</td>
<td class="colrite">
<input type="text" id="To_Name" name="To_Name" value="<?php echo htmlentities($to_name); ?>"
style="width:95%;" placeholder="Recipient's Name">
</td>
</tr>
<tr>
<td class="colleft">
<label for="To_Email"><strong>To</strong> Email Address</label>
</td>
<td class="colrite">
<input type="text" id="To_Email" name="To_Email" value="<?php echo htmlentities($to_email); ?>"
style="width:95%;" required placeholder="Recipients.Email@example.com">
</td>
</tr>
<tr>
<td class="colleft">
<label for="cc_Email"><strong>CC Recipients</strong><br>
<small>(separate with commas)</small>
</label>
</td>
<td class="colrite">
<input type="text" id="cc_Email" name="cc_Email" value="<?php echo htmlentities($cc_email); ?>"
style="width:95%;" placeholder="cc1@example.com, cc2@example.com">
</td>
</tr>
<tr>
<td class="colleft">
<label for="bcc_Email"><strong>BCC Recipients</strong><br>
<small>(separate with commas)</small>
</label>
</td>
<td class="colrite">
<input type="text" id="bcc_Email" name="bcc_Email" value="<?php echo htmlentities($bcc_email); ?>"
style="width:95%;" placeholder="bcc1@example.com, bcc2@example.com">
</td>
</tr>
<tr>
<td class="colleft">
<label for="Subject"><strong>Subject</strong></label>
</td>
<td class="colrite">
<input type="text" name="Subject" id="Subject" value="<?php echo htmlentities($subject); ?>"
style="width:95%;" placeholder="Email Subject">
</td>
</tr>
<tr>
<td class="colleft">
<label for="Message"><strong>Message</strong><br>
<small>If blank, will use content.html</small>
</label>
</td>
<td class="colrite">
<textarea name="Message" id="Message" style="width:95%;height:5em;"
placeholder="Body of your email"><?php echo htmlentities($message); ?></textarea>
</td>
</tr>
</table>
<div style="margin:1em 0;">Test will include two attachments.</div>
</fieldset>
</div>
<div class="column-right">
<fieldset class="inner"> <!-- SELECT TYPE OF MAIL -->
<legend>Mail Test Specs</legend>
<table border="1" class="column">
<tr>
<td class="colleft">Test Type</td>
<td class="colrite">
<div class="radio">
<label for="radio-mail">Mail()</label>
<input class="radio" type="radio" name="test_type" value="mail" id="radio-mail"
onclick="showHideDiv(this.value, 'smtp-options-table');"
<?php echo ($test_type == 'mail') ? 'checked' : ''; ?>
required>
</div>
<div class="radio">
<label for="radio-sendmail">Sendmail</label>
<input class="radio" type="radio" name="test_type" value="sendmail" id="radio-sendmail"
onclick="showHideDiv(this.value, 'smtp-options-table');"
<?php echo ($test_type == 'sendmail') ? 'checked' : ''; ?>
required>
</div>
<div class="radio">
<label for="radio-qmail">Qmail</label>
<input class="radio" type="radio" name="test_type" value="qmail" id="radio-qmail"
onclick="showHideDiv(this.value, 'smtp-options-table');"
<?php echo ($test_type == 'qmail') ? 'checked' : ''; ?>
required>
</div>
<div class="radio">
<label for="radio-smtp">SMTP</label>
<input class="radio" type="radio" name="test_type" value="smtp" id="radio-smtp"
onclick="showHideDiv(this.value, 'smtp-options-table');"
<?php echo ($test_type == 'smtp') ? 'checked' : ''; ?>
required>
</div>
</td>
</tr>
</table>
<div id="smtp-options-table" style="margin:1em 0 0 0;
<?php if ($test_type != 'smtp') {
echo "display: none;";
} ?>">
<span style="margin:1.25em 0; display:block;"><strong>SMTP Specific Options:</strong></span>
<table border="1" class="column">
<tr>
<td class="colleft"><label for="smtp_debug">SMTP Debug ?</label></td>
<td class="colrite">
<select size="1" id="smtp_debug" name="smtp_debug">
<option <?php echo ($smtp_debug == '0') ? 'selected' : ''; ?> value="0">
0 - Disabled
</option>
<option <?php echo ($smtp_debug == '1') ? 'selected' : ''; ?> value="1">
1 - Client messages
</option>
<option <?php echo ($smtp_debug == '2') ? 'selected' : ''; ?> value="2">
2 - Client and server messages
</option>
</select>
</td>
</tr>
<tr>
<td class="colleft"><label for="smtp_server">SMTP Server</label></td>
<td class="colrite">
<input type="text" id="smtp_server" name="smtp_server"
value="<?php echo htmlentities($smtp_server); ?>" style="width:95%;"
placeholder="smtp.server.com">
</td>
</tr>
<tr>
<td class="colleft" style="width: 5em;"><label for="smtp_port">SMTP Port</label></td>
<td class="colrite">
<input type="text" name="smtp_port" id="smtp_port" size="3"
value="<?php echo htmlentities($smtp_port); ?>" placeholder="Port">
</td>
</tr>
<tr>
<td class="colleft"><label for="smtp_secure">SMTP Security</label></td>
<td>
<select size="1" name="smtp_secure" id="smtp_secure">
<option <?php echo ($smtp_secure == 'none') ? 'selected' : '' ?>>None</option>
<option <?php echo ($smtp_secure == 'tls') ? 'selected' : '' ?>>TLS</option>
<option <?php echo ($smtp_secure == 'ssl') ? 'selected' : '' ?>>SSL</option>
</select>
</td>
</tr>
<tr>
<td class="colleft"><label for="smtp-authenticate">SMTP Authenticate?</label></td>
<td class="colrite">
<input type="checkbox" id="smtp-authenticate"
name="smtp_authenticate"
<?php if ($smtp_authenticate != '') {
echo "checked";
} ?>
value="true">
</td>
</tr>
<tr>
<td class="colleft"><label for="authenticate_username">Authenticate Username</label></td>
<td class="colrite">
<input type="text" id="authenticate_username" name="authenticate_username"
value="<?php echo htmlentities($authenticate_username); ?>" style="width:95%;"
placeholder="SMTP Server Username">
</td>
</tr>
<tr>
<td class="colleft"><label for="authenticate_password">Authenticate Password</label></td>
<td class="colrite">
<input type="password" name="authenticate_password" id="authenticate_password"
value="<?php echo htmlentities($authenticate_password); ?>" style="width:95%;"
placeholder="SMTP Server Password">
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<br style="clear:both;">
<div style="margin-left:2em; margin-bottom:5em; float:left;">
<div style="margin-bottom: 1em; ">
<input type="submit" value="Submit" name="submit">
</div>
<?php echo 'Current PHP version: ' . phpversion(); ?>
</div>
</div>
</form>
</body>
</html>

Datei anzeigen

@ -1,71 +0,0 @@
<?php
/**
* This example shows how to handle a simple contact form.
*/
$msg = '';
//Don't run this unless we're handling a form submission
if (array_key_exists('email', $_POST)) {
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP - requires a local mail server
//Faster and safer than using mail()
$mail->isSMTP();
$mail->Host = 'localhost';
$mail->Port = 25;
//Use a fixed address in your own domain as the from address
//**DO NOT** use the submitter's address here as it will be forgery
//and will cause your messages to fail SPF checks
$mail->setFrom('from@example.com', 'First Last');
//Send the message to yourself, or whoever should receive contact for submissions
$mail->addAddress('whoto@example.com', 'John Doe');
//Put the submitter's address in a reply-to header
//This will fail if the address provided is invalid,
//in which case we should ignore the whole request
if ($mail->addReplyTo($_POST['email'], $_POST['name'])) {
$mail->Subject = 'PHPMailer contact form';
//Keep it simple - don't use HTML
$mail->isHTML(false);
//Build a simple message body
$mail->Body = <<<EOT
Email: {$_POST['email']}
Name: {$_POST['name']}
Message: {$_POST['message']}
EOT;
//Send the message, check for errors
if (!$mail->send()) {
//The reason for failing to send will be in $mail->ErrorInfo
//but you shouldn't display errors to users - process the error, log it on your server.
$msg = 'Sorry, something went wrong. Please try again later.';
} else {
$msg = 'Message sent! Thanks for contacting us.';
}
} else {
$msg = 'Invalid email address, message ignored.';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact form</title>
</head>
<body>
<h1>Contact us</h1>
<?php if (!empty($msg)) {
echo "<h2>$msg</h2>";
} ?>
<form method="POST">
<label for="name">Name: <input type="text" name="name" id="name"></label><br>
<label for="email">Email address: <input type="email" name="email" id="email"></label><br>
<label for="message">Message: <textarea name="message" id="message" rows="8" cols="20"></textarea></label><br>
<input type="submit" value="Send">
</form>
</body>
</html>

Datei anzeigen

@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>PHPMailer Test</title>
</head>
<body>
<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
<h1>This is a test of PHPMailer.</h1>
<div align="center">
<a href="https://github.com/PHPMailer/PHPMailer/"><img src="images/phpmailer.png" height="90" width="340" alt="PHPMailer rocks"></a>
</div>
<p>This example uses <strong>HTML</strong>.</p>
<p>ISO-8859-1 text: éèîüçÅñæß</p>
</div>
</body>
</html>

Datei anzeigen

@ -1,21 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHPMailer Test</title>
</head>
<body>
<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
<h1>This is a test of PHPMailer.</h1>
<div align="center">
<a href="https://github.com/PHPMailer/PHPMailer/"><img src="images/phpmailer.png" height="90" width="340" alt="PHPMailer rocks"></a>
</div>
<p>This example uses <strong>HTML</strong>.</p>
<p>Chinese text: 郵件內容為空</p>
<p>Russian text: Пустое тело сообщения</p>
<p>Armenian text: Հաղորդագրությունը դատարկ է</p>
<p>Czech text: Prázdné tělo zprávy</p>
<p>Emoji: <span style="font-size: 48px">😂 🦄 💥 📤 📧</span></p>
</div>
</body>
</html>

Datei anzeigen

@ -1,35 +0,0 @@
<?php
/**
* This example shows how to make use of PHPMailer's exceptions for error handling.
*/
require '../PHPMailerAutoload.php';
//Create a new PHPMailer instance
//Passing true to the constructor enables the use of exceptions for error handling
$mail = new PHPMailer(true);
try {
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer Exceptions test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//and convert the HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');
//send the message
//Note that we don't need check the response from this because it will throw an exception if it has trouble
$mail->send();
echo "Message sent!";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}

Datei anzeigen

@ -1,99 +0,0 @@
<?php
/**
* This example shows settings to use when sending via Google's Gmail servers.
* The IMAP section shows how to save this message to the 'Sent Mail' folder using IMAP commands.
*/
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';
// use
// $mail->Host = gethostbyname('smtp.gmail.com');
// if your network does not support SMTP over IPv6
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "username@gmail.com";
//Password to use for SMTP authentication
$mail->Password = "yourpassword";
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer GMail SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
//Section 2: IMAP
//Uncomment these to save your message in the 'Sent Mail' folder.
#if (save_mail($mail)) {
# echo "Message saved!";
#}
}
//Section 2: IMAP
//IMAP commands requires the PHP IMAP Extension, found at: https://php.net/manual/en/imap.setup.php
//Function to call which uses the PHP imap_*() functions to save messages: https://php.net/manual/en/book.imap.php
//You can use imap_getmailboxes($imapStream, '/imap/ssl') to get a list of available folders or labels, this can
//be useful if you are trying to get this working on a non-Gmail IMAP server.
function save_mail($mail) {
//You can change 'Sent Mail' to any other folder or tag
$path = "{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail";
//Tell your server to open an IMAP connection using the same username and password as you used for SMTP
$imapStream = imap_open($path, $mail->Username, $mail->Password);
$result = imap_append($imapStream, $path, $mail->getSentMIMEMessage());
imap_close($imapStream);
return $result;
}

Datei anzeigen

@ -1,85 +0,0 @@
<?php
/**
* This example shows settings to use when sending via Google's Gmail servers.
*/
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
date_default_timezone_set('Etc/UTC');
require '../PHPMailerAutoload.php';
//Load dependencies from composer
//If this causes an error, run 'composer install'
require '../vendor/autoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailerOAuth;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 0;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Set AuthType
$mail->AuthType = 'XOAUTH2';
//User Email to use for SMTP authentication - user who gave consent to our app
$mail->oauthUserEmail = "from@gmail.com";
//Obtained From Google Developer Console
$mail->oauthClientId = "RANDOMCHARS-----duv1n2.apps.googleusercontent.com";
//Obtained From Google Developer Console
$mail->oauthClientSecret = "RANDOMCHARS-----lGyjPcRtvP";
//Obtained By running get_oauth_token.php after setting up APP in Google Developer Console.
//Set Redirect URI in Developer Console as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
// eg: http://localhost/phpmail/get_oauth_token.php
$mail->oauthRefreshToken = "RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0";
//Set who the message is to be sent from
//For gmail, this generally needs to be the same as the user you logged in as
$mail->setFrom('from@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer GMail SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}

Binäre Datei nicht angezeigt.

Vorher

Breite:  |  Höhe:  |  Größe: 5.7 KiB

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen