Skip to content

Commit

Permalink
Merge pull request #46804 from nextcloud/refactor/encryption/security…
Browse files Browse the repository at this point in the history
…-attributes
  • Loading branch information
provokateurin authored Aug 1, 2024
2 parents 553224b + 4016aac commit c52b7e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/encryption/lib/Controller/RecoveryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use OCA\Encryption\Recovery;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\IConfig;
use OCP\IL10N;
Expand Down Expand Up @@ -136,11 +137,10 @@ public function changeRecoveryPassword($newPassword, $oldPassword, $confirmPassw
}

/**
* @NoAdminRequired
*
* @param string $userEnableRecovery
* @return DataResponse
*/
#[NoAdminRequired]
public function userSetRecovery($userEnableRecovery) {
if ($userEnableRecovery === '0' || $userEnableRecovery === '1') {
$result = $this->recovery->setRecoveryForUser($userEnableRecovery);
Expand Down
10 changes: 5 additions & 5 deletions apps/encryption/lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
use OCA\Encryption\Util;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\UseSession;
use OCP\AppFramework\Http\DataResponse;
use OCP\IL10N;
use OCP\IRequest;
Expand Down Expand Up @@ -82,13 +84,12 @@ public function __construct($AppName,


/**
* @NoAdminRequired
* @UseSession
*
* @param string $oldPassword
* @param string $newPassword
* @return DataResponse
*/
#[NoAdminRequired]
#[UseSession]
public function updatePrivateKeyPassword($oldPassword, $newPassword) {
$result = false;
$uid = $this->userSession->getUser()->getUID();
Expand Down Expand Up @@ -137,11 +138,10 @@ public function updatePrivateKeyPassword($oldPassword, $newPassword) {
}

/**
* @UseSession
*
* @param bool $encryptHomeStorage
* @return DataResponse
*/
#[UseSession]
public function setEncryptHomeStorage($encryptHomeStorage) {
$this->util->setEncryptHomeStorage($encryptHomeStorage);
return new DataResponse();
Expand Down
3 changes: 2 additions & 1 deletion apps/encryption/lib/Controller/StatusController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use OCA\Encryption\Session;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\Encryption\IManager;
use OCP\IL10N;
Expand Down Expand Up @@ -45,9 +46,9 @@ public function __construct($AppName,
}

/**
* @NoAdminRequired
* @return DataResponse
*/
#[NoAdminRequired]
public function getStatus() {
$status = 'error';
$message = 'no valid init status';
Expand Down

0 comments on commit c52b7e5

Please sign in to comment.