瀏覽代碼

Added new plex login logging actions
Fix new izi bug

causefx 7 年之前
父節點
當前提交
23f67653c7
共有 2 個文件被更改,包括 20 次插入16 次删除
  1. 5 1
      api/functions/auth-functions.php
  2. 15 15
      js/functions.js

+ 5 - 1
api/functions/auth-functions.php

@@ -77,8 +77,12 @@ function checkPlexUser($username)
 					$usernameLower = strtolower($username);
 					foreach ($userXML as $child) {
 						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);
 							if ((string)$child->Server['machineIdentifier'] == $GLOBALS['plexID']) {
+								writeLog('success', 'Plex User Check - User Approved for Login', $username);
 								return true;
+							} else {
+								writeLog('error', 'Plex User Check - User not Approved User', $username);
 							}
 						}
 					}
@@ -87,7 +91,7 @@ function checkPlexUser($username)
 		}
 		return false;
 	} catch (Requests_Exception $e) {
-		writeLog('success', 'Plex User Check Function - Error: ' . $e->getMessage(), $username);
+		writeLog('error', 'Plex User Check Function - Error: ' . $e->getMessage(), $username);
 	}
 	return false;
 }

+ 15 - 15
js/functions.js

@@ -5428,20 +5428,6 @@ function message(heading,text,position,color,icon,timeout){
                 });
                 break;
             case 'izi':
-                iziToast.settings({
-                    close: true,
-                    progressBar: true,
-                    progressBarEasing: 'ease',
-                    class: icon+'-notify',
-                    title: heading,
-                    message: text,
-                    position: position,
-                    timeout: timeout,
-                    layout: 2,
-                    transitionIn: 'flipInX',
-                    transitionOut: 'flipOutX',
-                    balloon: false,
-                });
                 switch (icon){
                     case 'success':
                         var msg = {
@@ -5473,7 +5459,21 @@ function message(heading,text,position,color,icon,timeout){
                             icon: 'mdi mdi-alert-circle-outline',
                         };
                 }
-                iziToast.show(msg);
+                iziToast.show({
+                    close: true,
+                    progressBar: true,
+                    progressBarEasing: 'ease',
+                    class: icon+'-notify',
+                    title: heading,
+                    message: text,
+                    position: position,
+                    timeout: timeout,
+                    layout: 2,
+                    transitionIn: 'flipInX',
+                    transitionOut: 'flipOutX',
+                    balloon: false,
+                    icon: msg['icon'],
+                });
                 break;
             case 'alertify':
                 var msgFull = (heading !== '') ? heading + '<br/>' + text : text;