Kaynağa Gözat

Added option to disable Strict Plex Friend - which would allow all Friends to login despite having a shared server

causefx 7 yıl önce
ebeveyn
işleme
dc93048436

+ 2 - 1
api/config/default.php

@@ -200,5 +200,6 @@ return array(
 	'plexoAuth' => false,
 	'statusSounds' => false,
 	'rememberMeDays' => '7',
-	'rememberMe' => true
+	'rememberMe' => true,
+	'plexStrictFriends' => true
 );

+ 7 - 3
api/functions/auth-functions.php

@@ -79,10 +79,14 @@ function checkPlexUser($username)
 						if (isset($child['username']) && strtolower($child['username']) == $usernameLower || isset($child['email']) && strtolower($child['email']) == $usernameLower) {
 							writeLog('success', 'Plex User Check - Found User on Friends List', $username);
 							$machineMatches = false;
-							foreach ($child->Server as $server) {
-								if ((string)$server['machineIdentifier'] == $GLOBALS['plexID']) {
-									$machineMatches = true;
+							if ($GLOBALS['plexStrictFriends']) {
+								foreach ($child->Server as $server) {
+									if ((string)$server['machineIdentifier'] == $GLOBALS['plexID']) {
+										$machineMatches = true;
+									}
 								}
+							} else {
+								$machineMatches = true;
 							}
 							if ($machineMatches) {
 								writeLog('success', 'Plex User Check - User Approved for Login', $username);

+ 8 - 0
api/functions/organizr-functions.php

@@ -514,6 +514,14 @@ function getSettingsMain()
 				'class' => 'popup-with-form plexAuth switchAuth',
 				'value' => $GLOBALS['plexoAuth']
 			),
+			array(
+				'type' => 'switch',
+				'name' => 'plexStrictFriends',
+				'label' => 'Strict Plex Friends ',
+				'class' => 'popup-with-form plexAuth switchAuth',
+				'value' => $GLOBALS['plexStrictFriends'],
+				'help' => 'Enabling this will only allow Friends that have shares to the Machine ID entered above to login, Having this disabled will allow all Friends on your Friends list to login'
+			),
 			array(
 				'type' => 'input',
 				'name' => 'authBackendHost',