apps/encryption/lib/Crypto/EncryptAll.php
/**
	 * create key-pair for every user
	 */
create key-pair for every user
create key - pair for every user
protected function createKeyPairs() {
		$this->output->writeln("\n");
		$progress = new ProgressBar($this->output);
		$progress->setFormat(" %message% \n [%bar%]");
		$progress->start();
		foreach($this->userManager->getBackends() as $backend) {
			$limit = 500;
			$offset = 0;
			do {
				$users = $backend->getUsers('', $limit, $offset);
				foreach ($users as $user) {
					if ($this->keyManager->userHasKeys($user) === false) {
						$progress->setMessage('Create key-pair for ' . $user);
						$progress->advance();
						$this->setupUserFS($user);
						$password = $this->generateOneTimePassword($user);
						$this->userSetup->setupUser($user, $password);
					} else {
						$this->userPasswords[$user] = '';
					}
				}
				$offset += $limit;
			} while(count($users) >= $limit);
		}
		$progress->setMessage('Key-pair created for all users');
		$progress->finish();
	}
protected function createKeyPairs ( ) { $ this -> output -> writeln ( " \n " ) ; $ progress = new ProgressBar ( $ this -> output ) ; $ progress -> setFormat ( "  %message%  \n  [%bar%] " ) ; $ progress -> start ( ) ; foreach ( $ this -> userManager -> getBackends ( ) as $ backend ) { $ limit = 500 ; $ offset = 0 ; do { $ users = $ backend -> getUsers ( '' , $ limit , $ offset ) ; foreach ( $ users as $ user ) { if ( $ this -> keyManager -> userHasKeys ( $ user ) === false ) { $ progress -> setMessage ( 'Create key-pair for ' . $ user ) ; $ progress -> advance ( ) ; $ this -> setupUserFS ( $ user ) ; $ password = $ this -> generateOneTimePassword ( $ user ) ; $ this -> userSetup -> setupUser ( $ user , $ password ) ; } else { $ this -> userPasswords [ $ user ] = '' ; } } $ offset += $ limit ; } while ( count ( $ users ) >= $ limit ) ; } $ progress -> setMessage ( 'Key-pair created for all users' ) ; $ progress -> finish ( ) ; }
create key-pair for every user
create key - pair for every user
// users which already have a key-pair will be stored with a // empty password and filtered out later