Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>tags/v26.0.0beta1
@@ -3,8 +3,21 @@ | |||
// autoload.php @generated by Composer | |||
if (PHP_VERSION_ID < 50600) { | |||
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; | |||
exit(1); | |||
if (!headers_sent()) { | |||
header('HTTP/1.1 500 Internal Server Error'); | |||
} | |||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; | |||
if (!ini_get('display_errors')) { | |||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { | |||
fwrite(STDERR, $err); | |||
} elseif (!headers_sent()) { | |||
echo $err; | |||
} | |||
} | |||
trigger_error( | |||
$err, | |||
E_USER_ERROR | |||
); | |||
} | |||
require_once __DIR__ . '/composer/autoload_real.php'; |
@@ -76,5 +76,6 @@ return array( | |||
'OCA\\Settings\\SetupChecks\\SupportedDatabase' => $baseDir . '/../lib/SetupChecks/SupportedDatabase.php', | |||
'OCA\\Settings\\UserMigration\\AccountMigrator' => $baseDir . '/../lib/UserMigration/AccountMigrator.php', | |||
'OCA\\Settings\\UserMigration\\AccountMigratorException' => $baseDir . '/../lib/UserMigration/AccountMigratorException.php', | |||
'OCA\\Settings\\WellKnown\\ChangePasswordHandler' => $baseDir . '/../lib/WellKnown/ChangePasswordHandler.php', | |||
'OCA\\Settings\\WellKnown\\SecurityTxtHandler' => $baseDir . '/../lib/WellKnown/SecurityTxtHandler.php', | |||
); |
@@ -91,6 +91,7 @@ class ComposerStaticInitSettings | |||
'OCA\\Settings\\SetupChecks\\SupportedDatabase' => __DIR__ . '/..' . '/../lib/SetupChecks/SupportedDatabase.php', | |||
'OCA\\Settings\\UserMigration\\AccountMigrator' => __DIR__ . '/..' . '/../lib/UserMigration/AccountMigrator.php', | |||
'OCA\\Settings\\UserMigration\\AccountMigratorException' => __DIR__ . '/..' . '/../lib/UserMigration/AccountMigratorException.php', | |||
'OCA\\Settings\\WellKnown\\ChangePasswordHandler' => __DIR__ . '/..' . '/../lib/WellKnown/ChangePasswordHandler.php', | |||
'OCA\\Settings\\WellKnown\\SecurityTxtHandler' => __DIR__ . '/..' . '/../lib/WellKnown/SecurityTxtHandler.php', | |||
); | |||
@@ -3,7 +3,7 @@ | |||
'name' => '__root__', | |||
'pretty_version' => 'dev-master', | |||
'version' => 'dev-master', | |||
'reference' => '144514e49e25b7b123fd535902fee97fa39fb446', | |||
'reference' => 'a66c80135de5b21d8ad48218b96a90eefde0fc7f', | |||
'type' => 'library', | |||
'install_path' => __DIR__ . '/../', | |||
'aliases' => array(), | |||
@@ -13,7 +13,7 @@ | |||
'__root__' => array( | |||
'pretty_version' => 'dev-master', | |||
'version' => 'dev-master', | |||
'reference' => '144514e49e25b7b123fd535902fee97fa39fb446', | |||
'reference' => 'a66c80135de5b21d8ad48218b96a90eefde0fc7f', | |||
'type' => 'library', | |||
'install_path' => __DIR__ . '/../', | |||
'aliases' => array(), |
@@ -47,6 +47,7 @@ use OCA\Settings\Middleware\SubadminMiddleware; | |||
use OCA\Settings\Search\AppSearch; | |||
use OCA\Settings\Search\SectionSearch; | |||
use OCA\Settings\UserMigration\AccountMigrator; | |||
use OCA\Settings\WellKnown\ChangePasswordHandler; | |||
use OCA\Settings\WellKnown\SecurityTxtHandler; | |||
use OCP\AppFramework\App; | |||
use OCP\AppFramework\Bootstrap\IBootContext; | |||
@@ -86,6 +87,7 @@ class Application extends App implements IBootstrap { | |||
// Register well-known handlers | |||
$context->registerWellKnownHandler(SecurityTxtHandler::class); | |||
$context->registerWellKnownHandler(ChangePasswordHandler::class); | |||
/** | |||
* Core class wrappers |
@@ -0,0 +1,51 @@ | |||
<?php | |||
declare(strict_types=1); | |||
/** | |||
* @copyright 2022 Roeland Jago Douma <roeland@famdouma.nl> | |||
* | |||
* @author 2022 Roeland Jago Douma <roeland@famdouma.nl> | |||
* | |||
* @license GNU AGPL version 3 or any later version | |||
* | |||
* This program is free software: you can redistribute it and/or modify | |||
* it under the terms of the GNU Affero General Public License as | |||
* published by the Free Software Foundation, either version 3 of the | |||
* License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU Affero General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Affero General Public License | |||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | |||
namespace OCA\Settings\WellKnown; | |||
use OCP\AppFramework\Http\RedirectResponse; | |||
use OCP\Http\WellKnown\GenericResponse; | |||
use OCP\Http\WellKnown\IHandler; | |||
use OCP\Http\WellKnown\IRequestContext; | |||
use OCP\Http\WellKnown\IResponse; | |||
use OCP\IURLGenerator; | |||
class ChangePasswordHandler implements IHandler { | |||
private IURLGenerator $urlGenerator; | |||
public function __construct(IURLGenerator $urlGenerator) { | |||
$this->urlGenerator = $urlGenerator; | |||
} | |||
public function handle(string $service, IRequestContext $context, ?IResponse $previousResponse): ?IResponse { | |||
if ($service !== 'change-password') { | |||
return $previousResponse; | |||
} | |||
$response = new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('settings.PersonalSettings.index', ['section' => 'security'])); | |||
return new GenericResponse($response); | |||
} | |||
} |