lib/private/Encryption/DecryptAll.php
/**
	 * iterate over all user and encrypt their files
	 *
	 * @param string $user which users files should be decrypted, default = all users
	 */
iterate over all user and encrypt their files
@param string $user which users files should be decrypted, default = all users
iterate over all user and encrypt their files @param string $user which users files should be decrypted default = all users
protected function decryptAllUsersFiles($user = '') {
		$this->output->writeln("\n");
		$userList = [];
		if ($user === '') {
			$fetchUsersProgress = new ProgressBar($this->output);
			$fetchUsersProgress->setFormat(" %message% \n [%bar%]");
			$fetchUsersProgress->start();
			$fetchUsersProgress->setMessage("Fetch list of users...");
			$fetchUsersProgress->advance();
			foreach ($this->userManager->getBackends() as $backend) {
				$limit = 500;
				$offset = 0;
				do {
					$users = $backend->getUsers('', $limit, $offset);
					foreach ($users as $user) {
						$userList[] = $user;
					}
					$offset += $limit;
					$fetchUsersProgress->advance();
				} while (count($users) >= $limit);
				$fetchUsersProgress->setMessage("Fetch list of users... finished");
				$fetchUsersProgress->finish();
			}
		} else {
			$userList[] = $user;
		}
		$this->output->writeln("\n\n");
		$progress = new ProgressBar($this->output);
		$progress->setFormat(" %message% \n [%bar%]");
		$progress->start();
		$progress->setMessage("starting to decrypt files...");
		$progress->advance();
		$numberOfUsers = count($userList);
		$userNo = 1;
		foreach ($userList as $uid) {
			$userCount = "$uid ($userNo of $numberOfUsers)";
			$this->decryptUsersFiles($uid, $progress, $userCount);
			$userNo++;
		}
		$progress->setMessage("starting to decrypt files... finished");
		$progress->finish();
		$this->output->writeln("\n\n");
	}
protected function decryptAllUsersFiles ( $ user = '' ) { $ this -> output -> writeln ( " \n " ) ; $ userList = [ ] ; if ( $ user === '' ) { $ fetchUsersProgress = new ProgressBar ( $ this -> output ) ; $ fetchUsersProgress -> setFormat ( "  %message%  \n  [%bar%] " ) ; $ fetchUsersProgress -> start ( ) ; $ fetchUsersProgress -> setMessage ( " Fetch list of users... " ) ; $ fetchUsersProgress -> advance ( ) ; foreach ( $ this -> userManager -> getBackends ( ) as $ backend ) { $ limit = 500 ; $ offset = 0 ; do { $ users = $ backend -> getUsers ( '' , $ limit , $ offset ) ; foreach ( $ users as $ user ) { $ userList [ ] = $ user ; } $ offset += $ limit ; $ fetchUsersProgress -> advance ( ) ; } while ( count ( $ users ) >= $ limit ) ; $ fetchUsersProgress -> setMessage ( " Fetch list of users... finished " ) ; $ fetchUsersProgress -> finish ( ) ; } } else { $ userList [ ] = $ user ; } $ this -> output -> writeln ( " \n \n " ) ; $ progress = new ProgressBar ( $ this -> output ) ; $ progress -> setFormat ( "  %message%  \n  [%bar%] " ) ; $ progress -> start ( ) ; $ progress -> setMessage ( " starting to decrypt files... " ) ; $ progress -> advance ( ) ; $ numberOfUsers = count ( $ userList ) ; $ userNo = 1 ; foreach ( $ userList as $ uid ) { $ userCount = " $ uid  ( $ userNo  of  $ numberOfUsers ) " ; $ this -> decryptUsersFiles ( $ uid , $ progress , $ userCount ) ; $ userNo ++ ; } $ progress -> setMessage ( " starting to decrypt files... finished " ) ; $ progress -> finish ( ) ; $ this -> output -> writeln ( " \n \n " ) ; }
iterate over all user and encrypt their files
 @param string $user which users files should be decrypted, default = all users
iterate over all user and encrypt their files @param string $user which users files should be decrypted default = all users