Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>pull/44534/head
@@ -271,6 +271,9 @@ class SyncService { | |||
return $this->localSystemAddressBook; | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function syncInstance(?\Closure $progressCallback = null) { | |||
$systemAddressBook = $this->getLocalSystemAddressBook(); | |||
$this->userManager->callForAllUsers(function ($user) use ($systemAddressBook, $progressCallback) { |
@@ -29,6 +29,10 @@ namespace OCA\DAV\Connector\Sabre\Exception; | |||
use Exception; | |||
class FileLocked extends \Sabre\DAV\Exception { | |||
/** | |||
* @param string $message | |||
* @param int $code | |||
*/ | |||
public function __construct($message = "", $code = 0, ?Exception $previous = null) { | |||
if ($previous instanceof \OCP\Files\LockNotAcquiredException) { | |||
$message = sprintf('Target file %s is locked by another process.', $previous->path); |
@@ -664,7 +664,8 @@ class FilesPlugin extends ServerPlugin { | |||
/** | |||
* @param string $filePath | |||
* @param \Sabre\DAV\INode $node | |||
* @param ?\Sabre\DAV\INode $node | |||
* @return void | |||
* @throws \Sabre\DAV\Exception\BadRequest | |||
*/ | |||
public function sendFileIdHeader($filePath, ?\Sabre\DAV\INode $node = null) { |
@@ -163,6 +163,9 @@ class HookManager { | |||
} | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function firstLogin(?IUser $user = null) { | |||
if (!is_null($user)) { | |||
$principal = 'principals/users/' . $user->getUID(); |
@@ -70,6 +70,9 @@ class GlobalAuth extends AuthMechanism { | |||
]); | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) { | |||
$uid = ''; |
@@ -112,6 +112,9 @@ class LoginCredentials extends AuthMechanism { | |||
return $credentials; | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
if (!isset($user)) { | |||
throw new InsufficientDataForMeaningfulAnswerException('No login credentials saved'); |
@@ -51,6 +51,9 @@ class SessionCredentials extends AuthMechanism { | |||
->addParameters([]); | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
try { | |||
$credentials = $this->credentialsStore->getLoginCredentials(); |
@@ -69,6 +69,9 @@ class UserGlobalAuth extends AuthMechanism { | |||
$this->credentialsManager->store($user->getUID(), self::CREDENTIALS_IDENTIFIER, $credentials); | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
if ($user === null) { | |||
throw new InsufficientDataForMeaningfulAnswerException('No credentials saved'); |
@@ -71,6 +71,9 @@ class UserProvided extends AuthMechanism implements IUserProvided { | |||
]); | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
if (!isset($user)) { | |||
throw new InsufficientDataForMeaningfulAnswerException('No credentials saved'); |
@@ -56,6 +56,9 @@ class RSA extends AuthMechanism { | |||
; | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
$auth = new RSACrypt(); | |||
$auth->setPassword($this->config->getSystemValue('secret', '')); |
@@ -54,6 +54,9 @@ class RSAPrivateKey extends AuthMechanism { | |||
]); | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
$auth = new RSACrypt(); | |||
$auth->setPassword($this->config->getSystemValue('secret', '')); |
@@ -60,6 +60,9 @@ class InvalidBackend extends Backend { | |||
return $this->invalidId; | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
$storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR)); | |||
} |
@@ -77,6 +77,9 @@ class SMB extends Backend { | |||
->setLegacyAuthMechanism($legacyAuth); | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
$auth = $storage->getAuthMechanism(); | |||
if ($auth->getScheme() === AuthMechanism::SCHEME_PASSWORD) { |
@@ -60,6 +60,9 @@ class SMB_OC extends Backend { | |||
; | |||
} | |||
/** | |||
* @return void | |||
*/ | |||
public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user = null) { | |||
$username_as_share = ($storage->getBackendOption('username_as_share') === true); | |||
@@ -46,6 +46,7 @@ trait StorageModifierTrait { | |||
* | |||
* @param StorageConfig $storage | |||
* @param IUser $user User the storage is being used as | |||
* @return void | |||
* @throws InsufficientDataForMeaningfulAnswerException | |||
* @throws StorageNotAvailableException | |||
*/ |