ソースを参照

Merge pull request #1819 from causefx/v2-develop

V2 develop
causefx 4 年 前
コミット
24d2f25ac7
4 ファイル変更17 行追加7 行削除
  1. 1 1
      api/classes/organizr.class.php
  2. 3 0
      api/functions/log-functions.php
  3. 6 6
      js/functions.js
  4. 7 0
      js/version.json

+ 1 - 1
api/classes/organizr.class.php

@@ -65,7 +65,7 @@ class Organizr
 
 	// ===================================
 	// Organizr Version
-	public $version = '2.1.1800';
+	public $version = '2.1.1810';
 	// ===================================
 	// Quick php Version check
 	public $minimumPHP = '7.3';

+ 3 - 0
api/functions/log-functions.php

@@ -211,6 +211,9 @@ trait LogFunctions
 	{
 		if ($this->hasDB()) {
 			$setLogger = false;
+			if ($username) {
+				$username = filter_var($username, FILTER_SANITIZE_STRING);
+			}
 			if ($this->logger) {
 				if ($channel) {
 					if (strtolower($this->logger->getChannel()) !== strtolower($channel)) {

+ 6 - 6
js/functions.js

@@ -288,7 +288,7 @@ function isNumberKey(evt) {
 function setTabInfo(id,action,value){
     let tabInfo = findTab(id);
     if(!tabInfo){
-        organizrConsole('Set Tab Info', 'No Tab Info Found...', 'error');
+        organizrConsole('Set Tab Info', 'No Tab Info Found... Id: '+id, 'error');
         return false;
     }
     let tab = cleanClass(tabInfo.name);
@@ -668,7 +668,7 @@ function toggleParentActive(id){
 function swapBodyClass(id){
     let tabInfo = findTab(id);
     if(!tabInfo){
-        organizrConsole('Switch Tab', 'No Tab Info Found...', 'error');
+        organizrConsole('Swap Body', 'No Tab Info Found... Id: '+id, 'error');
         return false;
     }
     let prior = $('body').attr('data-active-tab');
@@ -694,7 +694,7 @@ function switchToPlugin(plugin){
 function switchTab(id, split = null){
     let tabInfo = findTab(id);
     if(!tabInfo){
-        organizrConsole('Switch Tab', 'No Tab Info Found...', 'error');
+        organizrConsole('Switch Tab', 'No Tab Info Found... Id: '+id, 'error');
         return false;
     }
 	if(activeInfo.settings.misc.collapseSideMenuOnClick){
@@ -3087,7 +3087,7 @@ function buildFrame(id, split = null){
 	let extra = split ? 'right-' : '';
     let tabInfo = findTab(id);
     if(!tabInfo){
-        organizrConsole('Build Frame', 'No Tab Info Found...', 'error');
+        organizrConsole('Build Frame', 'No Tab Info Found... Id: '+id, 'error');
         return false;
     }
     var sandbox = activeInfo.settings.misc.sandbox;
@@ -3108,7 +3108,7 @@ function buildInternalContainer(id, split = null){
 function buildMenuList(id){
     let tabInfo = findTab(id);
     if(!tabInfo){
-        organizrConsole('Build Menu List', 'No Tab Info Found...', 'error');
+        organizrConsole('Build Menu List', 'No Tab Info Found... Id: '+id, 'error');
         return false;
     }
     let name = tabInfo.name;
@@ -4547,7 +4547,7 @@ function loadInternal(id, split = null){
 	let extra = split ? 'right-' : '';
     let tabInfo = findTab(id);
     if(!tabInfo){
-        organizrConsole('Load Internal', 'No Tab Info Found...', 'error');
+        organizrConsole('Load Internal', 'No Tab Info Found... Id: '+id, 'error');
         return false;
     }
     let url = tabInfo.access_url;

+ 7 - 0
js/version.json

@@ -537,5 +537,12 @@
     "new": "",
     "fixed": "fixed issue where if no default tab was set nothing would load|fixed sso bug that didnt pass user object correctly",
     "notes": "replace old setAPIResponse on some items to setResponse"
+  },
+  "2.1.1810": {
+    "date": "2022-04-10 03:19",
+    "title": "Small Update",
+    "new": "added id to logging for tab actions",
+    "fixed": "",
+    "notes": "sanitized username for logging functions"
   }
 }