lib/private/Encryption/DecryptAll.php
/**
	 * encrypt files from the given user
	 *
	 * @param string $uid
	 * @param ProgressBar $progress
	 * @param string $userCount
	 */
encrypt files from the given user
@param string $uid
@param ProgressBar $progress
@param string $userCount
encrypt files from the given user @param string $uid @param ProgressBar $progress @param string $userCount
protected function decryptUsersFiles($uid, ProgressBar $progress, $userCount) {
		$this->setupUserFS($uid);
		$directories = array();
		$directories[] = '/' . $uid . '/files';
		while ($root = array_pop($directories)) {
			$content = $this->rootView->getDirectoryContent($root);
			foreach ($content as $file) {
				if($file->getStorage()->instanceOfStorage('OCA\Files_Sharing\SharedStorage')) {
					continue;
				}
				$path = $root . '/' . $file['name'];
				if ($this->rootView->is_dir($path)) {
					$directories[] = $path;
					continue;
				} else {
					try {
						$progress->setMessage("decrypt files for user $userCount: $path");
						$progress->advance();
						if ($file->isEncrypted() === false) {
							$progress->setMessage("decrypt files for user $userCount: $path (already decrypted)");
							$progress->advance();
						} else {
							if ($this->decryptFile($path) === false) {
								$progress->setMessage("decrypt files for user $userCount: $path (already decrypted)");
								$progress->advance();
							}
						}
					} catch (\Exception $e) {
						if (isset($this->failed[$uid])) {
							$this->failed[$uid][] = $path;
						} else {
							$this->failed[$uid] = [$path];
						}
					}
				}
			}
		}
	}
protected function decryptUsersFiles ( $ uid , ProgressBar $ progress , $ userCount ) { $ this -> setupUserFS ( $ uid ) ; $ directories = array ( ) ; $ directories [ ] = '/' . $ uid . '/files' ; while ( $ root = array_pop ( $ directories ) ) { $ content = $ this -> rootView -> getDirectoryContent ( $ root ) ; foreach ( $ content as $ file ) { if ( $ file -> getStorage ( ) -> instanceOfStorage ( 'OCA\Files_Sharing\SharedStorage' ) ) { continue ; } $ path = $ root . '/' . $ file [ 'name' ] ; if ( $ this -> rootView -> is_dir ( $ path ) ) { $ directories [ ] = $ path ; continue ; } else { try { $ progress -> setMessage ( " decrypt files for user  $ userCount :  $ path " ) ; $ progress -> advance ( ) ; if ( $ file -> isEncrypted ( ) === false ) { $ progress -> setMessage ( " decrypt files for user  $ userCount :  $ path  (already decrypted) " ) ; $ progress -> advance ( ) ; } else { if ( $ this -> decryptFile ( $ path ) === false ) { $ progress -> setMessage ( " decrypt files for user  $ userCount :  $ path  (already decrypted) " ) ; $ progress -> advance ( ) ; } } } catch ( \ Exception $ e ) { if ( isset ( $ this -> failed [ $ uid ] ) ) { $ this -> failed [ $ uid ] [ ] = $ path ; } else { $ this -> failed [ $ uid ] = [ $ path ] ; } } } } } }
encrypt files from the given user
 @param string $uid
 @param ProgressBar $progress
 @param string $userCount
encrypt files from the given user @param string $uid @param ProgressBar $progress @param string $userCount
// only decrypt files owned by the user