diff --git a/www/js/DataModel.js b/www/js/DataModel.js index a2ef3647d..72d4fc271 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -139,13 +139,31 @@ angular.module('zmApp.controllers') //-------------------------------------------------------------------------- // uses fileLogger to write logs to file for later investigation //-------------------------------------------------------------------------- + + // separate out a debug so we don't do this if comparison for normal logs + function zmDebug(val) { + if (loginData.enableDebug && loginData.enableLogs) + { + if (val!== undefined) + { + var regex1 = /"password":".*?"/g; + var regex2 = /&pass=.*?(?=["&]|$)/g; + + //console.log ("VAL IS " + val); + val = val.replace(regex1, ""); + val = val.replace(regex2, ""); + } + $fileLogger.debug(val); + } + } + function zmLog(val, logtype) { if (loginData.enableLogs) { if (val!== undefined) { var regex1 = /"password":".*?"/g; - var regex2 = /&pass=.*?&/g; + var regex2 = /&pass=.*?(?=["&]|$)/g; //console.log ("VAL IS " + val); val = val.replace(regex1, ""); @@ -183,20 +201,7 @@ angular.module('zmApp.controllers') } - // separate out a debug so we don't do this if comparison for normal logs - function zmDebug(val) { - if (loginData.enableDebug && loginData.enableLogs) - { - if (val!== undefined) - { - var regex = /"password":".*?"/g; - - //console.log ("VAL IS " + val); - val = val.replace(regex, ""); - } - $fileLogger.debug(val); - } - } + //credit: https://gist.github.com/alexey-bass/1115557 function versionCompare(left, right) { diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index 088379b8a..2d166e74a 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -40,8 +40,8 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ } }) .success(function (data, status, headers) { - console.log("LOOKING FOR " + zm.loginScreenString); - console.log("DATA RECEIVED " + JSON.stringify(data)); + //console.log("LOOKING FOR " + zm.loginScreenString); + //console.log("DATA RECEIVED " + JSON.stringify(data)); if (data.indexOf(zm.loginScreenString) == -1) { $scope.wizard.loginURL = $scope.wizard.fqportal; @@ -79,7 +79,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ var d = $q.defer(); $http.get($scope.wizard.apiURL + "/monitors.json") .then(function (success) { - console.log("getfirst monitor success: " + JSON.stringify(success)); + // console.log("getfirst monitor success: " + JSON.stringify(success)); if (success.data.monitors.length > 0) { var foundMid = -1; for (var i = 0; i < success.data.monitors.length; i++) { @@ -416,7 +416,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ var b = ""; if ($scope.wizard.useauth && $scope.wizard.usebasicauth) { b = $scope.wizard.basicuser + ":" + $scope.wizard.basicpassword + "@"; - console.log("B=" + b); + //console.log("B=" + b); } var u = c.scheme + "://" + b + c.host; if (c.port) u += ":" + c.port;