mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
fix: Add missing PasswordConfirmationRequired attributes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
10d1cec02d
commit
364756e93d
5 changed files with 9 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ use OCA\OAuth2\Db\Client;
|
|||
use OCA\OAuth2\Db\ClientMapper;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\Authentication\Token\IProvider as IAuthTokenProvider;
|
||||
use OCP\IL10N;
|
||||
|
|
@ -40,6 +41,7 @@ class SettingsController extends Controller {
|
|||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
#[PasswordConfirmationRequired(strict: true)]
|
||||
public function addClient(string $name,
|
||||
string $redirectUri): JSONResponse {
|
||||
if (filter_var($redirectUri, FILTER_VALIDATE_URL) === false) {
|
||||
|
|
@ -66,6 +68,7 @@ class SettingsController extends Controller {
|
|||
return new JSONResponse($result);
|
||||
}
|
||||
|
||||
#[PasswordConfirmationRequired]
|
||||
public function deleteClient(int $id): JSONResponse {
|
||||
$client = $this->clientMapper->getByUid($id);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class AppsController extends OCSController {
|
|||
*
|
||||
* 200: App enabled successfully
|
||||
*/
|
||||
#[PasswordConfirmationRequired]
|
||||
#[PasswordConfirmationRequired(strict: true)]
|
||||
public function enable(string $app): DataResponse {
|
||||
try {
|
||||
$this->appManager->enableApp($app);
|
||||
|
|
|
|||
|
|
@ -556,7 +556,7 @@ class AppSettingsController extends Controller {
|
|||
* @param array $groups
|
||||
* @return JSONResponse
|
||||
*/
|
||||
#[PasswordConfirmationRequired]
|
||||
#[PasswordConfirmationRequired(strict: true)]
|
||||
public function enableApps(array $appIds, array $groups = []): JSONResponse {
|
||||
try {
|
||||
$updateRequired = false;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use OC\Settings\AuthorizedGroup;
|
|||
use OCA\Settings\Service\AuthorizedGroupService;
|
||||
use OCA\Settings\Service\NotFoundException;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\DB\Exception;
|
||||
use OCP\IRequest;
|
||||
|
|
@ -27,6 +28,7 @@ class AuthorizedGroupController extends Controller {
|
|||
* @throws NotFoundException
|
||||
* @throws Exception
|
||||
*/
|
||||
#[PasswordConfirmationRequired(strict: true)]
|
||||
public function saveSettings(array $newGroups, string $class): DataResponse {
|
||||
$currentGroups = $this->authorizedGroupService->findExistingGroupsForClass($class);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ namespace OCA\Settings\Controller;
|
|||
use OC\Authentication\TwoFactorAuth\EnforcementState;
|
||||
use OC\Authentication\TwoFactorAuth\MandatoryTwoFactor;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\IRequest;
|
||||
|
||||
|
|
@ -31,6 +32,7 @@ class TwoFactorSettingsController extends Controller {
|
|||
return new JSONResponse($this->mandatoryTwoFactor->getState());
|
||||
}
|
||||
|
||||
#[PasswordConfirmationRequired(strict: true)]
|
||||
public function update(bool $enforced, array $enforcedGroups = [], array $excludedGroups = []): JSONResponse {
|
||||
$this->mandatoryTwoFactor->setState(
|
||||
new EnforcementState($enforced, $enforcedGroups, $excludedGroups)
|
||||
|
|
|
|||
Loading…
Reference in a new issue