Code Duplication    Length = 5-6 lines in 2 locations

lib/private/Server.php 1 location

@@ 238-242 (lines=5) @@
235
			$timeFactory = new TimeFactory();
236
			// Token providers might require a working database. This code
237
			// might however be called when ownCloud is not yet setup.
238
			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
239
				$defaultTokenProvider = $c->query('OC\Authentication\Token\IProvider');
240
			} else {
241
				$defaultTokenProvider = null;
242
			}
243
244
			$userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig());
245
			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {

lib/private/legacy/util.php 1 location

@@ 450-455 (lines=6) @@
447
			
448
			// Allow overriding update channel
449
			
450
			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
451
				$channel = \OC::$server->getAppConfig()->getValue('core', 'OC_Channel');
452
			} else {
453
				/** @var $OC_Channel string */
454
				$channel = $OC_Channel;
455
			}
456
			
457
			if (!is_null($channel)) {
458
				$session->set('OC_Channel', $channel);