Code Duplication    Length = 8-8 lines in 4 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

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

lib/RemoteEvents/MemberAdd.php 1 location

@@ 121-128 (lines=8) @@
118
119
		$password = '';
120
		$sendPasswordByMail = false;
121
		if ($this->configService->enforcePasswordProtection($circle)) {
122
			if ($circle->getSetting('password_single_enabled') === 'true') {
123
				$password = $circle->getPasswordSingle();
124
			} else {
125
				$sendPasswordByMail = true;
126
				$password = $this->miscService->token(15);
127
			}
128
		}
129
130
		$event->setData(
131
			new SimpleDataStore(