Compare commits
No commits in common. "master" and "20240206.4" have entirely different histories.
master
...
20240206.4
225
composer.lock
generated
225
composer.lock
generated
|
@ -89,16 +89,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "chillerlan/php-settings-container",
|
"name": "chillerlan/php-settings-container",
|
||||||
"version": "3.2.0",
|
"version": "3.1.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/chillerlan/php-settings-container.git",
|
"url": "https://github.com/chillerlan/php-settings-container.git",
|
||||||
"reference": "8f93648fac8e6bacac8e00a8d325eba4950295e6"
|
"reference": "c41e89f8bf963d1e88584a47fb78d1cd204b6e2a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/8f93648fac8e6bacac8e00a8d325eba4950295e6",
|
"url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/c41e89f8bf963d1e88584a47fb78d1cd204b6e2a",
|
||||||
"reference": "8f93648fac8e6bacac8e00a8d325eba4950295e6",
|
"reference": "c41e89f8bf963d1e88584a47fb78d1cd204b6e2a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -107,9 +107,9 @@
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phan/phan": "^5.4",
|
"phan/phan": "^5.4",
|
||||||
|
"phpcsstandards/php_codesniffer": "^3.8",
|
||||||
"phpmd/phpmd": "^2.15",
|
"phpmd/phpmd": "^2.15",
|
||||||
"phpunit/phpunit": "^10.5",
|
"phpunit/phpunit": "^10.5"
|
||||||
"squizlabs/php_codesniffer": "^3.9"
|
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -150,7 +150,7 @@
|
||||||
"type": "ko_fi"
|
"type": "ko_fi"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-03-02T20:07:15+00:00"
|
"time": "2024-01-05T23:55:20+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/lexer",
|
"name": "doctrine/lexer",
|
||||||
|
@ -352,7 +352,7 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://patchii.net/flash/index.git",
|
"url": "https://patchii.net/flash/index.git",
|
||||||
"reference": "e4c8ed711e045cffe840ba10a239ede14b0b171f"
|
"reference": "73051dc71ee2d0045e5dbe5d846bb665a8b1c39c"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
|
@ -390,7 +390,7 @@
|
||||||
],
|
],
|
||||||
"description": "Composer package for the common library for my projects.",
|
"description": "Composer package for the common library for my projects.",
|
||||||
"homepage": "https://railgun.sh/index",
|
"homepage": "https://railgun.sh/index",
|
||||||
"time": "2024-04-10T23:40:14+00:00"
|
"time": "2024-02-06T23:52:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "flashwave/sasae",
|
"name": "flashwave/sasae",
|
||||||
|
@ -590,16 +590,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "jean85/pretty-package-versions",
|
"name": "jean85/pretty-package-versions",
|
||||||
"version": "2.0.6",
|
"version": "2.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Jean85/pretty-package-versions.git",
|
"url": "https://github.com/Jean85/pretty-package-versions.git",
|
||||||
"reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4"
|
"reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4",
|
"url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af",
|
||||||
"reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4",
|
"reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -607,9 +607,9 @@
|
||||||
"php": "^7.1|^8.0"
|
"php": "^7.1|^8.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"friendsofphp/php-cs-fixer": "^3.2",
|
"friendsofphp/php-cs-fixer": "^2.17",
|
||||||
"jean85/composer-provided-replaced-stub-package": "^1.0",
|
"jean85/composer-provided-replaced-stub-package": "^1.0",
|
||||||
"phpstan/phpstan": "^1.4",
|
"phpstan/phpstan": "^0.12.66",
|
||||||
"phpunit/phpunit": "^7.5|^8.5|^9.4",
|
"phpunit/phpunit": "^7.5|^8.5|^9.4",
|
||||||
"vimeo/psalm": "^4.3"
|
"vimeo/psalm": "^4.3"
|
||||||
},
|
},
|
||||||
|
@ -643,22 +643,22 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/Jean85/pretty-package-versions/issues",
|
"issues": "https://github.com/Jean85/pretty-package-versions/issues",
|
||||||
"source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6"
|
"source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.5"
|
||||||
},
|
},
|
||||||
"time": "2024-03-08T09:58:59+00:00"
|
"time": "2021-10-08T21:21:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "matomo/device-detector",
|
"name": "matomo/device-detector",
|
||||||
"version": "6.3.2",
|
"version": "6.2.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/matomo-org/device-detector.git",
|
"url": "https://github.com/matomo-org/device-detector.git",
|
||||||
"reference": "fd4042cb6a7f3f985a81aedc075dd59e0b991a51"
|
"reference": "19138b0c4b9ddf4ffd8e423d6af3764b7317cb0b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/matomo-org/device-detector/zipball/fd4042cb6a7f3f985a81aedc075dd59e0b991a51",
|
"url": "https://api.github.com/repos/matomo-org/device-detector/zipball/19138b0c4b9ddf4ffd8e423d6af3764b7317cb0b",
|
||||||
"reference": "fd4042cb6a7f3f985a81aedc075dd59e0b991a51",
|
"reference": "19138b0c4b9ddf4ffd8e423d6af3764b7317cb0b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -714,14 +714,14 @@
|
||||||
"source": "https://github.com/matomo-org/matomo",
|
"source": "https://github.com/matomo-org/matomo",
|
||||||
"wiki": "https://dev.matomo.org/"
|
"wiki": "https://dev.matomo.org/"
|
||||||
},
|
},
|
||||||
"time": "2024-05-28T10:16:19+00:00"
|
"time": "2024-01-05T09:03:21+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mustangostang/spyc",
|
"name": "mustangostang/spyc",
|
||||||
"version": "0.6.3",
|
"version": "0.6.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/mustangostang/spyc.git",
|
"url": "git@github.com:mustangostang/spyc.git",
|
||||||
"reference": "4627c838b16550b666d15aeae1e5289dd5b77da0"
|
"reference": "4627c838b16550b666d15aeae1e5289dd5b77da0"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
|
@ -764,10 +764,6 @@
|
||||||
"yaml",
|
"yaml",
|
||||||
"yml"
|
"yml"
|
||||||
],
|
],
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/mustangostang/spyc/issues",
|
|
||||||
"source": "https://github.com/mustangostang/spyc/tree/0.6.3"
|
|
||||||
},
|
|
||||||
"time": "2019-09-10T13:16:29+00:00"
|
"time": "2019-09-10T13:16:29+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -875,20 +871,20 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-factory",
|
"name": "psr/http-factory",
|
||||||
"version": "1.1.0",
|
"version": "1.0.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/php-fig/http-factory.git",
|
"url": "https://github.com/php-fig/http-factory.git",
|
||||||
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
|
"reference": "e616d01114759c4c489f93b099585439f795fe35"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
|
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35",
|
||||||
"reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
|
"reference": "e616d01114759c4c489f93b099585439f795fe35",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1",
|
"php": ">=7.0.0",
|
||||||
"psr/http-message": "^1.0 || ^2.0"
|
"psr/http-message": "^1.0 || ^2.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
|
@ -912,7 +908,7 @@
|
||||||
"homepage": "https://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
|
"description": "Common interfaces for PSR-7 HTTP message factories",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"factory",
|
"factory",
|
||||||
"http",
|
"http",
|
||||||
|
@ -924,9 +920,9 @@
|
||||||
"response"
|
"response"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/php-fig/http-factory"
|
"source": "https://github.com/php-fig/http-factory/tree/1.0.2"
|
||||||
},
|
},
|
||||||
"time": "2024-04-15T12:06:14+00:00"
|
"time": "2023-04-10T20:10:41+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/http-message",
|
"name": "psr/http-message",
|
||||||
|
@ -1132,16 +1128,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sentry/sentry",
|
"name": "sentry/sentry",
|
||||||
"version": "4.7.0",
|
"version": "4.5.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/getsentry/sentry-php.git",
|
"url": "https://github.com/getsentry/sentry-php.git",
|
||||||
"reference": "d6769b2a5e6bf19ed3bbfbf52328ceaf8e6fcb1f"
|
"reference": "a6e06f0b7a17e7f68e11297427da76bfe01a3ca3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/d6769b2a5e6bf19ed3bbfbf52328ceaf8e6fcb1f",
|
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/a6e06f0b7a17e7f68e11297427da76bfe01a3ca3",
|
||||||
"reference": "d6769b2a5e6bf19ed3bbfbf52328ceaf8e6fcb1f",
|
"reference": "a6e06f0b7a17e7f68e11297427da76bfe01a3ca3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1205,7 +1201,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/getsentry/sentry-php/issues",
|
"issues": "https://github.com/getsentry/sentry-php/issues",
|
||||||
"source": "https://github.com/getsentry/sentry-php/tree/4.7.0"
|
"source": "https://github.com/getsentry/sentry-php/tree/4.5.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -1217,20 +1213,20 @@
|
||||||
"type": "custom"
|
"type": "custom"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-04-10T13:22:13+00:00"
|
"time": "2024-01-29T16:16:10+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
"version": "v3.5.0",
|
"version": "v3.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||||
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1"
|
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
|
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||||
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
|
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1239,7 +1235,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "3.5-dev"
|
"dev-main": "3.4-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/contracts",
|
"name": "symfony/contracts",
|
||||||
|
@ -1268,7 +1264,7 @@
|
||||||
"description": "A generic function and convention to trigger deprecation notices",
|
"description": "A generic function and convention to trigger deprecation notices",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0"
|
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -1284,20 +1280,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-04-18T09:32:20+00:00"
|
"time": "2023-05-23T14:45:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/event-dispatcher",
|
"name": "symfony/event-dispatcher",
|
||||||
"version": "v7.0.7",
|
"version": "v7.0.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||||
"reference": "db2a7fab994d67d92356bb39c367db115d9d30f9"
|
"reference": "834c28d533dd0636f910909d01b9ff45cc094b5e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db2a7fab994d67d92356bb39c367db115d9d30f9",
|
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/834c28d533dd0636f910909d01b9ff45cc094b5e",
|
||||||
"reference": "db2a7fab994d67d92356bb39c367db115d9d30f9",
|
"reference": "834c28d533dd0636f910909d01b9ff45cc094b5e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1348,7 +1344,7 @@
|
||||||
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
|
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/event-dispatcher/tree/v7.0.7"
|
"source": "https://github.com/symfony/event-dispatcher/tree/v7.0.3"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -1364,20 +1360,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-04-18T09:29:19+00:00"
|
"time": "2024-01-23T15:02:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/event-dispatcher-contracts",
|
"name": "symfony/event-dispatcher-contracts",
|
||||||
"version": "v3.5.0",
|
"version": "v3.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
|
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
|
||||||
"reference": "8f93aec25d41b72493c6ddff14e916177c9efc50"
|
"reference": "a76aed96a42d2b521153fb382d418e30d18b59df"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50",
|
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df",
|
||||||
"reference": "8f93aec25d41b72493c6ddff14e916177c9efc50",
|
"reference": "a76aed96a42d2b521153fb382d418e30d18b59df",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1387,7 +1383,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "3.5-dev"
|
"dev-main": "3.4-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/contracts",
|
"name": "symfony/contracts",
|
||||||
|
@ -1424,7 +1420,7 @@
|
||||||
"standards"
|
"standards"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0"
|
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -1440,20 +1436,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-04-18T09:32:20+00:00"
|
"time": "2023-05-23T14:45:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/mailer",
|
"name": "symfony/mailer",
|
||||||
"version": "v6.4.7",
|
"version": "v6.4.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/mailer.git",
|
"url": "https://github.com/symfony/mailer.git",
|
||||||
"reference": "2c446d4e446995bed983c0b5bb9ff837e8de7dbd"
|
"reference": "74412c62f88a85a41b61f0b71ab0afcaad6f03ee"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/mailer/zipball/2c446d4e446995bed983c0b5bb9ff837e8de7dbd",
|
"url": "https://api.github.com/repos/symfony/mailer/zipball/74412c62f88a85a41b61f0b71ab0afcaad6f03ee",
|
||||||
"reference": "2c446d4e446995bed983c0b5bb9ff837e8de7dbd",
|
"reference": "74412c62f88a85a41b61f0b71ab0afcaad6f03ee",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1504,7 +1500,7 @@
|
||||||
"description": "Helps sending emails",
|
"description": "Helps sending emails",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/mailer/tree/v6.4.7"
|
"source": "https://github.com/symfony/mailer/tree/v6.4.3"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -1520,20 +1516,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-04-18T09:22:46+00:00"
|
"time": "2024-01-29T15:01:07+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/mime",
|
"name": "symfony/mime",
|
||||||
"version": "v7.0.7",
|
"version": "v7.0.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/mime.git",
|
"url": "https://github.com/symfony/mime.git",
|
||||||
"reference": "3adbf110c306546f6f00337f421d2edca0e8d3c0"
|
"reference": "c1ffe24ba6fdc3e3f0f3fcb93519103b326a3716"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/mime/zipball/3adbf110c306546f6f00337f421d2edca0e8d3c0",
|
"url": "https://api.github.com/repos/symfony/mime/zipball/c1ffe24ba6fdc3e3f0f3fcb93519103b326a3716",
|
||||||
"reference": "3adbf110c306546f6f00337f421d2edca0e8d3c0",
|
"reference": "c1ffe24ba6fdc3e3f0f3fcb93519103b326a3716",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1553,7 +1549,6 @@
|
||||||
"league/html-to-markdown": "^5.0",
|
"league/html-to-markdown": "^5.0",
|
||||||
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
|
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
|
||||||
"symfony/dependency-injection": "^6.4|^7.0",
|
"symfony/dependency-injection": "^6.4|^7.0",
|
||||||
"symfony/process": "^6.4|^7.0",
|
|
||||||
"symfony/property-access": "^6.4|^7.0",
|
"symfony/property-access": "^6.4|^7.0",
|
||||||
"symfony/property-info": "^6.4|^7.0",
|
"symfony/property-info": "^6.4|^7.0",
|
||||||
"symfony/serializer": "^6.4|^7.0"
|
"symfony/serializer": "^6.4|^7.0"
|
||||||
|
@ -1588,7 +1583,7 @@
|
||||||
"mime-type"
|
"mime-type"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/mime/tree/v7.0.7"
|
"source": "https://github.com/symfony/mime/tree/v7.0.3"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -1604,20 +1599,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-04-18T09:29:19+00:00"
|
"time": "2024-01-30T08:34:29+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/options-resolver",
|
"name": "symfony/options-resolver",
|
||||||
"version": "v7.0.7",
|
"version": "v7.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/options-resolver.git",
|
"url": "https://github.com/symfony/options-resolver.git",
|
||||||
"reference": "23cc173858776ad451e31f053b1c9f47840b2cfa"
|
"reference": "700ff4096e346f54cb628ea650767c8130f1001f"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/23cc173858776ad451e31f053b1c9f47840b2cfa",
|
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f",
|
||||||
"reference": "23cc173858776ad451e31f053b1c9f47840b2cfa",
|
"reference": "700ff4096e346f54cb628ea650767c8130f1001f",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1655,7 +1650,7 @@
|
||||||
"options"
|
"options"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/options-resolver/tree/v7.0.7"
|
"source": "https://github.com/symfony/options-resolver/tree/v7.0.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -1671,7 +1666,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-04-18T09:29:19+00:00"
|
"time": "2023-08-08T10:20:21+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
|
@ -2152,22 +2147,21 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/service-contracts",
|
"name": "symfony/service-contracts",
|
||||||
"version": "v3.5.0",
|
"version": "v3.4.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/service-contracts.git",
|
"url": "https://github.com/symfony/service-contracts.git",
|
||||||
"reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f"
|
"reference": "fe07cbc8d837f60caf7018068e350cc5163681a0"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f",
|
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0",
|
||||||
"reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f",
|
"reference": "fe07cbc8d837f60caf7018068e350cc5163681a0",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1",
|
"php": ">=8.1",
|
||||||
"psr/container": "^1.1|^2.0",
|
"psr/container": "^1.1|^2.0"
|
||||||
"symfony/deprecation-contracts": "^2.5|^3"
|
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"ext-psr": "<1.1|>=2"
|
"ext-psr": "<1.1|>=2"
|
||||||
|
@ -2175,7 +2169,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "3.5-dev"
|
"dev-main": "3.4-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/contracts",
|
"name": "symfony/contracts",
|
||||||
|
@ -2215,7 +2209,7 @@
|
||||||
"standards"
|
"standards"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/service-contracts/tree/v3.5.0"
|
"source": "https://github.com/symfony/service-contracts/tree/v3.4.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -2231,26 +2225,25 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-04-18T09:32:20+00:00"
|
"time": "2023-12-26T14:02:43+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "twig/html-extra",
|
"name": "twig/html-extra",
|
||||||
"version": "v3.10.0",
|
"version": "v3.8.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/twigphp/html-extra.git",
|
"url": "https://github.com/twigphp/html-extra.git",
|
||||||
"reference": "1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda"
|
"reference": "c04603bb3b71d8d2ece9e583dbf7bd77811df1f2"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/twigphp/html-extra/zipball/1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda",
|
"url": "https://api.github.com/repos/twigphp/html-extra/zipball/c04603bb3b71d8d2ece9e583dbf7bd77811df1f2",
|
||||||
"reference": "1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda",
|
"reference": "c04603bb3b71d8d2ece9e583dbf7bd77811df1f2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2.5",
|
"php": ">=7.2.5",
|
||||||
"symfony/deprecation-contracts": "^2.5|^3",
|
"symfony/mime": "^5.4|^6.0|^7.0",
|
||||||
"symfony/mime": "^5.4|^6.4|^7.0",
|
|
||||||
"twig/twig": "^3.0"
|
"twig/twig": "^3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
|
@ -2258,9 +2251,6 @@
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
|
||||||
"Resources/functions.php"
|
|
||||||
],
|
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Twig\\Extra\\Html\\": ""
|
"Twig\\Extra\\Html\\": ""
|
||||||
},
|
},
|
||||||
|
@ -2287,7 +2277,7 @@
|
||||||
"twig"
|
"twig"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/twigphp/html-extra/tree/v3.10.0"
|
"source": "https://github.com/twigphp/html-extra/tree/v3.8.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -2299,41 +2289,34 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-05-11T07:35:57+00:00"
|
"time": "2023-11-21T14:02:01+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "twig/twig",
|
"name": "twig/twig",
|
||||||
"version": "v3.10.3",
|
"version": "v3.8.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/twigphp/Twig.git",
|
"url": "https://github.com/twigphp/Twig.git",
|
||||||
"reference": "67f29781ffafa520b0bbfbd8384674b42db04572"
|
"reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/67f29781ffafa520b0bbfbd8384674b42db04572",
|
"url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
|
||||||
"reference": "67f29781ffafa520b0bbfbd8384674b42db04572",
|
"reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2.5",
|
"php": ">=7.2.5",
|
||||||
"symfony/deprecation-contracts": "^2.5|^3",
|
|
||||||
"symfony/polyfill-ctype": "^1.8",
|
"symfony/polyfill-ctype": "^1.8",
|
||||||
"symfony/polyfill-mbstring": "^1.3",
|
"symfony/polyfill-mbstring": "^1.3",
|
||||||
"symfony/polyfill-php80": "^1.22"
|
"symfony/polyfill-php80": "^1.22"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"psr/container": "^1.0|^2.0",
|
"psr/container": "^1.0|^2.0",
|
||||||
"symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0"
|
"symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
|
||||||
"src/Resources/core.php",
|
|
||||||
"src/Resources/debug.php",
|
|
||||||
"src/Resources/escaper.php",
|
|
||||||
"src/Resources/string_loader.php"
|
|
||||||
],
|
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Twig\\": "src/"
|
"Twig\\": "src/"
|
||||||
}
|
}
|
||||||
|
@ -2366,7 +2349,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/twigphp/Twig/issues",
|
"issues": "https://github.com/twigphp/Twig/issues",
|
||||||
"source": "https://github.com/twigphp/Twig/tree/v3.10.3"
|
"source": "https://github.com/twigphp/Twig/tree/v3.8.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -2378,22 +2361,22 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-05-16T10:04:27+00:00"
|
"time": "2023-11-21T18:54:41+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan",
|
"name": "phpstan/phpstan",
|
||||||
"version": "1.11.2",
|
"version": "1.10.57",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan.git",
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
"reference": "0d5d4294a70deb7547db655c47685d680e39cfec"
|
"reference": "1627b1d03446904aaa77593f370c5201d2ecc34e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec",
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e",
|
||||||
"reference": "0d5d4294a70deb7547db655c47685d680e39cfec",
|
"reference": "1627b1d03446904aaa77593f370c5201d2ecc34e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -2436,9 +2419,13 @@
|
||||||
{
|
{
|
||||||
"url": "https://github.com/phpstan",
|
"url": "https://github.com/phpstan",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
|
||||||
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-05-24T13:23:04+00:00"
|
"time": "2024-01-24T11:51:34+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
<?php
|
|
||||||
use Index\Data\IDbConnection;
|
|
||||||
use Index\Data\Migration\IDbMigration;
|
|
||||||
|
|
||||||
final class BaseSixtyFourEncodePmsInDb_20240602_194809 implements IDbMigration {
|
|
||||||
public function migrate(IDbConnection $conn): void {
|
|
||||||
$conn->execute('UPDATE msz_messages SET msg_title = TO_BASE64(msg_title), msg_body = TO_BASE64(msg_body)');
|
|
||||||
$conn->execute('
|
|
||||||
ALTER TABLE `msz_messages`
|
|
||||||
CHANGE COLUMN `msg_title` `msg_title` TINYBLOB NOT NULL AFTER `msg_reply_to`,
|
|
||||||
CHANGE COLUMN `msg_body` `msg_body` BLOB NOT NULL AFTER `msg_title`;
|
|
||||||
');
|
|
||||||
}
|
|
||||||
}
|
|
593
package-lock.json
generated
593
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@swc/core": "^1.5.24",
|
"@swc/core": "^1.3.69",
|
||||||
"autoprefixer": "^10.4.19",
|
"autoprefixer": "^10.4.14",
|
||||||
"cssnano": "^6.1.2",
|
"cssnano": "^6.0.1",
|
||||||
"postcss": "^8.4.38"
|
"postcss": "^8.4.26"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -291,11 +291,7 @@ $postInfos = $forumPosts->getPosts(
|
||||||
if(empty($postInfos))
|
if(empty($postInfos))
|
||||||
Template::throwError(404);
|
Template::throwError(404);
|
||||||
|
|
||||||
try {
|
$originalPostInfo = $forumPosts->getPost(topicInfo: $topicInfo);
|
||||||
$originalPostInfo = $forumPosts->getPost(topicInfo: $topicInfo);
|
|
||||||
} catch(RuntimeException $ex) {
|
|
||||||
Template::throwError(404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$posts = [];
|
$posts = [];
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ if($isEditing) {
|
||||||
if(!$perms->edit_profile) {
|
if(!$perms->edit_profile) {
|
||||||
$notices[] = 'You\'re not allowed to edit your profile';
|
$notices[] = 'You\'re not allowed to edit your profile';
|
||||||
} else {
|
} else {
|
||||||
$profileFieldInfos = iterator_to_array($profileFields->getFields());
|
$profileFieldInfos = $profileFields->getFields();
|
||||||
$profileFieldsSetInfos = [];
|
$profileFieldsSetInfos = [];
|
||||||
$profileFieldsSetValues = [];
|
$profileFieldsSetValues = [];
|
||||||
$profileFieldsRemove = [];
|
$profileFieldsRemove = [];
|
||||||
|
@ -323,9 +323,9 @@ if(!$viewingAsGuest) {
|
||||||
);
|
);
|
||||||
$activeTopicInfo = $activeTopicStats->success ? $forumTopics->getTopic(topicId: $activeTopicStats->topicId) : null;
|
$activeTopicInfo = $activeTopicStats->success ? $forumTopics->getTopic(topicId: $activeTopicStats->topicId) : null;
|
||||||
|
|
||||||
$profileFieldValues = iterator_to_array($profileFields->getFieldValues($userInfo));
|
$profileFieldValues = $profileFields->getFieldValues($userInfo);
|
||||||
$profileFieldInfos = $profileFieldInfos ?? iterator_to_array($profileFields->getFields(fieldValueInfos: $isEditing ? null : $profileFieldValues));
|
$profileFieldInfos = $profileFieldInfos ?? $profileFields->getFields(fieldValueInfos: $isEditing ? null : $profileFieldValues);
|
||||||
$profileFieldFormats = iterator_to_array($profileFields->getFieldFormats(fieldValueInfos: $profileFieldValues));
|
$profileFieldFormats = $profileFields->getFieldFormats(fieldValueInfos: $profileFieldValues);
|
||||||
|
|
||||||
$profileFieldRawValues = [];
|
$profileFieldRawValues = [];
|
||||||
$profileFieldLinkValues = [];
|
$profileFieldLinkValues = [];
|
||||||
|
|
|
@ -3,12 +3,20 @@ namespace Misuzu\Changelog;
|
||||||
|
|
||||||
use ErrorException;
|
use ErrorException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
use Index\Routing\Route;
|
||||||
use Misuzu\{Pagination,SiteInfo,Template};
|
use Index\Routing\RouteHandler;
|
||||||
|
use Misuzu\Pagination;
|
||||||
|
use Misuzu\SiteInfo;
|
||||||
|
use Misuzu\Template;
|
||||||
use Misuzu\Auth\AuthInfo;
|
use Misuzu\Auth\AuthInfo;
|
||||||
use Misuzu\Comments\{Comments,CommentsEx};
|
use Misuzu\Comments\Comments;
|
||||||
use Misuzu\Feeds\{Feed,FeedItem,AtomFeedSerializer,RssFeedSerializer};
|
use Misuzu\Comments\CommentsEx;
|
||||||
use Misuzu\URLs\{URLInfo,URLRegistry};
|
use Misuzu\Feeds\Feed;
|
||||||
|
use Misuzu\Feeds\FeedItem;
|
||||||
|
use Misuzu\Feeds\AtomFeedSerializer;
|
||||||
|
use Misuzu\Feeds\RssFeedSerializer;
|
||||||
|
use Misuzu\URLs\URLInfo;
|
||||||
|
use Misuzu\URLs\URLRegistry;
|
||||||
use Misuzu\Users\UsersContext;
|
use Misuzu\Users\UsersContext;
|
||||||
|
|
||||||
final class ChangelogRoutes extends RouteHandler {
|
final class ChangelogRoutes extends RouteHandler {
|
||||||
|
@ -26,7 +34,7 @@ final class ChangelogRoutes extends RouteHandler {
|
||||||
return $comments->getCommentsForLayout($categoryName);
|
return $comments->getCommentsForLayout($categoryName);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/changelog')]
|
#[Route('GET', '/changelog')]
|
||||||
#[URLInfo('changelog-index', '/changelog', ['date' => '<date>', 'user' => '<user>', 'tags' => '<tags>', 'p' => '<page>'])]
|
#[URLInfo('changelog-index', '/changelog', ['date' => '<date>', 'user' => '<user>', 'tags' => '<tags>', 'p' => '<page>'])]
|
||||||
public function getIndex($response, $request) {
|
public function getIndex($response, $request) {
|
||||||
$filterDate = (string)$request->getParam('date');
|
$filterDate = (string)$request->getParam('date');
|
||||||
|
@ -95,7 +103,7 @@ final class ChangelogRoutes extends RouteHandler {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/changelog/change/([0-9]+)')]
|
#[Route('GET', '/changelog/change/:id')]
|
||||||
#[URLInfo('changelog-change', '/changelog/change/<change>')]
|
#[URLInfo('changelog-change', '/changelog/change/<change>')]
|
||||||
#[URLInfo('changelog-change-comments', '/changelog/change/<change>', fragment: 'comments')]
|
#[URLInfo('changelog-change-comments', '/changelog/change/<change>', fragment: 'comments')]
|
||||||
public function getChange($response, $request, string $changeId) {
|
public function getChange($response, $request, string $changeId) {
|
||||||
|
@ -144,14 +152,14 @@ final class ChangelogRoutes extends RouteHandler {
|
||||||
return $feed;
|
return $feed;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/changelog.rss')]
|
#[Route('GET', '/changelog.rss')]
|
||||||
#[URLInfo('changelog-feed-rss', '/changelog.rss')]
|
#[URLInfo('changelog-feed-rss', '/changelog.rss')]
|
||||||
public function getFeedRSS($response) {
|
public function getFeedRSS($response) {
|
||||||
$response->setContentType('application/rss+xml; charset=utf-8');
|
$response->setContentType('application/rss+xml; charset=utf-8');
|
||||||
return (new RssFeedSerializer)->serializeFeed($this->createFeed('rss'));
|
return (new RssFeedSerializer)->serializeFeed($this->createFeed('rss'));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/changelog.atom')]
|
#[Route('GET', '/changelog.atom')]
|
||||||
#[URLInfo('changelog-feed-atom', '/changelog.atom')]
|
#[URLInfo('changelog-feed-atom', '/changelog.atom')]
|
||||||
public function getFeedAtom($response) {
|
public function getFeedAtom($response) {
|
||||||
$response->setContentType('application/atom+xml; charset=utf-8');
|
$response->setContentType('application/atom+xml; charset=utf-8');
|
||||||
|
|
|
@ -12,9 +12,11 @@ use Misuzu\Pagination;
|
||||||
use Misuzu\Users\UserInfo;
|
use Misuzu\Users\UserInfo;
|
||||||
|
|
||||||
class ForumCategories {
|
class ForumCategories {
|
||||||
|
private IDbConnection $dbConn;
|
||||||
private DbStatementCache $cache;
|
private DbStatementCache $cache;
|
||||||
|
|
||||||
public function __construct(IDbConnection $dbConn) {
|
public function __construct(IDbConnection $dbConn) {
|
||||||
|
$this->dbConn = $dbConn;
|
||||||
$this->cache = new DbStatementCache($dbConn);
|
$this->cache = new DbStatementCache($dbConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,14 @@ namespace Misuzu\Home;
|
||||||
|
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\DateTime;
|
use Index\DateTime;
|
||||||
use Index\Data\{DbTools,IDbConnection};
|
use Index\Data\DbTools;
|
||||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
use Index\Data\IDbConnection;
|
||||||
|
use Index\Routing\Route;
|
||||||
|
use Index\Routing\RouteHandler;
|
||||||
use Syokuhou\IConfig;
|
use Syokuhou\IConfig;
|
||||||
use Misuzu\{Pagination,SiteInfo,Template};
|
use Misuzu\Pagination;
|
||||||
|
use Misuzu\SiteInfo;
|
||||||
|
use Misuzu\Template;
|
||||||
use Misuzu\Auth\AuthInfo;
|
use Misuzu\Auth\AuthInfo;
|
||||||
use Misuzu\Changelog\Changelog;
|
use Misuzu\Changelog\Changelog;
|
||||||
use Misuzu\Comments\Comments;
|
use Misuzu\Comments\Comments;
|
||||||
|
@ -150,7 +154,7 @@ class HomeRoutes extends RouteHandler {
|
||||||
return $topics;
|
return $topics;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/')]
|
#[Route('GET', '/')]
|
||||||
#[URLInfo('index', '/')]
|
#[URLInfo('index', '/')]
|
||||||
public function getIndex(...$args) {
|
public function getIndex(...$args) {
|
||||||
return $this->authInfo->isLoggedIn()
|
return $this->authInfo->isLoggedIn()
|
||||||
|
@ -197,7 +201,7 @@ class HomeRoutes extends RouteHandler {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/_landing')]
|
#[Route('GET', '/_landing')]
|
||||||
public function getLanding($response, $request) {
|
public function getLanding($response, $request) {
|
||||||
$config = $this->config->getValues([
|
$config = $this->config->getValues([
|
||||||
['social.embed_linked:b'],
|
['social.embed_linked:b'],
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Misuzu\Info;
|
namespace Misuzu\Info;
|
||||||
|
|
||||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
use Index\Routing\Route;
|
||||||
|
use Index\Routing\RouteHandler;
|
||||||
use Misuzu\Template;
|
use Misuzu\Template;
|
||||||
use Misuzu\Parsers\Parser;
|
use Misuzu\Parsers\Parser;
|
||||||
use Misuzu\URLs\URLInfo;
|
use Misuzu\URLs\URLInfo;
|
||||||
|
@ -17,16 +18,23 @@ class InfoRoutes extends RouteHandler {
|
||||||
'index' => 'Index Project » %s',
|
'index' => 'Index Project » %s',
|
||||||
];
|
];
|
||||||
|
|
||||||
#[HttpGet('/info')]
|
private static function checkName(string $name): bool {
|
||||||
|
return preg_match('#^([A-Za-z0-9_]+)$#', $name) === 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('GET', '/info')]
|
||||||
#[URLInfo('info-index', '/info')]
|
#[URLInfo('info-index', '/info')]
|
||||||
public function getIndex() {
|
public function getIndex() {
|
||||||
return Template::renderRaw('info.index');
|
return Template::renderRaw('info.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/info/([A-Za-z0-9_]+)')]
|
#[Route('GET', '/info/:name')]
|
||||||
#[URLInfo('info', '/info/<title>')]
|
#[URLInfo('info', '/info/<title>')]
|
||||||
#[URLInfo('info-doc', '/info/<title>')]
|
#[URLInfo('info-doc', '/info/<title>')]
|
||||||
public function getDocsPage($response, $request, string $name) {
|
public function getDocsPage($response, $request, string $name) {
|
||||||
|
if(!self::checkName($name))
|
||||||
|
return 404;
|
||||||
|
|
||||||
return $this->serveMarkdownDocument(
|
return $this->serveMarkdownDocument(
|
||||||
sprintf('%s/%s.md', self::DOCS_PATH, $name)
|
sprintf('%s/%s.md', self::DOCS_PATH, $name)
|
||||||
);
|
);
|
||||||
|
@ -70,11 +78,13 @@ class InfoRoutes extends RouteHandler {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/info/([A-Za-z0-9_]+)/([A-Za-z0-9_]+)')]
|
#[Route('GET', '/info/:project/:name')]
|
||||||
#[URLInfo('info-project-doc', '/info/<project>/<title>')]
|
#[URLInfo('info-project-doc', '/info/<project>/<title>')]
|
||||||
public function getProjectPage($response, $request, string $project, string $name) {
|
public function getProjectPage($response, $request, string $project, string $name) {
|
||||||
if(!array_key_exists($project, self::PROJECT_PATHS))
|
if(!array_key_exists($project, self::PROJECT_PATHS))
|
||||||
return 404;
|
return 404;
|
||||||
|
if(!self::checkName($name))
|
||||||
|
return 404;
|
||||||
|
|
||||||
$projectPath = self::PROJECT_PATHS[$project];
|
$projectPath = self::PROJECT_PATHS[$project];
|
||||||
$titleSuffix = array_key_exists($project, self::PROJECT_SUFFIXES) ? self::PROJECT_SUFFIXES[$project] : '';
|
$titleSuffix = array_key_exists($project, self::PROJECT_SUFFIXES) ? self::PROJECT_SUFFIXES[$project] : '';
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Misuzu;
|
namespace Misuzu;
|
||||||
|
|
||||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
use Index\Routing\Route;
|
||||||
use Misuzu\URLs\{IURLSource,URLInfo,URLRegistry};
|
use Index\Routing\RouteHandler;
|
||||||
|
use Misuzu\URLs\IURLSource;
|
||||||
|
use Misuzu\URLs\URLInfo;
|
||||||
|
use Misuzu\URLs\URLRegistry;
|
||||||
|
|
||||||
class LegacyRoutes extends RouteHandler implements IURLSource {
|
class LegacyRoutes extends RouteHandler implements IURLSource {
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
@ -121,27 +124,27 @@ class LegacyRoutes extends RouteHandler implements IURLSource {
|
||||||
$urls->register('manage-role', '/manage/users/role.php', ['r' => '<role>']);
|
$urls->register('manage-role', '/manage/users/role.php', ['r' => '<role>']);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/index.php')]
|
#[Route('GET', '/index.php')]
|
||||||
public function getIndexPHP($response): void {
|
public function getIndexPHP($response): void {
|
||||||
$response->redirect($this->urls->format('index'), true);
|
$response->redirect($this->urls->format('index'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/info.php')]
|
#[Route('GET', '/info.php')]
|
||||||
public function getInfoPHP($response): void {
|
public function getInfoPHP($response): void {
|
||||||
$response->redirect($this->urls->format('info'), true);
|
$response->redirect($this->urls->format('info'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/info.php/([A-Za-z0-9_]+)')]
|
#[Route('GET', '/info.php/:name')]
|
||||||
public function getInfoDocsPHP($response, $request, string $name): void {
|
public function getInfoDocsPHP($response, $request, string $name): void {
|
||||||
$response->redirect($this->urls->format('info', ['title' => $name]), true);
|
$response->redirect($this->urls->format('info', ['title' => $name]), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/info.php/([A-Za-z0-9_]+)/([A-Za-z0-9_]+)')]
|
#[Route('GET', '/info.php/:project/:name')]
|
||||||
public function getInfoProjectPHP($response, $request, string $project, string $name): void {
|
public function getInfoProjectPHP($response, $request, string $project, string $name): void {
|
||||||
$response->redirect($this->urls->format('info', ['title' => $project . '/' . $name]), true);
|
$response->redirect($this->urls->format('info', ['title' => $project . '/' . $name]), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news.php')]
|
#[Route('GET', '/news.php')]
|
||||||
public function getNewsPHP($response, $request): void {
|
public function getNewsPHP($response, $request): void {
|
||||||
$postId = (int)($request->getParam('n', FILTER_SANITIZE_NUMBER_INT) ?? $request->getParam('p', FILTER_SANITIZE_NUMBER_INT));
|
$postId = (int)($request->getParam('n', FILTER_SANITIZE_NUMBER_INT) ?? $request->getParam('p', FILTER_SANITIZE_NUMBER_INT));
|
||||||
|
|
||||||
|
@ -156,28 +159,28 @@ class LegacyRoutes extends RouteHandler implements IURLSource {
|
||||||
$response->redirect($location, true);
|
$response->redirect($location, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news.php/rss')]
|
#[Route('GET', '/news.php/rss')]
|
||||||
public function getNewsRssPHP($response, $request): void {
|
public function getNewsRssPHP($response, $request): void {
|
||||||
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
||||||
$location = $this->urls->format($catId > 0 ? 'news-category-feed-rss' : 'news-feed-rss', ['category' => $catId]);
|
$location = $this->urls->format($catId > 0 ? 'news-category-feed-rss' : 'news-feed-rss', ['category' => $catId]);
|
||||||
$response->redirect($location, true);
|
$response->redirect($location, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news.php/atom')]
|
#[Route('GET', '/news.php/atom')]
|
||||||
public function getNewsAtomPHP($response, $request): void {
|
public function getNewsAtomPHP($response, $request): void {
|
||||||
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
||||||
$location = $this->urls->format($catId > 0 ? 'news-category-feed-atom' : 'news-feed-atom', ['category' => $catId]);
|
$location = $this->urls->format($catId > 0 ? 'news-category-feed-atom' : 'news-feed-atom', ['category' => $catId]);
|
||||||
$response->redirect($location, true);
|
$response->redirect($location, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news/index.php')]
|
#[Route('GET', '/news/index.php')]
|
||||||
public function getNewsIndexPHP($response, $request): void {
|
public function getNewsIndexPHP($response, $request): void {
|
||||||
$response->redirect($this->urls->format('news-index', [
|
$response->redirect($this->urls->format('news-index', [
|
||||||
'page' => $request->getParam('page', FILTER_SANITIZE_NUMBER_INT),
|
'page' => $request->getParam('page', FILTER_SANITIZE_NUMBER_INT),
|
||||||
]), true);
|
]), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news/category.php')]
|
#[Route('GET', '/news/category.php')]
|
||||||
public function getNewsCategoryPHP($response, $request): void {
|
public function getNewsCategoryPHP($response, $request): void {
|
||||||
$response->redirect($this->urls->format('news-category', [
|
$response->redirect($this->urls->format('news-category', [
|
||||||
'category' => $request->getParam('c', FILTER_SANITIZE_NUMBER_INT),
|
'category' => $request->getParam('c', FILTER_SANITIZE_NUMBER_INT),
|
||||||
|
@ -185,19 +188,19 @@ class LegacyRoutes extends RouteHandler implements IURLSource {
|
||||||
]), true);
|
]), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news/post.php')]
|
#[Route('GET', '/news/post.php')]
|
||||||
public function getNewsPostPHP($response, $request): void {
|
public function getNewsPostPHP($response, $request): void {
|
||||||
$response->redirect($this->urls->format('news-post', [
|
$response->redirect($this->urls->format('news-post', [
|
||||||
'post' => $request->getParam('p', FILTER_SANITIZE_NUMBER_INT),
|
'post' => $request->getParam('p', FILTER_SANITIZE_NUMBER_INT),
|
||||||
]), true);
|
]), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news/feed.php')]
|
#[Route('GET', '/news/feed.php')]
|
||||||
public function getNewsFeedPHP($response, $request): int {
|
public function getNewsFeedPHP($response, $request): int {
|
||||||
return 400;
|
return 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news/feed.php/rss')]
|
#[Route('GET', '/news/feed.php/rss')]
|
||||||
public function getNewsFeedRssPHP($response, $request): void {
|
public function getNewsFeedRssPHP($response, $request): void {
|
||||||
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
||||||
$response->redirect($this->urls->format(
|
$response->redirect($this->urls->format(
|
||||||
|
@ -206,7 +209,7 @@ class LegacyRoutes extends RouteHandler implements IURLSource {
|
||||||
), true);
|
), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news/feed.php/atom')]
|
#[Route('GET', '/news/feed.php/atom')]
|
||||||
public function getNewsFeedAtomPHP($response, $request): void {
|
public function getNewsFeedAtomPHP($response, $request): void {
|
||||||
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
$catId = (int)$request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
||||||
$response->redirect($this->urls->format(
|
$response->redirect($this->urls->format(
|
||||||
|
@ -215,7 +218,7 @@ class LegacyRoutes extends RouteHandler implements IURLSource {
|
||||||
), true);
|
), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/changelog.php')]
|
#[Route('GET', '/changelog.php')]
|
||||||
public function getChangelogPHP($response, $request): void {
|
public function getChangelogPHP($response, $request): void {
|
||||||
$changeId = $request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
$changeId = $request->getParam('c', FILTER_SANITIZE_NUMBER_INT);
|
||||||
if($changeId) {
|
if($changeId) {
|
||||||
|
@ -229,7 +232,7 @@ class LegacyRoutes extends RouteHandler implements IURLSource {
|
||||||
]), true);
|
]), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/auth.php')]
|
#[Route('GET', '/auth.php')]
|
||||||
public function getAuthPHP($response, $request): void {
|
public function getAuthPHP($response, $request): void {
|
||||||
$response->redirect($this->urls->format(match($request->getParam('m')) {
|
$response->redirect($this->urls->format(match($request->getParam('m')) {
|
||||||
'logout' => 'auth-logout',
|
'logout' => 'auth-logout',
|
||||||
|
@ -240,44 +243,44 @@ class LegacyRoutes extends RouteHandler implements IURLSource {
|
||||||
}), true);
|
}), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/auth')]
|
#[Route('GET', '/auth')]
|
||||||
#[HttpGet('/auth/index.php')]
|
#[Route('GET', '/auth/index.php')]
|
||||||
public function getAuthIndexPHP($response, $request): void {
|
public function getAuthIndexPHP($response, $request): void {
|
||||||
$response->redirect($this->urls->format('auth-login'), true);
|
$response->redirect($this->urls->format('auth-login'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/settings.php')]
|
#[Route('GET', '/settings.php')]
|
||||||
public function getSettingsPHP($response): void {
|
public function getSettingsPHP($response): void {
|
||||||
$response->redirect($this->urls->format('settings-index'), true);
|
$response->redirect($this->urls->format('settings-index'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/settings')]
|
#[Route('GET', '/settings')]
|
||||||
public function getSettingsIndex($response): void {
|
public function getSettingsIndex($response): void {
|
||||||
$response->redirect($this->urls->format('settings-account'));
|
$response->redirect($this->urls->format('settings-account'));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/settings/index.php')]
|
#[Route('GET', '/settings/index.php')]
|
||||||
public function getSettingsIndexPHP($response): void {
|
public function getSettingsIndexPHP($response): void {
|
||||||
$response->redirect($this->urls->format('settings-account'), true);
|
$response->redirect($this->urls->format('settings-account'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/manage')]
|
#[Route('GET', '/manage')]
|
||||||
#[URLInfo('manage-index', '/manage')]
|
#[URLInfo('manage-index', '/manage')]
|
||||||
public function getManageIndex($response): void {
|
public function getManageIndex($response): void {
|
||||||
$response->redirect($this->urls->format('manage-general-overview'));
|
$response->redirect($this->urls->format('manage-general-overview'));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/manage/index.php')]
|
#[Route('GET', '/manage/index.php')]
|
||||||
public function getManageIndexPHP($response): void {
|
public function getManageIndexPHP($response): void {
|
||||||
$response->redirect($this->urls->format('manage-general-overview'), true);
|
$response->redirect($this->urls->format('manage-general-overview'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/manage/news')]
|
#[Route('GET', '/manage/news')]
|
||||||
public function getManageNewsIndex($response): void {
|
public function getManageNewsIndex($response): void {
|
||||||
$response->redirect($this->urls->format('manage-news-categories'));
|
$response->redirect($this->urls->format('manage-news-categories'));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/manage/news/index.php')]
|
#[Route('GET', '/manage/news/index.php')]
|
||||||
public function getManageNewsIndexPHP($response): void {
|
public function getManageNewsIndexPHP($response): void {
|
||||||
$response->redirect($this->urls->format('manage-news-categories'), true);
|
$response->redirect($this->urls->format('manage-news-categories'), true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ use Misuzu\Users\UserInfo;
|
||||||
class MessagesDatabase {
|
class MessagesDatabase {
|
||||||
private DbStatementCache $cache;
|
private DbStatementCache $cache;
|
||||||
|
|
||||||
public function __construct(IDbConnection $dbConn) {
|
public function __construct(private IDbConnection $dbConn) {
|
||||||
$this->cache = new DbStatementCache($dbConn);
|
$this->cache = new DbStatementCache($dbConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class MessagesDatabase {
|
||||||
$hasPagination = $pagination !== null;
|
$hasPagination = $pagination !== null;
|
||||||
|
|
||||||
$args = 0;
|
$args = 0;
|
||||||
$query = 'SELECT msg_id, msg_owner_id, msg_author_id, msg_recipient_id, msg_reply_to, FROM_BASE64(msg_title), FROM_BASE64(msg_body), msg_parser, UNIX_TIMESTAMP(msg_created), UNIX_TIMESTAMP(msg_sent), UNIX_TIMESTAMP(msg_read), UNIX_TIMESTAMP(msg_deleted) FROM msz_messages';
|
$query = 'SELECT msg_id, msg_owner_id, msg_author_id, msg_recipient_id, msg_reply_to, msg_title, msg_body, msg_parser, UNIX_TIMESTAMP(msg_created), UNIX_TIMESTAMP(msg_sent), UNIX_TIMESTAMP(msg_read), UNIX_TIMESTAMP(msg_deleted) FROM msz_messages';
|
||||||
if($hasOwnerInfo) {
|
if($hasOwnerInfo) {
|
||||||
++$args;
|
++$args;
|
||||||
$query .= ' WHERE msg_owner_id = ?';
|
$query .= ' WHERE msg_owner_id = ?';
|
||||||
|
@ -162,7 +162,7 @@ class MessagesDatabase {
|
||||||
bool $useReplyTo = false
|
bool $useReplyTo = false
|
||||||
): MessageInfo {
|
): MessageInfo {
|
||||||
$stmt = $this->cache->get(sprintf(
|
$stmt = $this->cache->get(sprintf(
|
||||||
'SELECT msg_id, msg_owner_id, msg_author_id, msg_recipient_id, msg_reply_to, FROM_BASE64(msg_title), FROM_BASE64(msg_body), msg_parser, UNIX_TIMESTAMP(msg_created), UNIX_TIMESTAMP(msg_sent), UNIX_TIMESTAMP(msg_read), UNIX_TIMESTAMP(msg_deleted) FROM msz_messages WHERE msg_id = %s AND msg_owner_id = ?',
|
'SELECT msg_id, msg_owner_id, msg_author_id, msg_recipient_id, msg_reply_to, msg_title, msg_body, msg_parser, UNIX_TIMESTAMP(msg_created), UNIX_TIMESTAMP(msg_sent), UNIX_TIMESTAMP(msg_read), UNIX_TIMESTAMP(msg_deleted) FROM msz_messages WHERE msg_id = %s AND msg_owner_id = ?',
|
||||||
!$useReplyTo || $messageInfoOrId instanceof MessageInfo ? '?' : '(SELECT msg_reply_to FROM msz_messages WHERE msg_id = ?)'
|
!$useReplyTo || $messageInfoOrId instanceof MessageInfo ? '?' : '(SELECT msg_reply_to FROM msz_messages WHERE msg_id = ?)'
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ class MessagesDatabase {
|
||||||
DateTime|int|null $sentAt = null,
|
DateTime|int|null $sentAt = null,
|
||||||
DateTime|int|null $readAt = null
|
DateTime|int|null $readAt = null
|
||||||
): MessageInfo {
|
): MessageInfo {
|
||||||
$stmt = $this->cache->get('INSERT INTO msz_messages (msg_id, msg_owner_id, msg_author_id, msg_recipient_id, msg_reply_to, msg_title, msg_body, msg_parser, msg_sent, msg_read) VALUES (?, ?, ?, ?, ?, TO_BASE64(?), TO_BASE64(?), ?, FROM_UNIXTIME(?), FROM_UNIXTIME(?))');
|
$stmt = $this->cache->get('INSERT INTO msz_messages (msg_id, msg_owner_id, msg_author_id, msg_recipient_id, msg_reply_to, msg_title, msg_body, msg_parser, msg_sent, msg_read) VALUES (?, ?, ?, ?, ?, ?, ?, ?, FROM_UNIXTIME(?), FROM_UNIXTIME(?))');
|
||||||
$stmt->addParameter(1, $messageId);
|
$stmt->addParameter(1, $messageId);
|
||||||
$stmt->addParameter(2, $ownerInfo instanceof UserInfo ? $ownerInfo->getId() : $ownerInfo);
|
$stmt->addParameter(2, $ownerInfo instanceof UserInfo ? $ownerInfo->getId() : $ownerInfo);
|
||||||
$stmt->addParameter(3, $authorInfo instanceof UserInfo ? $authorInfo->getId() : $authorInfo);
|
$stmt->addParameter(3, $authorInfo instanceof UserInfo ? $authorInfo->getId() : $authorInfo);
|
||||||
|
@ -233,12 +233,12 @@ class MessagesDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($title !== null) {
|
if($title !== null) {
|
||||||
$setQuery[] = 'msg_title = TO_BASE64(?)';
|
$setQuery[] = 'msg_title = ?';
|
||||||
$setValues[] = $title;
|
$setValues[] = $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($body !== null) {
|
if($body !== null) {
|
||||||
$setQuery[] = 'msg_body = TO_BASE64(?)';
|
$setQuery[] = 'msg_body = ?';
|
||||||
$setValues[] = $body;
|
$setValues[] = $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use stdClass;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\XString;
|
use Index\XString;
|
||||||
use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler};
|
use Index\Routing\{Route,RouteHandler};
|
||||||
use Syokuhou\IConfig;
|
use Syokuhou\IConfig;
|
||||||
use Misuzu\{CSRF,Pagination,Perm,Template};
|
use Misuzu\{CSRF,Pagination,Perm,Template};
|
||||||
use Misuzu\Auth\AuthInfo;
|
use Misuzu\Auth\AuthInfo;
|
||||||
|
@ -33,16 +33,12 @@ class MessagesRoutes extends RouteHandler {
|
||||||
|
|
||||||
private bool $canSendMessages;
|
private bool $canSendMessages;
|
||||||
|
|
||||||
#[HttpMiddleware('/messages')]
|
#[Route('/messages')]
|
||||||
public function checkAccess($response, $request) {
|
public function checkAccess($response, $request) {
|
||||||
// should probably be a permission or something too
|
// should probably be a permission or something too
|
||||||
if(!$this->authInfo->isLoggedIn())
|
if(!$this->authInfo->isLoggedIn())
|
||||||
return 401;
|
return 401;
|
||||||
|
|
||||||
// do not allow access to PMs when impersonating in production mode
|
|
||||||
if(!MSZ_DEBUG && $this->authInfo->isImpersonating())
|
|
||||||
return 403;
|
|
||||||
|
|
||||||
$globalPerms = $this->authInfo->getPerms('global');
|
$globalPerms = $this->authInfo->getPerms('global');
|
||||||
if(!$globalPerms->check(Perm::G_MESSAGES_VIEW))
|
if(!$globalPerms->check(Perm::G_MESSAGES_VIEW))
|
||||||
return 403;
|
return 403;
|
||||||
|
@ -76,7 +72,7 @@ class MessagesRoutes extends RouteHandler {
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/messages')]
|
#[Route('GET', '/messages')]
|
||||||
#[URLInfo('messages-index', '/messages', ['folder' => '<folder>', 'page' => '<page>'])]
|
#[URLInfo('messages-index', '/messages', ['folder' => '<folder>', 'page' => '<page>'])]
|
||||||
public function getIndex($response, $request, string $folderName = '') {
|
public function getIndex($response, $request, string $folderName = '') {
|
||||||
$folderName = (string)$request->getParam('folder');
|
$folderName = (string)$request->getParam('folder');
|
||||||
|
@ -129,7 +125,7 @@ class MessagesRoutes extends RouteHandler {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/messages/stats')]
|
#[Route('GET', '/messages/stats')]
|
||||||
#[URLInfo('messages-stats', '/messages/stats')]
|
#[URLInfo('messages-stats', '/messages/stats')]
|
||||||
public function getStats() {
|
public function getStats() {
|
||||||
$selfInfo = $this->authInfo->getUserInfo();
|
$selfInfo = $this->authInfo->getUserInfo();
|
||||||
|
@ -146,7 +142,7 @@ class MessagesRoutes extends RouteHandler {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/messages/recipient')]
|
#[Route('POST', '/messages/recipient')]
|
||||||
#[URLInfo('messages-recipient', '/messages/recipient')]
|
#[URLInfo('messages-recipient', '/messages/recipient')]
|
||||||
public function postRecipient($response, $request) {
|
public function postRecipient($response, $request) {
|
||||||
if(!$request->isFormContent())
|
if(!$request->isFormContent())
|
||||||
|
@ -186,7 +182,7 @@ class MessagesRoutes extends RouteHandler {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/messages/compose')]
|
#[Route('GET', '/messages/compose')]
|
||||||
#[URLInfo('messages-compose', '/messages/compose', ['recipient' => '<recipient>'])]
|
#[URLInfo('messages-compose', '/messages/compose', ['recipient' => '<recipient>'])]
|
||||||
public function getEditor($response, $request) {
|
public function getEditor($response, $request) {
|
||||||
if(!$this->canSendMessages)
|
if(!$this->canSendMessages)
|
||||||
|
@ -197,7 +193,7 @@ class MessagesRoutes extends RouteHandler {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/messages/([A-Za-z0-9]+)')]
|
#[Route('GET', '/messages/:message')]
|
||||||
#[URLInfo('messages-view', '/messages/<message>')]
|
#[URLInfo('messages-view', '/messages/<message>')]
|
||||||
public function getView($response, $request, string $messageId) {
|
public function getView($response, $request, string $messageId) {
|
||||||
if(strlen($messageId) !== 8)
|
if(strlen($messageId) !== 8)
|
||||||
|
@ -327,7 +323,7 @@ class MessagesRoutes extends RouteHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/messages/create')]
|
#[Route('POST', '/messages/create')]
|
||||||
#[URLInfo('messages-create', '/messages/create')]
|
#[URLInfo('messages-create', '/messages/create')]
|
||||||
public function postCreate($response, $request) {
|
public function postCreate($response, $request) {
|
||||||
if(!$request->isFormContent())
|
if(!$request->isFormContent())
|
||||||
|
@ -431,7 +427,7 @@ class MessagesRoutes extends RouteHandler {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/messages/([A-Za-z0-9]+)')]
|
#[Route('POST', '/messages/:message')]
|
||||||
#[URLInfo('messages-update', '/messages/<message>')]
|
#[URLInfo('messages-update', '/messages/<message>')]
|
||||||
public function postUpdate($response, $request, string $messageId) {
|
public function postUpdate($response, $request, string $messageId) {
|
||||||
if(!$request->isFormContent())
|
if(!$request->isFormContent())
|
||||||
|
@ -522,7 +518,7 @@ class MessagesRoutes extends RouteHandler {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/messages/mark')]
|
#[Route('POST', '/messages/mark')]
|
||||||
#[URLInfo('messages-mark', '/messages/mark')]
|
#[URLInfo('messages-mark', '/messages/mark')]
|
||||||
public function postMark($response, $request) {
|
public function postMark($response, $request) {
|
||||||
if(!$request->isFormContent())
|
if(!$request->isFormContent())
|
||||||
|
@ -553,16 +549,16 @@ class MessagesRoutes extends RouteHandler {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/messages/delete')]
|
#[Route('POST', '/messages/delete')]
|
||||||
#[URLInfo('messages-delete', '/messages/delete')]
|
#[URLInfo('messages-delete', '/messages/delete')]
|
||||||
public function postDelete($response, $request) {
|
public function postDelete($response, $request) {
|
||||||
if(!$request->isFormContent())
|
if(!$request->isFormContent())
|
||||||
return 400;
|
return 400;
|
||||||
|
|
||||||
$content = $request->getContent();
|
$content = $request->getContent();
|
||||||
|
$messages = explode(',', (string)$content->getParam('messages'));
|
||||||
|
|
||||||
$messages = (string)$content->getParam('messages');
|
if(empty($messages))
|
||||||
if($messages === '')
|
|
||||||
return [
|
return [
|
||||||
'error' => [
|
'error' => [
|
||||||
'name' => 'msgs:empty',
|
'name' => 'msgs:empty',
|
||||||
|
@ -570,8 +566,6 @@ class MessagesRoutes extends RouteHandler {
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$messages = explode(',', $messages);
|
|
||||||
|
|
||||||
$this->msgsCtx->getDatabase()->deleteMessages(
|
$this->msgsCtx->getDatabase()->deleteMessages(
|
||||||
$this->authInfo->getUserInfo(),
|
$this->authInfo->getUserInfo(),
|
||||||
$messages
|
$messages
|
||||||
|
@ -580,16 +574,16 @@ class MessagesRoutes extends RouteHandler {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/messages/restore')]
|
#[Route('POST', '/messages/restore')]
|
||||||
#[URLInfo('messages-restore', '/messages/restore')]
|
#[URLInfo('messages-restore', '/messages/restore')]
|
||||||
public function postRestore($response, $request) {
|
public function postRestore($response, $request) {
|
||||||
if(!$request->isFormContent())
|
if(!$request->isFormContent())
|
||||||
return 400;
|
return 400;
|
||||||
|
|
||||||
$content = $request->getContent();
|
$content = $request->getContent();
|
||||||
|
$messages = explode(',', (string)$content->getParam('messages'));
|
||||||
|
|
||||||
$messages = (string)$content->getParam('messages');
|
if(empty($messages))
|
||||||
if($messages === '')
|
|
||||||
return [
|
return [
|
||||||
'error' => [
|
'error' => [
|
||||||
'name' => 'msgs:empty',
|
'name' => 'msgs:empty',
|
||||||
|
@ -597,8 +591,6 @@ class MessagesRoutes extends RouteHandler {
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$messages = explode(',', $messages);
|
|
||||||
|
|
||||||
$this->msgsCtx->getDatabase()->restoreMessages(
|
$this->msgsCtx->getDatabase()->restoreMessages(
|
||||||
$this->authInfo->getUserInfo(),
|
$this->authInfo->getUserInfo(),
|
||||||
$messages
|
$messages
|
||||||
|
@ -607,16 +599,16 @@ class MessagesRoutes extends RouteHandler {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/messages/nuke')]
|
#[Route('POST', '/messages/nuke')]
|
||||||
#[URLInfo('messages-nuke', '/messages/nuke')]
|
#[URLInfo('messages-nuke', '/messages/nuke')]
|
||||||
public function postNuke($response, $request) {
|
public function postNuke($response, $request) {
|
||||||
if(!$request->isFormContent())
|
if(!$request->isFormContent())
|
||||||
return 400;
|
return 400;
|
||||||
|
|
||||||
$content = $request->getContent();
|
$content = $request->getContent();
|
||||||
|
$messages = explode(',', (string)$content->getParam('messages'));
|
||||||
|
|
||||||
$messages = (string)$content->getParam('messages');
|
if(empty($messages))
|
||||||
if($messages === '')
|
|
||||||
return [
|
return [
|
||||||
'error' => [
|
'error' => [
|
||||||
'name' => 'msgs:empty',
|
'name' => 'msgs:empty',
|
||||||
|
@ -624,8 +616,6 @@ class MessagesRoutes extends RouteHandler {
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$messages = explode(',', $messages);
|
|
||||||
|
|
||||||
$this->msgsCtx->getDatabase()->nukeMessages(
|
$this->msgsCtx->getDatabase()->nukeMessages(
|
||||||
$this->authInfo->getUserInfo(),
|
$this->authInfo->getUserInfo(),
|
||||||
$messages
|
$messages
|
||||||
|
|
|
@ -212,6 +212,7 @@ class MisuzuContext {
|
||||||
$routingCtx = new RoutingContext();
|
$routingCtx = new RoutingContext();
|
||||||
|
|
||||||
$this->urls = $routingCtx->getURLs();
|
$this->urls = $routingCtx->getURLs();
|
||||||
|
$routingCtx->registerDefaultErrorPages();
|
||||||
|
|
||||||
$routingCtx->register(new \Misuzu\Home\HomeRoutes(
|
$routingCtx->register(new \Misuzu\Home\HomeRoutes(
|
||||||
$this->config,
|
$this->config,
|
||||||
|
@ -262,7 +263,6 @@ class MisuzuContext {
|
||||||
|
|
||||||
$routingCtx->register(new \Misuzu\SharpChat\SharpChatRoutes(
|
$routingCtx->register(new \Misuzu\SharpChat\SharpChatRoutes(
|
||||||
$this->config->scopeTo('sockChat'),
|
$this->config->scopeTo('sockChat'),
|
||||||
$this->config->scopeTo('impersonate'),
|
|
||||||
$this->urls,
|
$this->urls,
|
||||||
$this->usersCtx,
|
$this->usersCtx,
|
||||||
$this->authCtx,
|
$this->authCtx,
|
||||||
|
|
|
@ -3,14 +3,24 @@ namespace Misuzu\News;
|
||||||
|
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\DateTime;
|
use Index\DateTime;
|
||||||
use Index\Data\{DbTools,IDbConnection};
|
use Index\Data\DbTools;
|
||||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
use Index\Data\IDbConnection;
|
||||||
use Misuzu\{Pagination,SiteInfo,Template};
|
use Index\Routing\Route;
|
||||||
|
use Index\Routing\RouteHandler;
|
||||||
|
use Misuzu\Pagination;
|
||||||
|
use Misuzu\SiteInfo;
|
||||||
|
use Misuzu\Template;
|
||||||
use Misuzu\Auth\AuthInfo;
|
use Misuzu\Auth\AuthInfo;
|
||||||
use Misuzu\Comments\{Comments,CommentsCategory,CommentsEx};
|
use Misuzu\Comments\Comments;
|
||||||
use Misuzu\Feeds\{Feed,FeedItem,AtomFeedSerializer,RssFeedSerializer};
|
use Misuzu\Comments\CommentsCategory;
|
||||||
|
use Misuzu\Comments\CommentsEx;
|
||||||
|
use Misuzu\Feeds\Feed;
|
||||||
|
use Misuzu\Feeds\FeedItem;
|
||||||
|
use Misuzu\Feeds\AtomFeedSerializer;
|
||||||
|
use Misuzu\Feeds\RssFeedSerializer;
|
||||||
use Misuzu\Parsers\Parser;
|
use Misuzu\Parsers\Parser;
|
||||||
use Misuzu\URLs\{URLInfo,URLRegistry};
|
use Misuzu\URLs\URLInfo;
|
||||||
|
use Misuzu\URLs\URLRegistry;
|
||||||
use Misuzu\Users\UsersContext;
|
use Misuzu\Users\UsersContext;
|
||||||
|
|
||||||
class NewsRoutes extends RouteHandler {
|
class NewsRoutes extends RouteHandler {
|
||||||
|
@ -81,7 +91,7 @@ class NewsRoutes extends RouteHandler {
|
||||||
return $posts;
|
return $posts;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news')]
|
#[Route('GET', '/news')]
|
||||||
#[URLInfo('news-index', '/news', ['p' => '<page>'])]
|
#[URLInfo('news-index', '/news', ['p' => '<page>'])]
|
||||||
public function getIndex() {
|
public function getIndex() {
|
||||||
$categories = $this->news->getCategories(hidden: false);
|
$categories = $this->news->getCategories(hidden: false);
|
||||||
|
@ -99,21 +109,24 @@ class NewsRoutes extends RouteHandler {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news.rss')]
|
#[Route('GET', '/news.rss')]
|
||||||
#[URLInfo('news-feed-rss', '/news.rss')]
|
#[URLInfo('news-feed-rss', '/news.rss')]
|
||||||
public function getFeedRss($response) {
|
public function getFeedRss($response) {
|
||||||
return $this->getFeed($response, 'rss');
|
return $this->getFeed($response, 'rss');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news.atom')]
|
#[Route('GET', '/news.atom')]
|
||||||
#[URLInfo('news-feed-atom', '/news.atom')]
|
#[URLInfo('news-feed-atom', '/news.atom')]
|
||||||
public function getFeedAtom($response) {
|
public function getFeedAtom($response) {
|
||||||
return $this->getFeed($response, 'atom');
|
return $this->getFeed($response, 'atom');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news/([0-9]+)(?:\.(rss|atom))?')]
|
#[Route('GET', '/news/:category')]
|
||||||
#[URLInfo('news-category', '/news/<category>', ['p' => '<page>'])]
|
#[URLInfo('news-category', '/news/<category>', ['p' => '<page>'])]
|
||||||
public function getCategory($response, $request, string $categoryId, string $type = '') {
|
public function getCategory($response, $request, string $fileName) {
|
||||||
|
$categoryId = pathinfo($fileName, PATHINFO_FILENAME);
|
||||||
|
$type = pathinfo($fileName, PATHINFO_EXTENSION);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$categoryInfo = $this->news->getCategory(categoryId: $categoryId);
|
$categoryInfo = $this->news->getCategory(categoryId: $categoryId);
|
||||||
} catch(RuntimeException $ex) {
|
} catch(RuntimeException $ex) {
|
||||||
|
@ -150,7 +163,7 @@ class NewsRoutes extends RouteHandler {
|
||||||
return $this->getFeed($response, 'atom', $categoryInfo);
|
return $this->getFeed($response, 'atom', $categoryInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/news/post/([0-9]+)')]
|
#[Route('GET', '/news/post/:id')]
|
||||||
#[URLInfo('news-post', '/news/post/<post>')]
|
#[URLInfo('news-post', '/news/post/<post>')]
|
||||||
#[URLInfo('news-post-comments', '/news/post/<post>', fragment: 'comments')]
|
#[URLInfo('news-post-comments', '/news/post/<post>', fragment: 'comments')]
|
||||||
public function getPost($response, $request, string $postId) {
|
public function getPost($response, $request, string $postId) {
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Misuzu;
|
namespace Misuzu;
|
||||||
|
|
||||||
use Index\Http\Routing\{HttpRouter,IRouter,IRouteHandler};
|
use Index\Http\HttpFx;
|
||||||
use Misuzu\URLs\{IURLSource,URLInfo,URLRegistry};
|
use Index\Http\HttpRequest;
|
||||||
|
use Index\Routing\IRouter;
|
||||||
|
use Index\Routing\IRouteHandler;
|
||||||
|
use Misuzu\URLs\IURLSource;
|
||||||
|
use Misuzu\URLs\URLInfo;
|
||||||
|
use Misuzu\URLs\URLRegistry;
|
||||||
|
|
||||||
class RoutingContext {
|
class RoutingContext {
|
||||||
private URLRegistry $urls;
|
private URLRegistry $urls;
|
||||||
private HttpRouter $router;
|
private HttpFx $router;
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->urls = new URLRegistry;
|
$this->urls = new URLRegistry;
|
||||||
$this->router = new HttpRouter(errorHandler: new RoutingErrorHandler);
|
$this->router = new HttpFx;
|
||||||
$this->router->use('/', fn($resp) => $resp->setPoweredBy('Misuzu'));
|
$this->router->use('/', fn($resp) => $resp->setPoweredBy('Misuzu'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +27,25 @@ class RoutingContext {
|
||||||
return $this->router;
|
return $this->router;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function registerDefaultErrorPages(): void {
|
||||||
|
$this->router->addErrorHandler(400, fn($resp) => $resp->setContent(Template::renderRaw('errors.400')));
|
||||||
|
$this->router->addErrorHandler(403, fn($resp) => $resp->setContent(Template::renderRaw('errors.403')));
|
||||||
|
$this->router->addErrorHandler(404, fn($resp) => $resp->setContent(Template::renderRaw('errors.404')));
|
||||||
|
$this->router->addErrorHandler(500, fn($resp) => $resp->setContent(file_get_contents(MSZ_TEMPLATES . '/500.html')));
|
||||||
|
$this->router->addErrorHandler(503, fn($resp) => $resp->setContent(file_get_contents(MSZ_TEMPLATES . '/503.html')));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function registerSimpleErrorPages(IRouter $router, string $path): void {
|
||||||
|
if($router instanceof HttpFx)
|
||||||
|
$router->use($path, function() use($router) {
|
||||||
|
$router->addErrorHandler(400, fn($resp) => $resp->setContent('HTTP 400'));
|
||||||
|
$router->addErrorHandler(403, fn($resp) => $resp->setContent('HTTP 403'));
|
||||||
|
$router->addErrorHandler(404, fn($resp) => $resp->setContent('HTTP 404'));
|
||||||
|
$router->addErrorHandler(500, fn($resp) => $resp->setContent('HTTP 500'));
|
||||||
|
$router->addErrorHandler(503, fn($resp) => $resp->setContent('HTTP 503'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public function register(IRouteHandler|IURLSource $handler): void {
|
public function register(IRouteHandler|IURLSource $handler): void {
|
||||||
if($handler instanceof IRouteHandler)
|
if($handler instanceof IRouteHandler)
|
||||||
$this->router->register($handler);
|
$this->router->register($handler);
|
||||||
|
@ -30,7 +54,7 @@ class RoutingContext {
|
||||||
URLInfo::handleAttributes($this->urls, $handler);
|
URLInfo::handleAttributes($this->urls, $handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dispatch(...$args): void {
|
public function dispatch(?HttpRequest $request = null): void {
|
||||||
$this->router->dispatch(...$args);
|
$this->router->dispatch($request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?php
|
|
||||||
namespace Misuzu;
|
|
||||||
|
|
||||||
use Index\Http\{HttpResponseBuilder,HttpRequest};
|
|
||||||
use Index\Http\ErrorHandling\HtmlErrorHandler;
|
|
||||||
|
|
||||||
class RoutingErrorHandler extends HtmlErrorHandler {
|
|
||||||
public function handle(HttpResponseBuilder $response, HttpRequest $request, int $code, string $message): void {
|
|
||||||
if(str_starts_with($request->getPath(), '/_')) {
|
|
||||||
$response->setTypePlain();
|
|
||||||
$response->setContent(sprintf('HTTP %03d', $code));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($code === 500 || $code === 503) {
|
|
||||||
$response->setTypeHTML();
|
|
||||||
$response->setContent(file_get_contents(sprintf('%s/%03d.html', MSZ_TEMPLATES, $code)));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($code === 401 || $code === 403 || $code === 404) {
|
|
||||||
$response->setTypeHTML();
|
|
||||||
$response->setContent(Template::renderRaw(sprintf('errors.%03d', $code)));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::handle($response, $request, $code, $message);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,7 +3,9 @@ namespace Misuzu\Satori;
|
||||||
|
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\Colour\Colour;
|
use Index\Colour\Colour;
|
||||||
use Index\Http\Routing\{HttpGet,HttpMiddleware,RouteHandler};
|
use Index\Routing\IRouter;
|
||||||
|
use Index\Routing\IRouteHandler;
|
||||||
|
use Index\Routing\Route;
|
||||||
use Syokuhou\IConfig;
|
use Syokuhou\IConfig;
|
||||||
use Misuzu\Pagination;
|
use Misuzu\Pagination;
|
||||||
use Misuzu\RoutingContext;
|
use Misuzu\RoutingContext;
|
||||||
|
@ -11,7 +13,7 @@ use Misuzu\Forum\ForumContext;
|
||||||
use Misuzu\Profile\ProfileFields;
|
use Misuzu\Profile\ProfileFields;
|
||||||
use Misuzu\Users\UsersContext;
|
use Misuzu\Users\UsersContext;
|
||||||
|
|
||||||
final class SatoriRoutes extends RouteHandler {
|
final class SatoriRoutes implements IRouteHandler {
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private IConfig $config,
|
private IConfig $config,
|
||||||
private UsersContext $usersCtx,
|
private UsersContext $usersCtx,
|
||||||
|
@ -19,7 +21,12 @@ final class SatoriRoutes extends RouteHandler {
|
||||||
private ProfileFields $profileFields
|
private ProfileFields $profileFields
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
#[HttpMiddleware('/_satori')]
|
public function registerRoutes(IRouter $router): void {
|
||||||
|
RoutingContext::registerSimpleErrorPages($router, '/_satori');
|
||||||
|
Route::handleAttributes($router, $this);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/_satori')]
|
||||||
public function verifyRequest($response, $request) {
|
public function verifyRequest($response, $request) {
|
||||||
$secretKey = $this->config->getString('secret');
|
$secretKey = $this->config->getString('secret');
|
||||||
|
|
||||||
|
@ -39,7 +46,7 @@ final class SatoriRoutes extends RouteHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/_satori/get-profile-field')]
|
#[Route('GET', '/_satori/get-profile-field')]
|
||||||
public function getProfileField($response, $request): array {
|
public function getProfileField($response, $request): array {
|
||||||
$userId = (string)$request->getParam('user', FILTER_SANITIZE_NUMBER_INT);
|
$userId = (string)$request->getParam('user', FILTER_SANITIZE_NUMBER_INT);
|
||||||
$fieldId = (string)$request->getParam('field', FILTER_SANITIZE_NUMBER_INT);
|
$fieldId = (string)$request->getParam('field', FILTER_SANITIZE_NUMBER_INT);
|
||||||
|
@ -55,7 +62,7 @@ final class SatoriRoutes extends RouteHandler {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/_satori/get-recent-forum-posts')]
|
#[Route('GET', '/_satori/get-recent-forum-posts')]
|
||||||
public function getRecentForumPosts($response, $request): array {
|
public function getRecentForumPosts($response, $request): array {
|
||||||
$categoryIds = $this->config->getArray('forum.categories');
|
$categoryIds = $this->config->getArray('forum.categories');
|
||||||
if(empty($categoryIds))
|
if(empty($categoryIds))
|
||||||
|
@ -97,7 +104,7 @@ final class SatoriRoutes extends RouteHandler {
|
||||||
return $posts;
|
return $posts;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/_satori/get-recent-registrations')]
|
#[Route('GET', '/_satori/get-recent-registrations')]
|
||||||
public function getRecentRegistrations($response, $request) {
|
public function getRecentRegistrations($response, $request) {
|
||||||
$batchSize = $this->config->getInteger('users.batch', 10);
|
$batchSize = $this->config->getInteger('users.batch', 10);
|
||||||
$backlogDays = $this->config->getInteger('users.backlog', 7);
|
$backlogDays = $this->config->getInteger('users.backlog', 7);
|
||||||
|
|
|
@ -3,21 +3,25 @@ namespace Misuzu\SharpChat;
|
||||||
|
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\Colour\Colour;
|
use Index\Colour\Colour;
|
||||||
use Index\Http\Routing\{HandlerAttribute,HttpDelete,HttpGet,HttpOptions,HttpPost,RouteHandler};
|
use Index\Routing\IRouter;
|
||||||
|
use Index\Routing\IRouteHandler;
|
||||||
|
use Index\Routing\Route;
|
||||||
use Syokuhou\IConfig;
|
use Syokuhou\IConfig;
|
||||||
use Misuzu\RoutingContext;
|
use Misuzu\RoutingContext;
|
||||||
use Misuzu\Auth\{AuthContext,AuthInfo,Sessions};
|
use Misuzu\Auth\AuthContext;
|
||||||
|
use Misuzu\Auth\AuthInfo;
|
||||||
|
use Misuzu\Auth\Sessions;
|
||||||
use Misuzu\Emoticons\Emotes;
|
use Misuzu\Emoticons\Emotes;
|
||||||
use Misuzu\Perms\Permissions;
|
use Misuzu\Perms\Permissions;
|
||||||
use Misuzu\URLs\URLRegistry;
|
use Misuzu\URLs\URLRegistry;
|
||||||
use Misuzu\Users\{Bans,UsersContext,UserInfo};
|
use Misuzu\Users\Bans;
|
||||||
|
use Misuzu\Users\UsersContext;
|
||||||
|
|
||||||
final class SharpChatRoutes extends RouteHandler {
|
final class SharpChatRoutes implements IRouteHandler {
|
||||||
private string $hashKey;
|
private string $hashKey;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private IConfig $config,
|
private IConfig $config,
|
||||||
private IConfig $impersonateConfig, // this sucks lol
|
|
||||||
private URLRegistry $urls,
|
private URLRegistry $urls,
|
||||||
private UsersContext $usersCtx,
|
private UsersContext $usersCtx,
|
||||||
private AuthContext $authCtx,
|
private AuthContext $authCtx,
|
||||||
|
@ -28,8 +32,13 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
$this->hashKey = $this->config->getString('hashKey', 'woomy');
|
$this->hashKey = $this->config->getString('hashKey', 'woomy');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpOptions('/_sockchat/emotes')]
|
public function registerRoutes(IRouter $router): void {
|
||||||
#[HttpGet('/_sockchat/emotes')]
|
RoutingContext::registerSimpleErrorPages($router, '/_sockchat');
|
||||||
|
Route::handleAttributes($router, $this);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('OPTIONS', '/_sockchat/emotes')]
|
||||||
|
#[Route('GET', '/_sockchat/emotes')]
|
||||||
public function getEmotes($response, $request): array|int {
|
public function getEmotes($response, $request): array|int {
|
||||||
$response->setHeader('Access-Control-Allow-Origin', '*');
|
$response->setHeader('Access-Control-Allow-Origin', '*');
|
||||||
$response->setHeader('Access-Control-Allow-Methods', 'GET');
|
$response->setHeader('Access-Control-Allow-Methods', 'GET');
|
||||||
|
@ -57,7 +66,7 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/_sockchat/login')]
|
#[Route('GET', '/_sockchat/login')]
|
||||||
public function getLogin($response, $request) {
|
public function getLogin($response, $request) {
|
||||||
if(!$this->authInfo->isLoggedIn()) {
|
if(!$this->authInfo->isLoggedIn()) {
|
||||||
$response->redirect($this->urls->format('auth-login'));
|
$response->redirect($this->urls->format('auth-login'));
|
||||||
|
@ -70,16 +79,8 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function canImpersonateUserId(UserInfo $impersonator, string $targetId): bool {
|
#[Route('OPTIONS', '/_sockchat/token')]
|
||||||
if($impersonator->isSuperUser())
|
#[Route('GET', '/_sockchat/token')]
|
||||||
return true;
|
|
||||||
|
|
||||||
$whitelist = $this->impersonateConfig->getArray(sprintf('allow.u%s', $impersonator->getId()));
|
|
||||||
return in_array($targetId, $whitelist, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[HttpOptions('/_sockchat/token')]
|
|
||||||
#[HttpGet('/_sockchat/token')]
|
|
||||||
public function getToken($response, $request) {
|
public function getToken($response, $request) {
|
||||||
$host = $request->hasHeader('Host') ? $request->getHeaderFirstLine('Host') : '';
|
$host = $request->hasHeader('Host') ? $request->getHeaderFirstLine('Host') : '';
|
||||||
$origin = $request->hasHeader('Origin') ? $request->getHeaderFirstLine('Origin') : '';
|
$origin = $request->hasHeader('Origin') ? $request->getHeaderFirstLine('Origin') : '';
|
||||||
|
@ -120,7 +121,7 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
return ['ok' => false, 'err' => 'user'];
|
return ['ok' => false, 'err' => 'user'];
|
||||||
|
|
||||||
$userInfo = $this->usersCtx->getUsers()->getUser($sessionInfo->getUserId(), 'id');
|
$userInfo = $this->usersCtx->getUsers()->getUser($sessionInfo->getUserId(), 'id');
|
||||||
$userId = $tokenInfo->hasImpersonatedUserId() && $this->canImpersonateUserId($userInfo, $tokenInfo->getImpersonatedUserId())
|
$userId = $tokenInfo->hasImpersonatedUserId() && $userInfo->isSuperUser()
|
||||||
? $tokenInfo->getImpersonatedUserId()
|
? $tokenInfo->getImpersonatedUserId()
|
||||||
: $userInfo->getId();
|
: $userInfo->getId();
|
||||||
|
|
||||||
|
@ -133,7 +134,7 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/_sockchat/bump')]
|
#[Route('POST', '/_sockchat/bump')]
|
||||||
public function postBump($response, $request) {
|
public function postBump($response, $request) {
|
||||||
if(!$request->hasHeader('X-SharpChat-Signature'))
|
if(!$request->hasHeader('X-SharpChat-Signature'))
|
||||||
return 400;
|
return 400;
|
||||||
|
@ -163,7 +164,7 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
$this->usersCtx->getUsers()->recordUserActivity($userId, remoteAddr: $ipAddr);
|
$this->usersCtx->getUsers()->recordUserActivity($userId, remoteAddr: $ipAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/_sockchat/verify')]
|
#[Route('POST', '/_sockchat/verify')]
|
||||||
public function postVerify($response, $request) {
|
public function postVerify($response, $request) {
|
||||||
if(!$request->hasHeader('X-SharpChat-Signature'))
|
if(!$request->hasHeader('X-SharpChat-Signature'))
|
||||||
return 400;
|
return 400;
|
||||||
|
@ -214,7 +215,7 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
$this->authCtx->getSessions()->recordSessionActivity(sessionInfo: $sessionInfo, remoteAddr: $ipAddress);
|
$this->authCtx->getSessions()->recordSessionActivity(sessionInfo: $sessionInfo, remoteAddr: $ipAddress);
|
||||||
|
|
||||||
$userInfo = $this->usersCtx->getUsers()->getUser($sessionInfo->getUserId(), 'id');
|
$userInfo = $this->usersCtx->getUsers()->getUser($sessionInfo->getUserId(), 'id');
|
||||||
if($tokenInfo->hasImpersonatedUserId() && $this->canImpersonateUserId($userInfo, $tokenInfo->getImpersonatedUserId())) {
|
if($tokenInfo->hasImpersonatedUserId() && $userInfo->isSuperUser()) {
|
||||||
$userInfoReal = $userInfo;
|
$userInfoReal = $userInfo;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -244,7 +245,7 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/_sockchat/bans/list')]
|
#[Route('GET', '/_sockchat/bans/list')]
|
||||||
public function getBanList($response, $request) {
|
public function getBanList($response, $request) {
|
||||||
if(!$request->hasHeader('X-SharpChat-Signature'))
|
if(!$request->hasHeader('X-SharpChat-Signature'))
|
||||||
return 400;
|
return 400;
|
||||||
|
@ -279,7 +280,7 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/_sockchat/bans/check')]
|
#[Route('GET', '/_sockchat/bans/check')]
|
||||||
public function getBanCheck($response, $request) {
|
public function getBanCheck($response, $request) {
|
||||||
if(!$request->hasHeader('X-SharpChat-Signature'))
|
if(!$request->hasHeader('X-SharpChat-Signature'))
|
||||||
return 400;
|
return 400;
|
||||||
|
@ -317,7 +318,7 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpPost('/_sockchat/bans/create')]
|
#[Route('POST', '/_sockchat/bans/create')]
|
||||||
public function postBanCreate($response, $request): int {
|
public function postBanCreate($response, $request): int {
|
||||||
if(!$request->hasHeader('X-SharpChat-Signature') || !$request->isFormContent())
|
if(!$request->hasHeader('X-SharpChat-Signature') || !$request->isFormContent())
|
||||||
return 400;
|
return 400;
|
||||||
|
@ -391,7 +392,7 @@ final class SharpChatRoutes extends RouteHandler {
|
||||||
return 201;
|
return 201;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpDelete('/_sockchat/bans/revoke')]
|
#[Route('DELETE', '/_sockchat/bans/revoke')]
|
||||||
public function deleteBanRevoke($response, $request): int {
|
public function deleteBanRevoke($response, $request): int {
|
||||||
if(!$request->hasHeader('X-SharpChat-Signature'))
|
if(!$request->hasHeader('X-SharpChat-Signature'))
|
||||||
return 400;
|
return 400;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Misuzu;
|
namespace Misuzu;
|
||||||
|
|
||||||
|
use Index\Routing\IRouter;
|
||||||
|
use Index\Http\HttpFx;
|
||||||
|
|
||||||
final class Tools {
|
final class Tools {
|
||||||
public static function isLocalURL(
|
public static function isLocalURL(
|
||||||
string $url,
|
string $url,
|
||||||
|
|
|
@ -3,11 +3,14 @@ namespace Misuzu\Users\Assets;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
use Index\Routing\Route;
|
||||||
|
use Index\Routing\RouteHandler;
|
||||||
use Misuzu\Perm;
|
use Misuzu\Perm;
|
||||||
use Misuzu\Auth\AuthInfo;
|
use Misuzu\Auth\AuthInfo;
|
||||||
use Misuzu\URLs\{URLInfo,URLRegistry};
|
use Misuzu\URLs\URLInfo;
|
||||||
use Misuzu\Users\{UsersContext,UserInfo};
|
use Misuzu\URLs\URLRegistry;
|
||||||
|
use Misuzu\Users\UsersContext;
|
||||||
|
use Misuzu\Users\UserInfo;
|
||||||
|
|
||||||
class AssetsRoutes extends RouteHandler {
|
class AssetsRoutes extends RouteHandler {
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
@ -26,10 +29,11 @@ class AssetsRoutes extends RouteHandler {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/assets/avatar')]
|
#[Route('GET', '/assets/avatar')]
|
||||||
#[HttpGet('/assets/avatar/([0-9]+)(?:\.[a-z]+)?')]
|
#[Route('GET', '/assets/avatar/:filename')]
|
||||||
#[URLInfo('user-avatar', '/assets/avatar/<user>', ['res' => '<res>'])]
|
#[URLInfo('user-avatar', '/assets/avatar/<user>', ['res' => '<res>'])]
|
||||||
public function getAvatar($response, $request, string $userId = '') {
|
public function getAvatar($response, $request, string $fileName = '') {
|
||||||
|
$userId = pathinfo($fileName, PATHINFO_FILENAME);
|
||||||
$assetInfo = new StaticUserImageAsset(MSZ_PUBLIC . '/images/no-avatar.png', MSZ_PUBLIC);
|
$assetInfo = new StaticUserImageAsset(MSZ_PUBLIC . '/images/no-avatar.png', MSZ_PUBLIC);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -48,10 +52,12 @@ class AssetsRoutes extends RouteHandler {
|
||||||
$this->serveAsset($response, $request, $assetInfo);
|
$this->serveAsset($response, $request, $assetInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/assets/profile-background')]
|
#[Route('GET', '/assets/profile-background')]
|
||||||
#[HttpGet('/assets/profile-background/([0-9]+)(?:\.[a-z]+)?')]
|
#[Route('GET', '/assets/profile-background/:filename')]
|
||||||
#[URLInfo('user-background', '/assets/profile-background/<user>')]
|
#[URLInfo('user-background', '/assets/profile-background/<user>')]
|
||||||
public function getProfileBackground($response, $request, string $userId = '') {
|
public function getProfileBackground($response, $request, string $fileName = '') {
|
||||||
|
$userId = pathinfo($fileName, PATHINFO_FILENAME);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$userInfo = $this->usersCtx->getUserInfo($userId);
|
$userInfo = $this->usersCtx->getUserInfo($userId);
|
||||||
} catch(RuntimeException $ex) {
|
} catch(RuntimeException $ex) {
|
||||||
|
@ -72,7 +78,7 @@ class AssetsRoutes extends RouteHandler {
|
||||||
$this->serveAsset($response, $request, $assetInfo);
|
$this->serveAsset($response, $request, $assetInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[HttpGet('/user-assets.php')]
|
#[Route('GET', '/user-assets.php')]
|
||||||
public function getUserAssets($response, $request) {
|
public function getUserAssets($response, $request) {
|
||||||
$userId = (string)$request->getParam('u', FILTER_SANITIZE_NUMBER_INT);
|
$userId = (string)$request->getParam('u', FILTER_SANITIZE_NUMBER_INT);
|
||||||
$mode = (string)$request->getParam('m');
|
$mode = (string)$request->getParam('m');
|
||||||
|
|
|
@ -25,7 +25,7 @@ class BanInfo {
|
||||||
publicReason: $result->getString(4),
|
publicReason: $result->getString(4),
|
||||||
privateReason: $result->getString(5),
|
privateReason: $result->getString(5),
|
||||||
created: $result->getInteger(6),
|
created: $result->getInteger(6),
|
||||||
expires: $result->getIntegerOrNull(7),
|
expires: $result->getIntegerOrNull(8),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class ModNoteInfo {
|
||||||
return new ModNoteInfo(
|
return new ModNoteInfo(
|
||||||
noteId: $result->getString(0),
|
noteId: $result->getString(0),
|
||||||
userId: $result->getString(1),
|
userId: $result->getString(1),
|
||||||
authorId: $result->getStringOrNull(2),
|
authorId: $result->getIntegerOrNull(2),
|
||||||
created: $result->getInteger(3),
|
created: $result->getInteger(3),
|
||||||
title: $result->getString(4),
|
title: $result->getString(4),
|
||||||
body: $result->getString(5)
|
body: $result->getString(5)
|
||||||
|
|
|
@ -47,7 +47,7 @@ class UserInfo {
|
||||||
created: $result->getInteger(9),
|
created: $result->getInteger(9),
|
||||||
lastActive: $result->getIntegerOrNull(10),
|
lastActive: $result->getIntegerOrNull(10),
|
||||||
deleted: $result->getIntegerOrNull(11),
|
deleted: $result->getIntegerOrNull(11),
|
||||||
displayRoleId: $result->getStringOrNull(12),
|
displayRoleId: $result->getIntegerOrNull(12),
|
||||||
totpKey: $result->getStringOrNull(13),
|
totpKey: $result->getStringOrNull(13),
|
||||||
aboutContent: $result->getStringOrNull(14),
|
aboutContent: $result->getStringOrNull(14),
|
||||||
aboutParser: $result->getInteger(15),
|
aboutParser: $result->getInteger(15),
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
{% set show_profile_fields = not profile_is_guest and (profile_is_editing ? perms.edit_profile : profile_fields_display_values|default([]) is not empty) %}
|
{% set show_profile_fields = not profile_is_guest and (profile_is_editing ? perms.edit_profile : profile_fields_display_values|default([]) is not empty) %}
|
||||||
{% set show_background_settings = profile_is_editing and perms.edit_background %}
|
{% set show_background_settings = profile_is_editing and perms.edit_background %}
|
||||||
{% set show_birthdate = profile_is_editing and perms.edit_birthdate %}
|
{% set show_birthdate = profile_is_editing and perms.edit_birthdate %}
|
||||||
{% set show_active_forum_info = not profile_is_guest and not profile_is_deleted and not profile_is_editing and profile_active_topic_info.id|default(0) > 0 %}
|
{% set show_active_forum_info = not profile_is_guest and not profile_is_deleted and not profile_is_editing or (profile_active_category_info is defined and profile_active_category_info is not empty or profile_active_topic_info.topic_id|default(0) > 0) %}
|
||||||
{% set show_warnings = profile_warnings is defined and profile_warnings|length > 0 %}
|
{% set show_warnings = profile_warnings is defined and profile_warnings|length > 0 %}
|
||||||
{% set show_sidebar = (not profile_is_banned or profile_can_edit) and (profile_is_guest or show_profile_fields or show_background_settings or show_birthdate or show_active_forum_info or show_warnings) %}
|
{% set show_sidebar = (not profile_is_banned or profile_can_edit) and (profile_is_guest or show_profile_fields or show_background_settings or show_birthdate or show_active_forum_info or show_warnings) %}
|
||||||
|
|
||||||
|
|
91
tools/cron
91
tools/cron
|
@ -132,15 +132,6 @@ msz_sched_task_func('Resync statistics counters.', true, function() use ($msz) {
|
||||||
'users:warnings:visible' => 'SELECT COUNT(*) FROM msz_users_warnings WHERE warn_created > NOW() - INTERVAL 90 DAY',
|
'users:warnings:visible' => 'SELECT COUNT(*) FROM msz_users_warnings WHERE warn_created > NOW() - INTERVAL 90 DAY',
|
||||||
'users:bans:total' => 'SELECT COUNT(*) FROM msz_users_bans',
|
'users:bans:total' => 'SELECT COUNT(*) FROM msz_users_bans',
|
||||||
'users:bans:active' => 'SELECT COUNT(*) FROM msz_users_bans WHERE ban_expires IS NULL OR ban_expires > NOW()',
|
'users:bans:active' => 'SELECT COUNT(*) FROM msz_users_bans WHERE ban_expires IS NULL OR ban_expires > NOW()',
|
||||||
'pms:msgs:total' => 'SELECT COUNT(*) FROM msz_messages',
|
|
||||||
'pms:msgs:messages' => 'SELECT COUNT(DISTINCT msg_id) FROM msz_messages',
|
|
||||||
'pms:msgs:replies' => 'SELECT COUNT(*) FROM msz_messages WHERE msg_reply_to IS NULL',
|
|
||||||
'pms:msgs:drafts' => 'SELECT COUNT(*) FROM msz_messages WHERE msg_sent IS NULL',
|
|
||||||
'pms:msgs:unread' => 'SELECT COUNT(*) FROM msz_messages WHERE msg_read IS NULL',
|
|
||||||
'pms:msgs:deleted' => 'SELECT COUNT(*) FROM msz_messages WHERE msg_deleted IS NOT NULL',
|
|
||||||
'pms:msgs:plain' => 'SELECT COUNT(*) FROM msz_messages WHERE msg_parser = 0',
|
|
||||||
'pms:msgs:bbcode' => 'SELECT COUNT(*) FROM msz_messages WHERE msg_parser = 1',
|
|
||||||
'pms:msgs:markdown' => 'SELECT COUNT(*) FROM msz_messages WHERE msg_parser = 2',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach($stats as $name => $query) {
|
foreach($stats as $name => $query) {
|
||||||
|
@ -158,88 +149,6 @@ msz_sched_task_func('Recalculate permissions (maybe)...', false, function() use
|
||||||
$msz->getPerms()->precalculatePermissions($msz->getForumContext()->getCategories());
|
$msz->getPerms()->precalculatePermissions($msz->getForumContext()->getCategories());
|
||||||
});
|
});
|
||||||
|
|
||||||
msz_sched_task_func('Omega disliking comments...', true, function() use ($msz) {
|
|
||||||
$commentIds = $msz->getConfig()->getArray('comments.omegadislike');
|
|
||||||
if(!is_array($commentIds))
|
|
||||||
return;
|
|
||||||
|
|
||||||
$dbConn = $msz->getDbConn();
|
|
||||||
$stmt = $dbConn->prepare('REPLACE INTO msz_comments_votes (comment_id, user_id, comment_vote) SELECT ?, user_id, -1 FROM msz_users');
|
|
||||||
foreach($commentIds as $commentId) {
|
|
||||||
$stmt->addParameter(1, $commentId);
|
|
||||||
$stmt->execute();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
msz_sched_task_func('Announcing random topics...', true, function() use ($msz) {
|
|
||||||
$categoryIds = $msz->getConfig()->getArray('forum.rngannounce');
|
|
||||||
if(!is_array($categoryIds))
|
|
||||||
return;
|
|
||||||
|
|
||||||
$dbConn = $msz->getDbConn();
|
|
||||||
$stmtRevert = $dbConn->prepare('UPDATE msz_forum_topics SET topic_type = 0 WHERE forum_id = ? AND topic_type = 2');
|
|
||||||
$stmtRandom = $dbConn->prepare('SELECT topic_id FROM msz_forum_topics WHERE forum_id = ? AND topic_deleted IS NULL ORDER BY RAND() LIMIT 1');
|
|
||||||
$stmtAnnounce = $dbConn->prepare('UPDATE msz_forum_topics SET topic_type = 2 WHERE topic_id = ?');
|
|
||||||
foreach($categoryIds as $categoryId) {
|
|
||||||
$stmtRevert->addParameter(1, $categoryId);
|
|
||||||
$stmtRevert->execute();
|
|
||||||
|
|
||||||
$stmtRandom->addParameter(1, $categoryId);
|
|
||||||
$stmtRandom->execute();
|
|
||||||
|
|
||||||
$resultRandom = $stmtRandom->getResult();
|
|
||||||
if($resultRandom->next()) {
|
|
||||||
$stmtAnnounce->addParameter(1, $resultRandom->getInteger(0));
|
|
||||||
$stmtAnnounce->execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
msz_sched_task_func('Changing category icons...', false, function() use ($msz) {
|
|
||||||
$config = $msz->getConfig();
|
|
||||||
$categoryIds = $config->getArray('forum.rngicon');
|
|
||||||
if(!is_array($categoryIds))
|
|
||||||
return;
|
|
||||||
|
|
||||||
$dbConn = $msz->getDbConn();
|
|
||||||
|
|
||||||
$stmtIcon = $dbConn->prepare('UPDATE msz_forum_categories SET forum_icon = COALESCE(?, forum_icon), forum_name = COALESCE(?, forum_name), forum_colour = ((ROUND(RAND() * 255) << 16) | (ROUND(RAND() * 255) << 8) | ROUND(RAND() * 255)) WHERE forum_id = ?');
|
|
||||||
$stmtUnlock = $dbConn->prepare('UPDATE msz_forum_topics SET topic_locked = IF(?, NULL, COALESCE(topic_locked, NOW())) WHERE topic_id = ?');
|
|
||||||
|
|
||||||
foreach($categoryIds as $categoryId) {
|
|
||||||
$scoped = $config->scopeTo(sprintf('forum.rngicon.fc%d', $categoryId));
|
|
||||||
|
|
||||||
$icons = $scoped->getArray('icons');
|
|
||||||
$icon = $icons[array_rand($icons)];
|
|
||||||
|
|
||||||
$name = null;
|
|
||||||
$names = $scoped->getArray('names');
|
|
||||||
for($i = 0; $i < count($names); $i += 2)
|
|
||||||
if($names[$i] === $icon) {
|
|
||||||
$name = $names[$i + 1] ?? null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$name ??= $scoped->getString('name');
|
|
||||||
|
|
||||||
$stmtIcon->addParameter(1, $icon);
|
|
||||||
$stmtIcon->addParameter(2, empty($name) ? null : $name);
|
|
||||||
$stmtIcon->addParameter(3, $categoryId);
|
|
||||||
$stmtIcon->execute();
|
|
||||||
|
|
||||||
$unlockModes = $scoped->getArray('unlock');
|
|
||||||
foreach($unlockModes as $unlockMode) {
|
|
||||||
$unlockScoped = $scoped->scopeTo(sprintf('unlock.%s', $unlockMode));
|
|
||||||
$topicId = $unlockScoped->getInteger('topic');
|
|
||||||
$match = $unlockScoped->getArray('match');
|
|
||||||
$matches = in_array($icon, $match);
|
|
||||||
|
|
||||||
$stmtUnlock->addParameter(1, $matches ? 1 : 0);
|
|
||||||
$stmtUnlock->addParameter(2, $topicId);
|
|
||||||
$stmtUnlock->execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
echo 'Running ' . count($schedTasks) . ' tasks...' . PHP_EOL;
|
echo 'Running ' . count($schedTasks) . ' tasks...' . PHP_EOL;
|
||||||
|
|
||||||
$dbConn = $msz->getDbConn();
|
$dbConn = $msz->getDbConn();
|
||||||
|
|
Loading…
Reference in a new issue