Browse Source

Fix invite settings box

causefx 7 years ago
parent
commit
72e46f6594
2 changed files with 4 additions and 4 deletions
  1. 3 3
      api/plugins/invites.php
  2. 1 1
      js/functions.js

+ 3 - 3
api/plugins/invites.php

@@ -160,7 +160,7 @@ function inviteCodes($array)
 /* GET PHPMAILER SETTINGS */
 function invitesGetSettings()
 {
-	if ($GLOBALS['plexID'] !== '' && $GLOBALS['plexToken'] !== '' && $GLOBALS['INVITES-type-include'] !== '') {
+	if ($GLOBALS['plexID'] !== '' && $GLOBALS['plexToken'] !== '' && $GLOBALS['INVITES-type-include'] == 'plex') {
 		$loop = libraryList($GLOBALS['INVITES-type-include'])['libraries'];
 		foreach ($loop as $key => $value) {
 			$libraryList[] = array(
@@ -237,7 +237,7 @@ function invitesGetSettings()
 				'type' => 'text',
 				'name' => 'embyURL',
 				'label' => 'Emby server adress',
-				'value' =>  $GLOBALS['embyURL'],
+				'value' => $GLOBALS['embyURL'],
 				'placeholder' => 'localhost:8086'
 			),
 			array(
@@ -334,7 +334,7 @@ function inviteAction($username, $action = null, $type = null)
 			try {
 				#add emby user to sytem
 				return true;
-			} catch (Requests_Exception $e){
+			} catch (Requests_Exception $e) {
 				writeLog('error', 'Emby Invite Function - Error: ' . $e->getMessage(), 'SYSTEM');
 				return false;
 			}

+ 1 - 1
js/functions.js

@@ -2869,7 +2869,7 @@ function submitSettingsForm(form){
                     var value = input.prop("checked") ? true : false;
                     break;
 				case 'select2':
-                    var value = input.val().toString();
+                    var value = (input.val() !== null) ? input.val().toString() : '';
                     break;
                 default:
                     var value = input.val();