Code Duplication    Length = 8-8 lines in 3 locations

lib/Circles/FileSharingBroadcaster.php 1 location

@@ 220-227 (lines=8) @@
217
218
				$password = '';
219
				$sendPasswordByMail = true;
220
				if ($this->configService->enforcePasswordProtection($circle)) {
221
					if ($circle->getSetting('password_single_enabled') === 'true') {
222
						$password = $circle->getPasswordSingle();
223
						$sendPasswordByMail = false;
224
					} else {
225
						$password = $this->miscService->token(15);
226
					}
227
				}
228
229
				$sharesToken =
230
					$this->tokensRequest->generateTokenForMember($member, $share->getId(), $password);

lib/GlobalScale/FileShare.php 1 location

@@ 203-210 (lines=8) @@
200
		$newCircle = $this->circlesRequest->forceGetCircle($circle->getUniqueId(), true);
201
		$password = '';
202
		$sendPasswordByMail = true;
203
		if ($this->configService->enforcePasswordProtection($newCircle)) {
204
			if ($newCircle->getSetting('password_single_enabled') === 'true') {
205
				$password = $newCircle->getPasswordSingle();
206
				$sendPasswordByMail = false;
207
			} else {
208
				$password = $this->miscService->token(15);
209
			}
210
		}
211
212
		try {
213
			$sharesToken =

lib/GlobalScale/MemberAdd.php 1 location

@@ 113-120 (lines=8) @@
110
111
		$password = '';
112
		$sendPasswordByMail = false;
113
		if ($this->configService->enforcePasswordProtection($circle)) {
114
			if ($circle->getSetting('password_single_enabled') === 'true') {
115
				$password = $circle->getPasswordSingle();
116
			} else {
117
				$sendPasswordByMail = true;
118
				$password = $this->miscService->token(15);
119
			}
120
		}
121
122
		$event->setData(
123
			new SimpleDataStore(